|
| 1 | +import js from "@eslint/js"; |
| 2 | +import tseslint from "typescript-eslint"; |
| 3 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 4 | + |
| 5 | +export default [ |
| 6 | + // Ignore generated parser / grammar artifacts |
| 7 | + { ignores: ["src/grammar/**/*"] }, |
| 8 | + // Base JS recommended |
| 9 | + js.configs.recommended, |
| 10 | + // TypeScript support (parser + recommended rules) |
| 11 | + ...tseslint.configs.recommended, |
| 12 | + // React hooks (only hooks; project uses React 17 APIs) |
| 13 | + { |
| 14 | + plugins: { "react-hooks": reactHooks }, |
| 15 | + rules: { |
| 16 | + ...reactHooks.configs.recommended.rules |
| 17 | + } |
| 18 | + }, |
| 19 | + // Project specific overrides |
| 20 | + { |
| 21 | + files: ["src/**/*.{ts,tsx}"], |
| 22 | + languageOptions: { |
| 23 | + parser: tseslint.parser, |
| 24 | + parserOptions: { |
| 25 | + ecmaVersion: "latest", |
| 26 | + sourceType: "module" |
| 27 | + }, |
| 28 | + globals: { |
| 29 | + dojo: "readonly", |
| 30 | + dijit: "readonly", |
| 31 | + dojoConfig: "readonly", |
| 32 | + debugConfig: "readonly", |
| 33 | + Promise: "readonly" |
| 34 | + } |
| 35 | + }, |
| 36 | + // per-file overrides (no additional ignores here) |
| 37 | + rules: { |
| 38 | + // Disabled legacy rules carried over from .eslintrc.js |
| 39 | + "no-redeclare": "off", |
| 40 | + "no-empty": "off", |
| 41 | + "no-empty-pattern": "off", |
| 42 | + "no-constant-condition": "off", |
| 43 | + "no-case-declarations": "off", |
| 44 | + "no-prototype-builtins": "off", |
| 45 | + "no-unused-vars": "off", |
| 46 | + "no-useless-escape": "off", |
| 47 | + "no-unexpected-multiline": "off", |
| 48 | + "no-extra-boolean-cast": "off", |
| 49 | + "no-self-assign": "off", |
| 50 | + "no-multiple-empty-lines": ["error", { max: 1 }], |
| 51 | + "func-call-spacing": ["error", "never"], |
| 52 | + "space-before-function-paren": ["error", { anonymous: "always", named: "never", asyncArrow: "always" }], |
| 53 | + "comma-spacing": ["error", { before: false, after: true }], |
| 54 | + "prefer-rest-params": "off", |
| 55 | + "prefer-spread": "off", |
| 56 | + "semi": ["error", "always"], |
| 57 | + "quotes": ["error", "double", { avoidEscape: true }], |
| 58 | + // TypeScript specific disables |
| 59 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 60 | + "@typescript-eslint/no-unused-vars": "off", |
| 61 | + "@typescript-eslint/ban-ts-comment": "off", |
| 62 | + "@typescript-eslint/no-inferrable-types": "off", |
| 63 | + "@typescript-eslint/no-empty-function": "off", |
| 64 | + "@typescript-eslint/no-explicit-any": "off", |
| 65 | + "@typescript-eslint/no-empty-interface": "off", |
| 66 | + "@typescript-eslint/no-this-alias": "off", |
| 67 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 68 | + "@typescript-eslint/no-namespace": "off", |
| 69 | + "@typescript-eslint/no-var-require": "off", |
| 70 | + "@typescript-eslint/no-unsafe-declaration-merging": "off" |
| 71 | + } |
| 72 | + } |
| 73 | +]; |
0 commit comments