-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
74 lines (72 loc) · 1.89 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
const fs = require("fs");
const path = require("path");
const restrictedPaths = [].map((pkg) =>
fs
.readdirSync(path.dirname(require.resolve(`${pkg.name}/package.json`)))
.map((component) => ({
name: `${pkg.name}/${component}`,
message: `This loads CommonJS version of the package. To fix replace with: import { ${component} } from "${pkg.name}";`,
}))
);
module.exports = {
extends: [
"eslint-config-react-app",
// "plugin:testing-library/react",
"plugin:jest-dom/recommended",
"plugin:prettier/recommended",
],
// plugins: ["testing-library", "jest-dom"],
rules: {
// "no-script-url": "warn",
"jsx-a11y/anchor-is-valid": "warn",
"no-restricted-imports": [
"error",
{ paths: [].concat(...restrictedPaths) },
],
"no-multiple-empty-lines": ["warn", { max: 1, maxBOF: 0, maxEOF: 0 }],
"prettier/prettier": ["warn"],
"sort-imports": [
"warn",
{
ignoreCase: false,
ignoreDeclarationSort: true, // don"t want to sort import lines, use eslint-plugin-import instead
ignoreMemberSort: false,
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
allowSeparatedGroups: true,
},
],
"import/order": [
"warn",
{
groups: [
"builtin",
"external",
"internal",
["parent", "sibling"],
"index",
"object",
],
pathGroups: [
{
pattern: "react",
group: "builtin",
position: "before",
},
],
"newlines-between": "always",
alphabetize: {
order: "asc",
caseInsensitive: true,
},
},
],
},
settings: {
"import/resolver": {
typescript: {
project: "./tsconfig.json",
},
},
},
ignorePatterns: ["node_modules", "build", "src/generated-types"],
};