-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy path.eslintrc.js
55 lines (54 loc) · 1.82 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
const confusingBrowserGlobals = require('confusing-browser-globals');
module.exports = {
extends: ['eslint:recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react-hooks', 'import', '@tanstack/query'],
env: { browser: true },
rules: {
'no-console': 'warn',
quotes: ['error', 'single', { avoidEscape: true }],
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
'no-use-before-define': ['error', { classes: false }],
'no-restricted-globals': ['error']
.concat(confusingBrowserGlobals)
.concat(['origin']),
'import/order': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@tanstack/query/exhaustive-deps': 'error',
'@tanstack/query/prefer-query-object-syntax': 'error',
},
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: ['plugin:@typescript-eslint/recommended'],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/no-var-requires': 'off', // to be able to require resources, e.g. .png, .jpg
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': 'off', // checked by TypeScript's 'noUnusedLocals'
'no-unused-vars': 'off', // checked by TypeScript's 'noUnusedLocals'
'react/prop-types': 'off', // Use TypeScript types and interfaces instead
},
},
{
files: [
'.eslintrc.js',
'.prettierrc.js',
'babel.config.js',
'postcss.config.js',
'jest.config.js',
'*.node.js',
'webpack.config.js',
'*.cjs',
],
env: { node: true },
rules: {
'import/no-commonjs': 'off',
'import/no-nodejs-modules': 'off',
},
},
],
};