|
| 1 | +/* eslint-env node */ |
| 2 | +/** @type { import("eslint").Linter.Config } */ |
1 | 3 | module.exports = { |
2 | | - "env": { |
3 | | - "browser": true, |
4 | | - "es6": true, |
5 | | - "webextensions": true |
6 | | - }, |
7 | | - "extends": "eslint:recommended", |
8 | | - "parserOptions": { |
9 | | - "ecmaVersion": 2018, |
10 | | - "sourceType": "module" |
11 | | - }, |
12 | | - "rules": { |
13 | | - "no-restricted-globals": [ |
14 | | - 2, |
15 | | - "event", "error" |
16 | | - ], |
17 | | - "indent": [ |
18 | | - "error", |
19 | | - 2 |
20 | | - ], |
21 | | - "linebreak-style": [ |
22 | | - "error", |
23 | | - "unix" |
24 | | - ], |
25 | | - "quotes": [ |
26 | | - "error", |
27 | | - "double" |
28 | | - ], |
29 | | - "semi": [ |
30 | | - "error", |
31 | | - "always" |
32 | | - ] |
33 | | - } |
| 4 | + env: { |
| 5 | + browser: true, |
| 6 | + es6: true, |
| 7 | + webextensions: true, |
| 8 | + }, |
| 9 | + extends: [ |
| 10 | + "eslint:recommended", |
| 11 | + "plugin:@typescript-eslint/eslint-recommended", |
| 12 | + "plugin:wc/recommended", |
| 13 | + "plugin:lit/recommended", |
| 14 | + "prettier", |
| 15 | + ], |
| 16 | + plugins: ["@typescript-eslint", "lit"], |
| 17 | + parser: "@typescript-eslint/parser", |
| 18 | + parserOptions: { |
| 19 | + project: ["./tsconfig.eslint.json"], |
| 20 | + tsconfigRootDir: __dirname, |
| 21 | + }, |
| 22 | + root: true, |
| 23 | + rules: { |
| 24 | + /* start stylistic rules */ |
| 25 | + "@typescript-eslint/adjacent-overload-signatures": "error", |
| 26 | + "@typescript-eslint/array-type": "error", |
| 27 | + "@typescript-eslint/consistent-type-imports": [ |
| 28 | + "error", |
| 29 | + { |
| 30 | + fixStyle: "inline-type-imports", |
| 31 | + }, |
| 32 | + ], |
| 33 | + "@typescript-eslint/prefer-readonly": "warn", |
| 34 | + "@typescript-eslint/class-literal-property-style": ["warn", "getters"], |
| 35 | + "@typescript-eslint/consistent-generic-constructors": "error", |
| 36 | + "@typescript-eslint/consistent-type-assertions": "error", |
| 37 | + "@typescript-eslint/no-confusing-non-null-assertion": "warn", |
| 38 | + "@typescript-eslint/no-inferrable-types": "warn", |
| 39 | + "@typescript-eslint/non-nullable-type-assertion-style": "warn", |
| 40 | + "@typescript-eslint/prefer-for-of": "warn", |
| 41 | + // "@typescript-eslint/prefer-nullish-coalescing": "warn", |
| 42 | + "@typescript-eslint/prefer-optional-chain": "warn", |
| 43 | + "@typescript-eslint/prefer-string-starts-ends-with": "warn", |
| 44 | + /* end stylistic rules */ |
| 45 | + |
| 46 | + /* start recommended rules */ |
| 47 | + "no-restricted-globals": [2, "event", "error"], |
| 48 | + "@typescript-eslint/no-base-to-string": "warn", |
| 49 | + "@typescript-eslint/no-duplicate-enum-values": "error", |
| 50 | + "@typescript-eslint/no-duplicate-type-constituents": "warn", |
| 51 | + "@typescript-eslint/no-explicit-any": "warn", |
| 52 | + "@typescript-eslint/no-extra-non-null-assertion": "error", |
| 53 | + // "@typescript-eslint/no-floating-promises": "warn", |
| 54 | + "@typescript-eslint/no-for-in-array": "warn", |
| 55 | + "no-unused-vars": "off", |
| 56 | + "@typescript-eslint/no-unused-vars": [ |
| 57 | + "warn", |
| 58 | + { |
| 59 | + argsIgnorePattern: "^_", |
| 60 | + varsIgnorePattern: "^_", |
| 61 | + destructuredArrayIgnorePattern: "^_", |
| 62 | + }, |
| 63 | + ], |
| 64 | + "no-implied-eval": "off", |
| 65 | + "@typescript-eslint/no-implied-eval": "error", |
| 66 | + "no-loss-of-precision": "off", |
| 67 | + "@typescript-eslint/no-loss-of-precision": "warn", |
| 68 | + "@typescript-eslint/no-misused-new": "error", |
| 69 | + "@typescript-eslint/no-misused-promises": [ |
| 70 | + "error", |
| 71 | + { checksVoidReturn: { arguments: false } }, |
| 72 | + ], |
| 73 | + "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error", |
| 74 | + "@typescript-eslint/no-non-null-asserted-optional-chain": "warn", |
| 75 | + "@typescript-eslint/no-redundant-type-constituents": "warn", |
| 76 | + "@typescript-eslint/no-this-alias": "warn", |
| 77 | + "@typescript-eslint/no-unnecessary-type-assertion": "warn", |
| 78 | + "@typescript-eslint/no-unnecessary-type-constraint": "warn", |
| 79 | + // "@typescript-eslint/no-unsafe-argument": "warn", |
| 80 | + // "@typescript-eslint/no-unsafe-assignment": "warn", |
| 81 | + // "@typescript-eslint/no-unsafe-call": "warn", |
| 82 | + "@typescript-eslint/no-unsafe-declaration-merging": "warn", |
| 83 | + "@typescript-eslint/no-unsafe-enum-comparison": "warn", |
| 84 | + // "@typescript-eslint/no-unsafe-member-access": "warn", |
| 85 | + // "@typescript-eslint/no-unsafe-return": "warn", |
| 86 | + "@typescript-eslint/prefer-as-const": "warn", |
| 87 | + "require-await": "off", |
| 88 | + "@typescript-eslint/require-await": "warn", |
| 89 | + "@typescript-eslint/restrict-template-expressions": "warn", |
| 90 | + "@typescript-eslint/unbound-method": "off", |
| 91 | + }, |
| 92 | + ignorePatterns: [ |
| 93 | + "ruffle/**/*", |
| 94 | + "build/**/*", |
| 95 | + "/sw.js", |
| 96 | + "/ui.js", |
| 97 | + "dist/**/*", |
| 98 | + ], |
| 99 | + reportUnusedDisableDirectives: true, |
34 | 100 | }; |
0 commit comments