generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 39
/
.eslintrc.js
103 lines (103 loc) · 3.02 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
module.exports = {
extends: [
"react-app",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier",
"plugin:storybook/recommended",
],
plugins: ["testing-library", "unused-imports", "jest-dom", "prettier"],
env: {
browser: true,
node: false,
es6: true,
},
globals: {
RequestInit: true,
process: "readonly",
cy: "readonly",
},
rules: {
"import/no-unresolved": "off",
"import/first": "warn",
"import/order": [
"warn",
{
"newlines-between": "always",
pathGroups: [
{
pattern: "~/**",
group: "external",
position: "after",
},
],
},
],
"import/newline-after-import": "warn",
"import/no-commonjs": "off",
"import/no-named-as-default": "off",
"prettier/prettier": "error",
"arrow-body-style": "off",
"prefer-arrow-callback": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
camelcase: [
"warn",
{
allow: ["days_to_show", "organization_id", "sending_at"],
},
],
},
overrides: [
{
files: ["**/*.stories.*"],
rules: {
"import/no-anonymous-default-export": "off",
},
},
{
files: [
"./src/**/__tests__/**/*.[jt]s?(x)",
"./src/**/?(*.)+(spec|test).[jt]s?(x)",
],
extends: [
"plugin:testing-library/react",
"plugin:jest-dom/recommended",
],
rules: {
"testing-library/no-render-in-setup": [
"error",
{
allowTestingFrameworkSetupHook: "beforeEach",
},
],
"testing-library/no-node-access": "off",
"testing-library/prefer-screen-queries": "warn",
"testing-library/no-unnecessary-act": "warn",
"testing-library/no-await-sync-query": "warn",
},
},
{
plugins: ["chai-friendly"],
files: ["**/cypress/**/*.[jt]s?(x)"],
extends: ["plugin:cypress/recommended"],
rules: {
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "off",
"chai-friendly/no-unused-expressions": "error",
},
},
],
settings: {
"import/resolver": {},
},
ignorePatterns: ["node_modules/", "build/", "src/reportWebVitals.js"],
};