-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.js
68 lines (67 loc) · 1.96 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
63
64
65
66
67
68
const path = require('path');
module.exports = {
env: { es2020: true, jest: true },
extends: ['airbnb', 'next/core-web-vitals', 'prettier'],
parser: '@typescript-eslint/parser',
plugins: [
'import',
'unused-imports',
'@typescript-eslint',
'react',
'react-hooks',
'jsx-a11y',
'prettier',
],
rules: {
'no-param-reassign': ['error', { props: false }],
'no-return-await': 'error',
'prefer-destructuring': [
'error',
{
array: false,
object: true,
},
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'react/require-default-props': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }],
'react/jsx-key': 'error',
'react/jsx-boolean-value': ['error', 'never'],
'react/jsx-no-constructed-context-values': 'off',
'react/jsx-curly-brace-presence': ['error', 'never'],
'import/no-unresolved': 'error',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/extensions': ['error', 'never', { json: 'always' }],
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
'no-unused-vars': 'off',
'@next/next/no-html-link-for-pages': [
'error',
[
path.join(__dirname, 'packages/app/src/app/'),
path.join(__dirname, 'packages/landing/src/app/'),
],
],
},
globals: {
globalThis: false,
React: 'readonly',
AriaAttributes: 'readonly',
DOMAttributes: 'readonly',
HTMLAnchorElement: 'readonly',
JSX: true,
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
project: 'packages/*/tsconfig.json',
},
},
},
};