Cameron Martin | caef0ed | 2025-01-15 11:58:39 +0100 | [diff] [blame] | 1 | import globals from "globals"; |
| 2 | import js from "@eslint/js"; |
| 3 | import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; |
| 4 | |
| 5 | export default [ |
| 6 | { |
| 7 | ignores: [ |
| 8 | // TODO: Use eslint on js lib and generated code |
| 9 | |
| 10 | // Ignore lib/js for now, which uses jshint currently |
| 11 | "lib/js/*", |
| 12 | // Ignore all generated code for now |
| 13 | "**/gen-*/", |
| 14 | |
| 15 | // Don't lint nested node_modules |
| 16 | "**/node_modules/", |
| 17 | ], |
| 18 | }, |
| 19 | js.configs.recommended, |
| 20 | eslintPluginPrettierRecommended, |
| 21 | { |
| 22 | languageOptions: { |
| 23 | globals: { |
| 24 | ...globals.node, |
| 25 | }, |
| 26 | |
| 27 | ecmaVersion: 2017, |
| 28 | sourceType: "commonjs", |
| 29 | }, |
| 30 | |
| 31 | rules: { |
| 32 | "no-console": "off", |
| 33 | "no-var": "error", |
| 34 | "prefer-const": "error", |
| 35 | |
| 36 | "no-constant-condition": [ |
| 37 | "error", |
| 38 | { |
| 39 | checkLoops: false, |
| 40 | }, |
| 41 | ], |
| 42 | }, |
| 43 | }, |
| 44 | ]; |