-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
98 lines (91 loc) · 4.02 KB
/
eslint.config.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
import tseslint from 'typescript-eslint';
import parser from "@typescript-eslint/parser";
import eslintPlugin from "@typescript-eslint/eslint-plugin";
import reactHooks from "eslint-plugin-react-hooks";
import eslintPluginPrettier from "eslint-plugin-prettier";
import eslintPluginReact from "eslint-plugin-react";
export default tseslint.config(
{
languageOptions: {
parser,
},
plugins: {
'react-hooks': reactHooks,
'prettier': eslintPluginPrettier,
'react': eslintPluginReact,
'@typescript-eslint': eslintPlugin,
},
settings: {
react: {
version: "detect"
}
},
files: ["packages/**/src/**/*.ts", "packages/**/src/**/*.tsx", ],
rules: {
// General
'class-methods-use-this': 'off',
'global-require': 'error',
'prefer-arrow-callback': ['error', {allowNamedFunctions: true}],
'no-return-assign': ['error', 'except-parens'],
'no-console': ['error'],
'no-plusplus': 'off',
'lines-between-class-members': ['off'],
'no-use-before-define': ['off'],
'func-names': ['error', 'always'],
'no-alert': ['error'],
// Typescript
'@typescript-eslint/indent': ['off'],
'@typescript-eslint/no-unused-vars': ['error', {varsIgnorePattern: 'd'}],
'@typescript-eslint/no-unused-expressions': ['off'], // This was disabled because some upgrade to airbnb rules.
'@typescript-eslint/explicit-member-accessibility': ['off'],
'@typescript-eslint/explicit-function-return-type': ['off', {allowExpressions: true, allowTypedFunctionExpressions: true}],
'@typescript-eslint/no-explicit-any': ['off'],
'@typescript-eslint/ban-ts-ignore': ['off'],
'@typescript-eslint/ban-ts-comment': ['off'],
'@typescript-eslint/lines-between-class-members': ['off'],
'@typescript-eslint/interface-name-prefix': ['off'],
'@typescript-eslint/no-before-define': ['off'], // This was disabled to support optional chaining: https://github.com/typescript-eslint/typescript-eslint/issues/1116
'@typescript-eslint/explicit-module-boundary-types': ['off'],
// React
'react/jsx-uses-react': ['off'],
'react/react-in-jsx-scope': ['off'],
'react/jsx-indent': ['off'],
'react/jsx-indent-props': ['off'],
'react/jsx-filename-extension': ['error', {extensions: ['.tsx']}],
'react/require-default-props': 'off',
'react/prefer-stateless-function': 'error',
'react/no-unknown-property': ['error', {ignore: ['for']}],
'react/no-unused-prop-types': 'off',
'react/no-typos': 'off',
'react/no-children-prop': 'off',
'react/destructuring-assignment': ['off', 'always'],
'react/jsx-curly-newline': ['off'],
'react/jsx-one-expression-per-line': 'off',
'react/jsx-props-no-spreading': ['off'],
'react/jsx-wrap-multilines': ['off'],
'react/display-name': ['off'],
'react/prop-types': ['off'],
// ES6 Import
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'import/extensions': 'off',
'import/no-named-default': 'off',
'import/no-default-export': 'off',
// JSX a11y
'jsx-a11y/label-has-for': 'off',
'jsx-a11y/anchor-is-valid': 'off',
'jsx-a11y/label-has-associated-control': 'off',
// React Hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// Prettier
'prettier/prettier': [
"error",
{
"endOfLine": "auto"
},
],
}
}
);