-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.eslintrc
112 lines (112 loc) · 3.55 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
{
"env": {
"es6": true,
"browser": true,
"jest": true,
"cypress/globals": true
},
"extends": ["airbnb", "prettier"],
"globals": { "renderWithL10n": true },
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"plugins": ["cypress", "react-hooks", "better-styled-components"],
"ignorePatterns": ["**/*.d.ts"], // For script generated typing files
"rules": {
"no-shadow": "off",
"camelcase": "off",
"class-methods-use-this": "off",
"consistent-return": "off",
"import/extensions": "off",
"import/no-cycle": "off",
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": false,
"optionalDependencies": false,
"peerDependencies": true
}
],
"import/no-named-as-default": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"jsx-a11y/href-no-hash": "off",
"jsx-a11y/label-has-for": "off",
"new-cap": "off",
"no-plusplus": "off",
"no-console": "off",
"no-restricted-syntax": [
"error",
{
"selector": "ImportDeclaration[source.value=\"prop-types\"] :matches(ImportSpecifier, ImportNamespaceSpecifier)",
"message": "Prefer `import PropTypes from \"prop-types\";`"
},
{
"selector": "ImportDeclaration[source.value=\"react\"] :matches(ImportSpecifier, ImportNamespaceSpecifier)",
"message": "Prefer accessing properties of `React` import, e.g. `React.Component`"
},
{
"selector": "ImportDeclaration[source.value=/\\.styles/] ImportNamespaceSpecifier[local.name!=/^(sc|Sbook)$/]",
"message": "Prefer naming styled components import `sc` (`Sbook` for Storybook components)"
}
],
"no-underscore-dangle": "off",
"prefer-destructuring": "off",
"react/destructuring-assignment": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".ts", ".tsx"] }],
"react/jsx-one-expression-per-line": "off",
"react/no-multi-comp": "off",
"react/prefer-stateless-function": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"better-styled-components/sort-declarations-alphabetically": "error",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
"react/jsx-no-bind": "off",
"react/jsx-props-no-spreading": "off"
},
"overrides": [
{
"files": "**/*.+(ts|tsx)",
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended", "plugin:prettier/recommended"],
"settings": {
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"]
}
}
},
"rules": {
"@typescript-eslint/no-unused-vars": ["warn", { "args": "none", "ignoreRestSiblings": true }],
"prefer-const": 0,
"@typescript-eslint/no-non-null-assertion": "off"
}
},
{
"files": ["packages/**/stories/**/*.+(js|tsx|ts|tsx)"],
"rules": {
"react/prop-types": "off",
"import/no-extraneous-dependencies": "off",
"no-alert": "off"
}
},
{
"files": ["packages/**/*.spec.+(js|tsx|ts|tsx)"],
"rules": { "import/no-extraneous-dependencies": "off" },
"globals": {
"given": true
}
},
{
"files": ["packages/helpers/**/*.js"],
"rules": { "import/no-extraneous-dependencies": "off" }
}
]
}