]>
Commit | Line | Data |
---|---|---|
f2a92ac6 DC |
1 | /** |
2 | * @fileoverview Script to update the eslint:all configuration. | |
3 | * @author Nicholas C. Zakas | |
4 | */ | |
5 | ||
6 | "use strict"; | |
7 | ||
8 | //----------------------------------------------------------------------------- | |
9 | // Requirements | |
10 | //----------------------------------------------------------------------------- | |
11 | ||
12 | const fs = require("fs"); | |
13 | const builtInRules = require("../lib/rules"); | |
14 | ||
15 | //------------------------------------------------------------------------------ | |
16 | // Helpers | |
17 | //------------------------------------------------------------------------------ | |
18 | ||
19 | const allRules = {}; | |
20 | ||
21 | for (const [ruleId, rule] of builtInRules) { | |
22 | if (!rule.meta.deprecated) { | |
23 | allRules[ruleId] = "error"; | |
24 | } | |
25 | } | |
26 | ||
27 | //----------------------------------------------------------------------------- | |
28 | // Main | |
29 | //----------------------------------------------------------------------------- | |
30 | ||
31 | const code = `/* | |
32 | * WARNING: This file is autogenerated using the tools/update-eslint-all.js | |
33 | * script. Do not edit manually. | |
34 | */ | |
35 | "use strict"; | |
36 | ||
37 | /* eslint quote-props: off -- autogenerated so don't lint */ | |
38 | ||
39 | module.exports = Object.freeze(${JSON.stringify({ rules: allRules }, null, 4)}); | |
40 | `; | |
41 | ||
42 | fs.writeFileSync("./packages/js/src/configs/eslint-all.js", code, "utf8"); |