-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
115 lines (112 loc) · 3.94 KB
/
.eslintrc
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
108
109
110
111
112
113
114
115
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"],
"ecmaFeatures": {
"jsx": true // enable linting for jsx files
}
},
"extends": [
"eslint:recommended",
"airbnb",
"airbnb/hooks",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly",
"assert": true
},
"settings": {
"react": {
"version": "detect"
}
},
"plugins": ["@typescript-eslint", "react", "react-hooks", "simple-import-sort"],
"rules": {
"prettier/prettier": [
"error",
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"printWidth": 110,
"jsxBracketSameLine": true
}
],
// NextJs specific fix: suppress errors for missing 'import React' in files for nextjs
"camelcase": "off",
"no-useless-return": "off",
"no-var": "warn",
"no-shadow": "off",
"no-console": "warn",
"no-lonely-if": "off",
"eqeqeq": ["warn", "always", { "null": "ignore" }],
"no-use-before-define": "off",
"no-nested-ternary": "warn",
"no-trailing-spaces": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-unused-vars": "off", // "warn" for production
"@typescript-eslint/no-explicit-any": "off", // "warn" for production
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/no-object-literal-type-assertion": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/restrict-plus-operands": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-floating-promises": "warn",
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/unbound-method": "off", // for React DND
"@typescript-eslint/no-empty-interface": "warn",
"react/react-in-jsx-scope": "off",
// NextJs specific fix: allow jsx syntax in js files
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }], //should add ".ts" if typescript project
"react/display-name": 1,
"react/jsx-props-no-spreading": "off",
"react/no-array-index-key": "warn",
"react-hooks/exhaustive-deps": "warn",
"react/require-default-props": "off",
"react/jsx-closing-bracket-location": "off",
"react/button-has-type": "off",
"react/prop-types": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/label-has-associated-control": "off", // not working well with React components
"jsx-a11y/anchor-is-valid": "off",
"react/jsx-fragments": "off",
"react/jsx-uses-react": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-wrap-multilines": ["error", { "declaration": false, "assignment": false }], // to solve the conflict with prettier
"import/prefer-default-export": "off",
"import/extensions": [
"error",
"ignorePackages",
{
"js": "never",
"jsx": "never",
"ts": "never",
"tsx": "never",
"": "never" // this is for solving the error that sometime appears even though we set rules for all extensions we use up above
}
],
"import/no-unresolved": "off",
"simple-import-sort/imports": "error"
}
}