This repository has been archived by the owner on Sep 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
68 lines (68 loc) · 2.65 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"airbnb-typescript",
"airbnb/hooks",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["react", "simple-import-sort", "@typescript-eslint"],
"rules": {
"array-callback-return": "off", // Allows us not to return anything from arrow functions.
"consistent-return": "off", // Same as above.
"import/prefer-default-export": "off", // Allows us to use named exports.
"no-underscore-dangle": "off", // Ignore underscores in e.g. GraphQL type names etc.
"react/jsx-props-no-spreading": "off", // Allow prop spreading.
"react-hooks/rules-of-hooks": "off", // Allow calling e.g. `useDayjs` within JSX.
"react/require-default-props": "off", // Allow defining default props in the signature.
"react/prop-types": "off", // Allows us to not use prop-types.
"simple-import-sort/imports": "error", // Require imports to be ordered correctly.
"simple-import-sort/exports": "error", // Require exports to be ordered correctly.
"@typescript-eslint/ban-ts-comment": "off", // Allows us to make TS ignores with ignore comments.
"@typescript-eslint/no-non-null-assertion": "off", // Allows us to make non-null assertions for e.g. ref objects that are cumbersome to use with TS.
"@typescript-eslint/no-unused-vars": "error", // Show error instead of the default warning for unused variables.
"@typescript-eslint/naming-convention": "off", // Allows usage of e.g. underscores in variable names.
"no-restricted-imports": [
"error",
{
"paths": [
"@material-ui/core",
"@material-ui/icons",
"@material-ui/core/useMediaQuery",
"__generated__/src/graphql/common.graphql"
],
"patterns": [
// https://material-ui.com/guides/minimizing-bundle-size/#option-1
"@material-ui/*/*/*",
"!@material-ui/core/test-utils/*"
]
}
],
// TODO: Under this comment, remove all rule overrides and make the necessary refactors to fix the linting errors.
"react/no-array-index-key": "off",
"no-restricted-globals": "off",
"no-restricted-syntax": "off",
"@typescript-eslint/no-shadow": "off",
"no-await-in-loop": "off"
},
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"@typescript-eslint/explicit-function-return-type": ["error"] // Require return types for all functions.
}
}
]
}