-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
50 lines (50 loc) · 1.64 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
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:sonarjs/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jsx-a11y/strict',
'plugin:import/recommended',
'plugin:import/typescript',
// Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier.
'prettier/@typescript-eslint',
// Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:prettier/recommended',
'plugin:@next/next/recommended',
],
// most plugins append this array with their 'extends' -config
plugins: ['react-hooks', 'sonarjs'],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: './tsconfig.json',
ecmaFeatures: { jsx: true }
},
settings: {
react: {
version: 'detect'
}
},
rules: {
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/no-floating-promises': 'error',
'no-invalid-this': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'react/prop-types': 0, // TS handles PropTypes
'import/no-default-export': 'error'
},
overrides: [
{
files: ['pages/**/*'],
rules: {
'import/no-default-export': 0,
'import/no-named-export': 'error'
}
}
]
};