-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy patheslint.config.js
52 lines (51 loc) · 1.58 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import react from 'eslint-plugin-react';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
export default [
reactRecommended,
{
files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: typescriptParser,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
'simple-import-sort': simpleImportSort,
},
rules: {
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages. `react` related packages come first.
['^react', '^@?\\w'],
// Internal packages.
['^(src|containers|components|hooks|container|pages|stores|utils|i18n)(/.*|$)'],
// Other local imports. Put same-folder imports and `.` last.
['^\\.\\.(?!/?$)', '^\\.\\./?$', '^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
],
},
],
'simple-import-sort/exports': 'error',
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/ban-types': 'warn',
},
},
];