|
5 | 5 | "impliedStrict": true |
6 | 6 | } |
7 | 7 | }, |
8 | | - "plugins": ["jest"], |
| 8 | + "plugins": ["jest", "node", "prettier"], |
9 | 9 | "extends": [ |
| 10 | + "eslint:recommended", |
| 11 | + "airbnb-base", |
| 12 | + "plugin:node/recommended", |
10 | 13 | "plugin:jest/recommended", |
11 | | - "plugin:jest/style" |
| 14 | + "plugin:jest/style", |
| 15 | + "prettier", |
| 16 | + "plugin:prettier/recommended" |
12 | 17 | ], |
13 | 18 | "env": { |
14 | 19 | "es2020": true, |
15 | 20 | "jest/globals": true, |
16 | 21 | "node": true |
17 | 22 | }, |
18 | 23 | "rules": { |
19 | | - "curly": 2, |
20 | | - "no-eq-null": 2, |
21 | | - "comma-dangle": [ 2, "always-multiline" ], |
22 | | - "no-caller": 2, |
23 | | - "dot-notation": 0, |
24 | | - "no-debugger": 2, |
25 | | - "no-undef": 2, |
26 | | - "no-unused-vars": 2, |
27 | | - "semi": 2, |
28 | | - "arrow-parens": [2, "as-needed"] |
| 24 | + ///////////////////////////////////////// Our rules ///////////////////////////////////////// |
| 25 | + "no-eq-null": "error", |
| 26 | + |
| 27 | + ///////////////////////////////////////// Overrides //////////////////////////////////////// |
| 28 | + "prettier/prettier": "warn", |
| 29 | + "no-console": "off", |
| 30 | + "class-methods-use-this": "off", |
| 31 | + "no-continue": "off", |
| 32 | + // Overwrites airbnb-base because our Node version doesn't allow to use private properies syntax yet, so we use underscores |
| 33 | + "no-underscore-dangle": ["error", { "allowAfterThis": true }], |
| 34 | + // Overwrites airbnb-base to allow for..of: |
| 35 | + "no-restricted-syntax": [ |
| 36 | + "error", |
| 37 | + { |
| 38 | + "selector": "ForInStatement", |
| 39 | + "message": "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array." |
| 40 | + }, |
| 41 | + { |
| 42 | + "selector": "LabeledStatement", |
| 43 | + "message": "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand." |
| 44 | + }, |
| 45 | + { |
| 46 | + "selector": "WithStatement", |
| 47 | + "message": "`with` is disallowed in strict mode because it makes code impossible to predict and optimize." |
| 48 | + } |
| 49 | + ], |
| 50 | + // Overwrites airbnb-base because woks badly with prettier making multyline strings ugly |
| 51 | + "prefer-template": "off" |
29 | 52 | } |
30 | 53 | } |
0 commit comments