|
| 1 | +// @ts-check |
| 2 | +const eslint = require("@eslint/js"); |
| 3 | +const { defineConfig } = require("eslint/config"); |
| 4 | +const tseslint = require("typescript-eslint"); |
| 5 | +const angular = require("angular-eslint"); |
| 6 | + |
| 7 | +module.exports = defineConfig([ |
| 8 | + { |
| 9 | + files: ["**/*.ts"], |
| 10 | + extends: [ |
| 11 | + eslint.configs.recommended, |
| 12 | + tseslint.configs.recommended, |
| 13 | + tseslint.configs.stylistic, |
| 14 | + angular.configs.tsRecommended, |
| 15 | + ], |
| 16 | + processor: angular.processInlineTemplates, |
| 17 | + rules: { |
| 18 | + "@angular-eslint/directive-selector": [ |
| 19 | + "error", |
| 20 | + { |
| 21 | + type: "attribute", |
| 22 | + prefix: ["app", "ui"], |
| 23 | + style: "camelCase", |
| 24 | + }, |
| 25 | + ], |
| 26 | + "@angular-eslint/component-selector": [ |
| 27 | + "error", |
| 28 | + { |
| 29 | + type: "element", |
| 30 | + prefix: ["app", "ui"], |
| 31 | + style: "kebab-case", |
| 32 | + }, |
| 33 | + ], |
| 34 | + "@angular-eslint/no-output-on-prefix": "warn", |
| 35 | + "@typescript-eslint/no-unused-vars": ["error", { |
| 36 | + "argsIgnorePattern": "^_", |
| 37 | + "varsIgnorePattern": "^_" |
| 38 | + }], |
| 39 | + "@typescript-eslint/no-empty-function": "off", |
| 40 | + "@typescript-eslint/no-explicit-any": "warn", |
| 41 | + }, |
| 42 | + }, |
| 43 | + { |
| 44 | + files: ["**/*.html"], |
| 45 | + extends: [ |
| 46 | + angular.configs.templateRecommended, |
| 47 | + angular.configs.templateAccessibility, |
| 48 | + ], |
| 49 | + rules: { |
| 50 | + "@angular-eslint/template/label-has-associated-control": "off", |
| 51 | + "@angular-eslint/template/click-events-have-key-events": "warn", |
| 52 | + "@angular-eslint/template/interactive-supports-focus": "warn", |
| 53 | + "@angular-eslint/template/role-has-required-aria": "warn", |
| 54 | + }, |
| 55 | + }, |
| 56 | + { |
| 57 | + files: ["**/*.spec.ts", "**/test-setup.ts"], |
| 58 | + rules: { |
| 59 | + "@typescript-eslint/no-unused-vars": "off", |
| 60 | + "@typescript-eslint/no-empty-function": "off", |
| 61 | + }, |
| 62 | + } |
| 63 | +]); |
0 commit comments