Skip to content

Commit 2f2e58c

Browse files
committed
feat: update eslint config for react:ts
1 parent 6bce970 commit 2f2e58c

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/categories/js/eslint/config/config.interface.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export interface EslintConfig {
1212
node?: boolean;
1313
browser?: boolean;
1414
jest?: boolean;
15+
es2020?: boolean;
1516
};
1617
root?: boolean;
1718
ignorePatterns?: string[];

src/categories/js/eslint/config/react:ts.config.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,29 @@ export const reactTsConfig: Config = {
88
'eslint-plugin-beautiful-sort',
99
'eslint-config-airbnb',
1010
'eslint-config-airbnb-typescript',
11+
'eslint-plugin-react-refresh',
12+
'eslint-plugin-react-hooks',
1113
],
1214
eslintConfig: {
1315
parser: '@typescript-eslint/parser',
1416
parserOptions: {
1517
project: 'tsconfig.json',
18+
ecmaVersion: 'latest',
1619
sourceType: 'module',
1720
},
18-
plugins: ['@typescript-eslint/eslint-plugin', 'beautiful-sort'],
19-
extends: ['plugin:@typescript-eslint/recommended', 'airbnb', 'airbnb-typescript'],
21+
plugins: ['@typescript-eslint/eslint-plugin', 'beautiful-sort', 'react-refresh'],
22+
extends: [
23+
'eslint:recommended',
24+
'plugin:@typescript-eslint/recommended',
25+
'plugin:react-hooks/recommended',
26+
'airbnb',
27+
'airbnb-typescript',
28+
],
2029
root: true,
2130
env: {
2231
es6: true,
2332
browser: true,
33+
es2020: true,
2434
node: true,
2535
},
2636
ignorePatterns: ['.eslintrc.js'],
@@ -50,6 +60,8 @@ export const reactTsConfig: Config = {
5060
order: ['special', 'namespace', 'default', 'defaultObj', 'obj', 'none'],
5161
},
5262
],
63+
64+
'react-refresh/only-export-components': 'warn',
5365
},
5466
},
5567
ignore: ['node_modules', 'dist'],

0 commit comments

Comments
 (0)