/
base-no-autofix.js
30 lines (27 loc) · 1.03 KB
/
base-no-autofix.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
/**
* This ESLint config only contains rules from `eslint-plugin-no-autofix`:
* https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix
*
* This allows the fixer for specific core ESLint rules to be turned off.
*
* @type {import("eslint").Linter.Config}
*/
const config = {
plugins: ["no-autofix"],
rules: {
/**
* It is common during development to comment out code after an [early
* return](https://medium.com/swlh/return-early-pattern-3d18a41bba8). In these cases, the
* auto-fixer is harmful, since it would require us to manually go put the return statement back
* after uncommenting the code.
*/
"no-autofix/no-useless-return": "error",
/**
* It is common during development to comment out code that modifies a `let` variable. In these
* cases, the auto-fixer is harmful, since it would require us to manually go change the `const`
* back to a `let` after uncommenting the code.
*/
"no-autofix/prefer-const": "error",
},
};
module.exports = config;