1 | const { addMissingRules } = require("./utils");
|
2 |
|
3 |
|
4 | module.exports = {
|
5 | settings: {
|
6 | "import/resolver": {
|
7 | node: {
|
8 | extensions: [".js", ".jsx", ".json"]
|
9 | }
|
10 | },
|
11 | react: {
|
12 | version: "detect"
|
13 | }
|
14 | },
|
15 | parserOptions: {
|
16 | ecmaFeatures: {
|
17 | jsx: true
|
18 | }
|
19 | },
|
20 | rules: {
|
21 |
|
22 | "@swissquote/swissquote/react/display-name": 0,
|
23 | "@swissquote/swissquote/react/jsx-no-duplicate-props": [
|
24 | "error",
|
25 | { ignoreCase: true }
|
26 | ],
|
27 | "@swissquote/swissquote/react/no-deprecated": "warn",
|
28 | "@swissquote/swissquote/react/prop-types": [
|
29 | "warn",
|
30 | { skipUndeclared: true }
|
31 | ],
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | "@swissquote/swissquote/react/jsx-handler-names": "off",
|
37 | "@swissquote/swissquote/react/jsx-pascal-case": "error",
|
38 | "@swissquote/swissquote/react/no-did-mount-set-state": "error",
|
39 | "@swissquote/swissquote/react/no-did-update-set-state": "error",
|
40 | "@swissquote/swissquote/react/no-redundant-should-component-update":
|
41 | "error",
|
42 | "@swissquote/swissquote/react/no-typos": "error",
|
43 | "@swissquote/swissquote/react/no-unused-state": "error",
|
44 | "@swissquote/swissquote/react/no-will-update-set-state": "error",
|
45 | "@swissquote/swissquote/react/prefer-es6-class": ["error", "always"],
|
46 | "@swissquote/swissquote/react/prefer-stateless-function": [
|
47 | "error",
|
48 | { ignorePureComponents: true }
|
49 | ],
|
50 | "@swissquote/swissquote/react/void-dom-elements-no-children": "error"
|
51 | }
|
52 | };
|
53 |
|
54 |
|
55 | addMissingRules(
|
56 | require("eslint-plugin-react").configs.recommended.rules,
|
57 | module.exports.rules
|
58 | );
|
59 |
|
60 |
|
61 | addMissingRules(
|
62 | require("eslint-plugin-react-hooks").configs.recommended.rules,
|
63 | module.exports.rules
|
64 | );
|
65 |
|
66 |
|
67 | addMissingRules(
|
68 | require("eslint-config-prettier/react").rules,
|
69 | module.exports.rules
|
70 | );
|