Skip to content

Commit a646b30

Browse files
[FSSDK-10440] linter: eslint + prettier update
1 parent af9d4d3 commit a646b30

File tree

5 files changed

+644
-647
lines changed

5 files changed

+644
-647
lines changed

.eslintrc.js

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

.vscode/settings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{
22
"jest.runMode": "on-demand",
3-
"jest.jestCommandLine": "~/.nvm/nvm-exec yarn test"
3+
"jest.jestCommandLine": "~/.nvm/nvm-exec yarn test",
4+
"eslint.enable": true,
5+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
6+
"prettier.requireConfig": true,
7+
// Auto format on save is off for now. Use Alt+Shift+F to format the file.
8+
// In future it might be turned on
9+
"editor.formatOnSave": false,
10+
"editor.codeActionsOnSave": {
11+
"source.fixAll.eslint": "never"
12+
},
13+
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
415
}

eslint.config.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import { fixupConfigRules } from '@eslint/compat';
2+
import globals from 'globals';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
import js from '@eslint/js';
6+
import { FlatCompat } from '@eslint/eslintrc';
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all,
14+
});
15+
16+
export default [
17+
...fixupConfigRules(
18+
compat.extends(
19+
'plugin:react-hooks/recommended',
20+
'eslint:recommended',
21+
'plugin:@typescript-eslint/recommended',
22+
'plugin:prettier/recommended'
23+
)
24+
),
25+
{
26+
languageOptions: {
27+
globals: {
28+
...globals.browser,
29+
...globals.jest,
30+
...globals.mocha,
31+
...globals.node,
32+
},
33+
34+
ecmaVersion: 2015,
35+
sourceType: 'module',
36+
37+
parserOptions: {
38+
ecmaFeatures: {
39+
jsx: true,
40+
},
41+
},
42+
},
43+
44+
rules: {
45+
'@typescript-eslint/ban-ts-ignore': 'off',
46+
'@typescript-eslint/camelcase': 'off',
47+
'@typescript-eslint/no-empty-function': 'off',
48+
'no-shadow': 'error',
49+
},
50+
},
51+
];

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"react": ">=16.8.0"
4444
},
4545
"devDependencies": {
46+
"@eslint/compat": "^1.1.1",
47+
"@eslint/eslintrc": "^3.1.0",
48+
"@eslint/js": "^9.8.0",
4649
"@rollup/plugin-commonjs": "^26.0.1",
4750
"@rollup/plugin-node-resolve": "^15.2.3",
4851
"@rollup/plugin-replace": "^5.0.7",
@@ -55,16 +58,17 @@
5558
"@types/prop-types": "^15.5.6",
5659
"@types/react": "^18.0.15",
5760
"@types/react-dom": "^18.0.6",
58-
"@typescript-eslint/eslint-plugin": "^2.23.0",
59-
"@typescript-eslint/parser": "^2.23.0",
60-
"eslint": "^6.8.0",
61-
"eslint-config-prettier": "^6.10.0",
62-
"eslint-plugin-prettier": "^3.1.2",
63-
"eslint-plugin-react": "^7.19.0",
64-
"eslint-plugin-react-hooks": "^4.1.0",
61+
"@typescript-eslint/eslint-plugin": "^7.18.0",
62+
"@typescript-eslint/parser": "^7.18.0",
63+
"eslint": "^9.8.0",
64+
"eslint-config-prettier": "^9.1.0",
65+
"eslint-plugin-prettier": "^5.2.1",
66+
"eslint-plugin-react": "^7.35.0",
67+
"eslint-plugin-react-hooks": "^4.6.2",
68+
"globals": "^15.8.0",
6569
"jest": "^29.7.0",
6670
"jest-environment-jsdom": "^29.7.0",
67-
"prettier": "1.19.1",
71+
"prettier": "^3.3.3",
6872
"react": "^18.2.0",
6973
"react-dom": "^18.2.0",
7074
"rollup": "^4.19.1",

0 commit comments

Comments
 (0)