eslint.config.mjs (2574B)
1 import js from "@eslint/js"; 2 import tseslint from "@typescript-eslint/eslint-plugin"; 3 import tsparser from "@typescript-eslint/parser"; 4 import globals from "globals"; 5 6 export default [ 7 { 8 ignores: ["website/**/*", "**/*.js", "build/**/*.ts"] 9 }, 10 { 11 plugins: { 12 "@typescript-eslint": tseslint 13 } 14 }, 15 js.configs.recommended, 16 { 17 files: ["**/*.ts"], 18 languageOptions: { 19 parser: tsparser, 20 parserOptions: { 21 ecmaVersion: 2020, 22 sourceType: "module", 23 project: "./tsconfig.json" 24 }, 25 globals: { 26 ...globals.browser, 27 ...globals.node 28 } 29 }, 30 rules: { 31 ...tseslint.configs.recommended.rules, 32 "@typescript-eslint/ban-ts-ignore": "off", 33 "@typescript-eslint/camelcase": "off", 34 "@typescript-eslint/explicit-function-return-type": "off", 35 "@typescript-eslint/interface-name-prefix": "off", 36 "@typescript-eslint/no-explicit-any": "off", 37 "no-duplicate-imports": "warn", 38 "@typescript-eslint/explicit-module-boundary-types": "off", 39 "@typescript-eslint/triple-slash-reference": "off", 40 "no-trailing-spaces": "warn", 41 "no-redeclare": "off", 42 "no-dupe-class-members": "off", 43 "@typescript-eslint/no-unused-vars": [ 44 "error", 45 { 46 argsIgnorePattern: "^_", 47 varsIgnorePattern: "^_", 48 caughtErrorsIgnorePattern: "^_", 49 }, 50 ], 51 }, 52 ignores: [ 53 "build/**/*.ts", 54 "**/*.js", 55 "website" 56 ] 57 }, 58 { 59 files: ["test/**/*.ts"], 60 languageOptions: { 61 parser: tsparser, 62 parserOptions: { 63 ecmaVersion: 2020, 64 sourceType: "module", 65 project: "./tsconfig.json" 66 }, 67 globals: { 68 ...globals.browser, 69 ...globals.node, 70 ...globals.mocha 71 } 72 }, 73 rules: { 74 ...tseslint.configs.recommended.rules, 75 "@typescript-eslint/ban-ts-ignore": "off", 76 "@typescript-eslint/camelcase": "off", 77 "@typescript-eslint/explicit-function-return-type": "off", 78 "@typescript-eslint/interface-name-prefix": "off", 79 "@typescript-eslint/no-explicit-any": "off", 80 "no-duplicate-imports": "warn", 81 "@typescript-eslint/explicit-module-boundary-types": "off", 82 "@typescript-eslint/triple-slash-reference": "off", 83 "no-trailing-spaces": "warn", 84 "no-redeclare": "off", 85 "no-dupe-class-members": "off", 86 "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_", "caughtErrorsIgnorePattern": "^_" }] 87 } 88 } 89 ];