-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
107 lines (105 loc) · 3.84 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/** @type {import("eslint").Linter.Config} */
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'next/core-web-vitals',
],
ignorePatterns: ['**/.next/**', '**/.eslintrc.js'],
parserOptions: {
project: true,
tsconfigRootDir: '.',
},
plugins: ['@typescript-eslint'],
overrides: [
{
files: [
'pages/**',
'src/pages/**',
'next.config.js',
'app/**/{head,layout,loading,page,error,not-found}.tsx',
],
},
],
rules: {
// borrowing rules from [typehero/tooling/config-eslint/utils/rules.js](https://github.com/typehero/typehero/blob/main/tooling/config-eslint/utils/rules.js)
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/sort-type-constituents': 'warn',
'no-floating-decimal': 'warn',
'react/no-unescaped-entities': 'off',
'unicorn/filename-case': 'off',
'@typescript-eslint/consistent-type-imports': [
'warn',
{ disallowTypeAnnotations: false },
],
'react-hooks/exhaustive-deps': 'off',
// Rules below here can be re-enabled when the team wants to address them.
// When this repo was first monorepo'ed and given tighter checks,
// there were too many issues to address all at once.
// They are organized into groups based on what type of warning they are.
// ---
// Potential Bugs
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
camelcase: 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'off',
'no-await-in-loop': 'off',
'no-param-reassign': 'off',
'no-constant-binary-expression': 'off',
'import/no-cycle': 'off',
'import/order': 'off',
'tsdoc/syntax': 'off',
'react/no-array-index-key': 'off',
'react/no-unstable-nested-components': 'off',
'react/function-component-definition': 'off',
eqeqeq: 'off',
'no-control-regex': 'off',
'no-return-await': 'off',
'@typescript-eslint/require-await': 'off',
// Best practice/readability
// Some of these might be opinions.
// You can ignore if you'd like.
'eslint-comments/no-unlimited-disable': 'off',
'prefer-named-capture-group': 'off',
'prefer-regex-literals': 'off',
'@typescript-eslint/naming-convention': 'off',
'import/no-default-export': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/prefer-optional-chain': 'off',
'react/jsx-no-useless-fragment': 'off',
'no-nested-ternary': 'off',
'react/jsx-sort-props': 'off',
'react/hook-use-state': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'func-names': 'off',
'no-console': 'off',
// a11y
'jsx-a11y/html-has-lang': 'off',
'jsx-a11y/no-redundant-roles': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/anchor-has-content': 'off',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/no-static-element-interactions': 'off',
'jsx-a11y/click-events-have-key-events': 'off',
'jsx-a11y/heading-has-content': 'off',
'react/button-has-type': 'off',
},
env: {
es6: true,
},
root: true,
};