Skip to content
This repository was archived by the owner on May 23, 2025. It is now read-only.

Commit e0d138e

Browse files
authored
Upgrade react-scripts to 5.0.1 (#505)
* Upgrade react-scripts to 5.0.1 * Add package-lock.json * Remove jsdom v.16 from jest environment * Update package-lock * Upgrade version of jsdom environment * Refactor failing tests * Compress SVGs This is a workaround for a known bug in react-scripts v5. Solution was suggested at facebook/create-react-app#11770 (comment) * Rename eslint config file Rename eslint configuration file * Rename eslint json file * Remove ts-eslint camelcase directives They are useless anyways, as we do not have definition of camelcase rules in config * Fix eslint errors and warnings Some errors and warnings are fixed and some are suppressed * Fix failing login tests * Increase test timeout globally
1 parent 7880157 commit e0d138e

34 files changed

+19329
-26274
lines changed

.eslintrc.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

config.eslint.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
parserOptions: {
4+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
5+
sourceType: 'module', // Allows for the use of imports
6+
ecmaFeatures: {
7+
jsx: true, // Allows for the parsing of JSX
8+
},
9+
},
10+
settings: {
11+
react: {
12+
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
13+
},
14+
},
15+
extends: [
16+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
17+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
18+
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
19+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
20+
],
21+
rules: {
22+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
23+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
24+
},
25+
};

jest.config.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const config: Config.InitialOptions = {
1212
collectCoverageFrom: [
1313
'<rootDir>/src/components/**/*.{ts,tsx}',
1414
'<rootDir>/src/components/*.{ts,tsx}'
15-
]
15+
],
16+
displayName: 'dom',
17+
testEnvironment: 'jest-environment-jsdom',
18+
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
1619
}
1720

18-
export default config;
21+
export default config;

0 commit comments

Comments
 (0)