|
| 1 | +import globals from "globals"; |
| 2 | +import pluginJs from "@eslint/js"; |
| 3 | +import tseslint from "typescript-eslint"; |
| 4 | +import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; |
| 5 | + |
| 6 | +export default [ |
| 7 | + { |
| 8 | + ignores: [ |
| 9 | + "**/node_modules/", |
| 10 | + "**/dist/", |
| 11 | + "**/out/", |
| 12 | + "**/coverage/", |
| 13 | + "**/vscode.d.ts", |
| 14 | + "**/vscode.proposed.d.ts", |
| 15 | + "**/.mypy_cache/", |
| 16 | + "**/.pytest_cache/", |
| 17 | + "**/site/", |
| 18 | + "**/docs/", |
| 19 | + ], |
| 20 | + }, |
| 21 | + { files: ["**/*.{js,mjs,cjs,ts}"] }, |
| 22 | + { languageOptions: { globals: globals.browser } }, |
| 23 | + pluginJs.configs.recommended, |
| 24 | + ...tseslint.configs.recommended, |
| 25 | + eslintPluginPrettierRecommended, |
| 26 | + { |
| 27 | + rules: { |
| 28 | + "@typescript-eslint/ban-ts-comment": [ |
| 29 | + "error", |
| 30 | + { |
| 31 | + "ts-ignore": "allow-with-description", |
| 32 | + }, |
| 33 | + ], |
| 34 | + strict: "off", |
| 35 | + "@typescript-eslint/explicit-module-boundary-types": "error", |
| 36 | + "no-bitwise": "off", |
| 37 | + "no-dupe-class-members": "off", |
| 38 | + "@typescript-eslint/no-dupe-class-members": "error", |
| 39 | + "no-empty-function": "off", |
| 40 | + "@typescript-eslint/no-empty-interface": "off", |
| 41 | + "@typescript-eslint/no-explicit-any": "error", |
| 42 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 43 | + "no-unused-vars": "off", |
| 44 | + |
| 45 | + "@typescript-eslint/no-unused-vars": [ |
| 46 | + "error", |
| 47 | + { |
| 48 | + args: "after-used", |
| 49 | + argsIgnorePattern: "^_", |
| 50 | + }, |
| 51 | + ], |
| 52 | + |
| 53 | + "no-use-before-define": "off", |
| 54 | + "no-useless-constructor": "off", |
| 55 | + "@typescript-eslint/no-useless-constructor": "error", |
| 56 | + "@typescript-eslint/no-var-requires": "off", |
| 57 | + |
| 58 | + "class-methods-use-this": [ |
| 59 | + "error", |
| 60 | + { |
| 61 | + exceptMethods: ["dispose"], |
| 62 | + }, |
| 63 | + ], |
| 64 | + |
| 65 | + "func-names": "off", |
| 66 | + "import/extensions": "off", |
| 67 | + "import/namespace": "off", |
| 68 | + "import/no-extraneous-dependencies": "off", |
| 69 | + |
| 70 | + "import/prefer-default-export": "off", |
| 71 | + "linebreak-style": "off", |
| 72 | + "no-await-in-loop": "off", |
| 73 | + "no-console": "off", |
| 74 | + "no-control-regex": "off", |
| 75 | + "no-extend-native": "off", |
| 76 | + "no-multi-str": "off", |
| 77 | + "no-param-reassign": "off", |
| 78 | + "no-prototype-builtins": "off", |
| 79 | + |
| 80 | + "no-restricted-syntax": [ |
| 81 | + "error", |
| 82 | + { |
| 83 | + selector: "ForInStatement", |
| 84 | + message: |
| 85 | + "for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.", |
| 86 | + }, |
| 87 | + { |
| 88 | + selector: "LabeledStatement", |
| 89 | + message: "Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.", |
| 90 | + }, |
| 91 | + { |
| 92 | + selector: "WithStatement", |
| 93 | + message: "`with` is disallowed in strict mode because it makes code impossible to predict and optimize.", |
| 94 | + }, |
| 95 | + ], |
| 96 | + |
| 97 | + "no-template-curly-in-string": "off", |
| 98 | + "no-underscore-dangle": "off", |
| 99 | + "no-useless-escape": "off", |
| 100 | + |
| 101 | + "no-void": [ |
| 102 | + "error", |
| 103 | + { |
| 104 | + allowAsStatement: true, |
| 105 | + }, |
| 106 | + ], |
| 107 | + |
| 108 | + "operator-assignment": "off", |
| 109 | + //"prettier/prettier": ["error"], |
| 110 | + }, |
| 111 | + }, |
| 112 | +]; |
0 commit comments