|
| 1 | +import typescriptEslint from "@typescript-eslint/eslint-plugin"; |
| 2 | +import path from "node:path"; |
| 3 | +import { fileURLToPath } from "node:url"; |
| 4 | +import js from "@eslint/js"; |
| 5 | +import { FlatCompat } from "@eslint/eslintrc"; |
| 6 | + |
| 7 | +const __filename = fileURLToPath(import.meta.url); |
| 8 | +const __dirname = path.dirname(__filename); |
| 9 | +const compat = new FlatCompat({ |
| 10 | + baseDirectory: __dirname, |
| 11 | + recommendedConfig: js.configs.recommended, |
| 12 | + allConfig: js.configs.all |
| 13 | +}); |
| 14 | + |
| 15 | +export default [{ |
| 16 | + ignores: [ |
| 17 | + "**/dist/", |
| 18 | + "projects/igniteui-angular/migrations/", |
| 19 | + "projects/igniteui-angular/schematics/", |
| 20 | + "projects/igniteui-angular/cypress/", |
| 21 | + "**/cypress/", |
| 22 | + "**/cypress.config.ts", |
| 23 | + ], |
| 24 | +}, ...compat.extends( |
| 25 | + "plugin:@angular-eslint/recommended", |
| 26 | + "plugin:@angular-eslint/template/process-inline-templates", |
| 27 | +).map(config => ({ |
| 28 | + ...config, |
| 29 | + files: ["**/*.ts"], |
| 30 | +})), { |
| 31 | + files: ["**/*.ts"], |
| 32 | + |
| 33 | + plugins: { |
| 34 | + "@typescript-eslint": typescriptEslint, |
| 35 | + }, |
| 36 | + |
| 37 | + languageOptions: { |
| 38 | + ecmaVersion: 5, |
| 39 | + sourceType: "script", |
| 40 | + |
| 41 | + parserOptions: { |
| 42 | + project: ["tsconfig.json"], |
| 43 | + createDefaultProgram: true, |
| 44 | + }, |
| 45 | + }, |
| 46 | + |
| 47 | + rules: { |
| 48 | + "no-shadow": "off", |
| 49 | + "no-prototype-builtins": "off", |
| 50 | + "no-case-declarations": "warn", |
| 51 | + "prefer-spread": "warn", |
| 52 | + "no-async-promise-executor": "warn", |
| 53 | + "prefer-const": "warn", |
| 54 | + "no-useless-escape": "warn", |
| 55 | + "@typescript-eslint/no-var-requires": "off", |
| 56 | + "@typescript-eslint/no-shadow": "error", |
| 57 | + "no-unused-vars": "off", |
| 58 | + |
| 59 | + "@typescript-eslint/no-unused-vars": ["warn", { |
| 60 | + args: "all", |
| 61 | + argsIgnorePattern: "^_", |
| 62 | + caughtErrors: "all", |
| 63 | + caughtErrorsIgnorePattern: "^_", |
| 64 | + destructuredArrayIgnorePattern: "^_", |
| 65 | + varsIgnorePattern: "^_", |
| 66 | + ignoreRestSiblings: true, |
| 67 | + }], |
| 68 | + |
| 69 | + "@typescript-eslint/consistent-type-definitions": "error", |
| 70 | + "@typescript-eslint/dot-notation": "off", |
| 71 | + |
| 72 | + "@typescript-eslint/explicit-member-accessibility": ["error", { |
| 73 | + accessibility: "explicit", |
| 74 | + |
| 75 | + overrides: { |
| 76 | + constructors: "no-public", |
| 77 | + }, |
| 78 | + }], |
| 79 | + |
| 80 | + "@typescript-eslint/naming-convention": ["error", { |
| 81 | + selector: "enumMember", |
| 82 | + format: ["PascalCase"], |
| 83 | + }], |
| 84 | + |
| 85 | + "@angular-eslint/no-input-rename": "off", |
| 86 | + |
| 87 | + "brace-style": ["error", "1tbs"], |
| 88 | + "id-blacklist": "off", |
| 89 | + "id-match": "off", |
| 90 | + "no-underscore-dangle": "off", |
| 91 | + "@typescript-eslint/no-explicit-any": "off", |
| 92 | + "@typescript-eslint/no-empty-function": "off", |
| 93 | + "@typescript-eslint/no-restricted-types": "warn", |
| 94 | + }, |
| 95 | +}, ...compat.extends("plugin:@angular-eslint/template/recommended").map(config => ({ |
| 96 | + ...config, |
| 97 | + files: ["**/*.html"], |
| 98 | +})), { |
| 99 | + files: ["**/*.html"], |
| 100 | + rules: {}, |
| 101 | +}]; |
0 commit comments