|
| 1 | +import tseslint from "typescript-eslint"; |
| 2 | + |
| 3 | +export default tseslint.config( |
| 4 | + { |
| 5 | + ignores: [ |
| 6 | + "build/**", |
| 7 | + "target/**", |
| 8 | + "node_modules/**", |
| 9 | + "src/**/*.d.ts", |
| 10 | + // Copies sourced from WebClipper_Internal via the copyInternal gulp |
| 11 | + // task (basename + "_internal"). Lint those in their own repo. |
| 12 | + "src/scripts/**/*_internal.ts", |
| 13 | + "src/scripts/**/*_internal.tsx", |
| 14 | + "src/scripts/definitions/custom/aria-web-telemetry-*.d_internal.ts" |
| 15 | + ] |
| 16 | + }, |
| 17 | + { |
| 18 | + files: ["src/**/*.ts", "src/**/*.tsx"], |
| 19 | + languageOptions: { |
| 20 | + parser: tseslint.parser, |
| 21 | + ecmaVersion: 2022, |
| 22 | + sourceType: "module", |
| 23 | + parserOptions: { |
| 24 | + project: "./tsconfig.json", |
| 25 | + tsconfigRootDir: import.meta.dirname |
| 26 | + } |
| 27 | + }, |
| 28 | + plugins: { |
| 29 | + "@typescript-eslint": tseslint.plugin |
| 30 | + }, |
| 31 | + rules: { |
| 32 | + "spaced-comment": ["error", "always"], |
| 33 | + "curly": "error", |
| 34 | + "eol-last": "error", |
| 35 | + "indent": ["error", "tab", { "SwitchCase": 1 }], |
| 36 | + "no-multiple-empty-lines": ["error", { "max": 1 }], |
| 37 | + "no-console": "error", |
| 38 | + "@typescript-eslint/no-inferrable-types": "error", |
| 39 | + "@typescript-eslint/no-shadow": "error", |
| 40 | + "dot-notation": "error", |
| 41 | + "no-fallthrough": "error", |
| 42 | + "no-trailing-spaces": "error", |
| 43 | + "no-unreachable": "error", |
| 44 | + "@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true, "allowShortCircuit": true }], |
| 45 | + "no-var": "error", |
| 46 | + "brace-style": ["error", "1tbs", { "allowSingleLine": true }], |
| 47 | + "quotes": ["error", "double", { "avoidEscape": true }], |
| 48 | + "radix": "error", |
| 49 | + "semi": ["error", "always"], |
| 50 | + "default-case": "error", |
| 51 | + "eqeqeq": "error", |
| 52 | + "@typescript-eslint/prefer-optional-chain": "error" |
| 53 | + } |
| 54 | + } |
| 55 | +); |
0 commit comments