-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
62 lines (62 loc) · 2.07 KB
/
.eslintrc.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
53
54
55
56
57
58
59
60
61
62
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: { jsx: true },
},
settings: { react: { version: 'detect' } },
env: { es2021: true, browser: true, jest: true, node: true },
plugins: ['import', 'simple-import-sort', 'react-hooks', 'prettier'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:prettier/recommended',
'prettier',
'prettier/@typescript-eslint',
],
rules: {
'no-restricted-syntax': [
'error',
{ selector: 'TSEnumDeclaration', message: "Don't declare enums" },
],
'prefer-arrow-callback': 'error',
'func-style': ['error', 'expression'],
'arrow-body-style': ['error', 'always'],
'no-restricted-imports': ['error', { paths: [{ name: 'react', importNames: ['default'] }] }],
'react/react-in-jsx-scope': 0,
'react/display-name': 'error',
'react/destructuring-assignment': ['error', 'never'],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'import/newline-after-import': 'error',
'import/no-default-export': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/consistent-type-imports': ['warn', { prefer: 'type-imports' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'prettier/prettier': [
'error',
{
semi: false,
singleQuote: true,
printWidth: 100,
},
],
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton'],
},
],
},
overrides: [{ files: ['src/pages/**/*.tsx'], rules: { 'import/no-default-export': 'off' } }],
}