generated from dargaCode/webpack-react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
90 lines (89 loc) · 2.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
const allowedWords = require("./spellcheck.allowlist.js");
module.exports = {
extends: [
"airbnb",
"prettier",
"prettier/react",
"plugin:react/recommended",
"plugin:css-modules/recommended",
"plugin:jest/style",
"plugin:jest/recommended",
"plugin:json/recommended",
"plugin:markdown/recommended",
"plugin:promise/recommended",
"plugin:security/recommended",
"plugin:storybook/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking", // slower but more powerful
"prettier/@typescript-eslint", // disable eslint rules which conflict with prettier
"plugin:prettier/recommended" // enables eslint-plugin-prettier and eslint-config-prettier. this will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
plugins: ["react", "css-modules", "prettier", "promise", "spellcheck"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 2018,
sourceType: "module", // allows for the use of imports
ecmaFeatures: {
jsx: true
},
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"]
},
rules: {
"css-modules/no-unused-class": [2, { camelCase: true }],
"css-modules/no-undef-class": [2, { camelCase: true }],
"prettier/prettier": "off", // don't complain about style, just silently fix it
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: true
}
],
"import/extensions": [
"error",
"ignorePackages",
// allow imports to leave off these extensions from the filenames
{
js: "never",
jsx: "never",
ts: "never",
tsx: "never"
}
],
"react/jsx-filename-extension": [2, { extensions: [".jsx", ".tsx"] }], // disallow jsx in .js or .ts files
"react/prop-types": [2, { skipUndeclared: false }],
"react/no-unused-prop-types": [2],
"react/forbid-prop-types": [2],
"react/require-default-props": [2, { forbidDefaultForRequired: true }],
"react/default-props-match-prop-types": [2],
"react/static-property-placement": "off",
/* prefer typescript rule, which doesn't cause false positives with React import */
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"],
"@typescript-eslint/no-loss-of-precision": "off",
"no-plusplus": [2, { allowForLoopAfterthoughts: true }],
"capitalized-comments": [1, "never", { ignorePattern: "TODO" }],
"spellcheck/spell-checker": [
0,
{
skipWords: allowedWords,
skipIfMatch: ["^http"]
}
]
},
env: {
browser: true,
jest: true
},
settings: {
"import/resolver": {
webpack: {
config: "./webpack.common.js"
}
},
react: {
version: "detect"
}
}
};