Skip to content

Commit

Permalink
Upgrade react-scripts to 5.0.1 (#505)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
podliashanyk authored May 2, 2023
1 parent 7880157 commit e0d138e
Show file tree
Hide file tree
Showing 34 changed files with 19,329 additions and 26,274 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

25 changes: 25 additions & 0 deletions config.eslint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true, // Allows for the parsing of JSX
},
},
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
extends: [
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'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.
],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
};
7 changes: 5 additions & 2 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const config: Config.InitialOptions = {
collectCoverageFrom: [
'<rootDir>/src/components/**/*.{ts,tsx}',
'<rootDir>/src/components/*.{ts,tsx}'
]
],
displayName: 'dom',
testEnvironment: 'jest-environment-jsdom',
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
}

export default config;
export default config;
Loading

0 comments on commit e0d138e

Please sign in to comment.