forked from 5733d9e2be6485d52ffa08870cabdee0/sandbox-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
94 lines (93 loc) · 2.46 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
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
extends: [
"plugin:jest/recommended",
"plugin:jest-dom/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
// "plugin:xstate/all", cos-ui // https://issues.redhat.com/browse/MGDOBR-510
"eslint:recommended",
"prettier",
"plugin:storybook/recommended",
],
plugins: [
"@typescript-eslint",
"eslint-plugin-react-hooks",
"jest",
"jest-dom",
"react",
"react-hooks",
"testing-library",
//"xstate", cos-ui https://issues.redhat.com/browse/MGDOBR-510
],
rules: {
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"import/extensions": "off",
"import/no-unresolved": "off",
"object-curly-spacing": ["error", "always"],
"semi": ["error", "always"],
"react/jsx-uses-react": "off",
"react/prop-types": "error",
"react/react-in-jsx-scope": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
"no-unused-vars": "off",
"no-restricted-imports": [
"error",
{
paths: [
{
name: ".",
message:
"Please import sibling components explictly to avoid cyclic dependencies",
},
{
name: "./",
message:
"Please import sibling components explictly to avoid cyclic dependencies",
},
{
name: "dayjs",
message: "Please use date-fns instead",
},
],
},
],
},
settings: {
react: {
version: "999.999.999",
},
},
overrides: [
{
files: [
"**/__tests__/**/*.[jt]s?(x)",
"test/?(*.)+(spec|test).[jt]s?(x)",
],
extends: ["plugin:testing-library/react"],
},
],
ignorePatterns: ["*.typegen.ts"],
globals: {
console: "readonly",
document: "readonly",
JSX: "readonly",
},
env: {
browser: true,
node: true,
},
};