blob: 2f70a8824f0471895b951937ab72d762afc90f60 [file] [log] [blame]
Cameron Martincaef0ed2025-01-15 11:58:39 +01001import globals from "globals";
2import js from "@eslint/js";
3import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
4
5export 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
Cameron Martin21ed4a22024-04-22 11:08:19 +010027 ecmaVersion: 2022,
Cameron Martincaef0ed2025-01-15 11:58:39 +010028 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 },
Cameron Martin21ed4a22024-04-22 11:08:19 +010044 {
45 files: ["**/*.mjs"],
46 languageOptions: {
47 sourceType: "module",
48 },
49 },
Cameron Martincaef0ed2025-01-15 11:58:39 +010050];