|
| 1 | +// @ts-check |
| 2 | +const eslint = require('@eslint/js'); |
| 3 | +const tseslint = require('typescript-eslint'); |
| 4 | +const angular = require('angular-eslint'); |
| 5 | +const rxjs = require('@smarttools/eslint-plugin-rxjs'); |
| 6 | + |
| 7 | +module.exports = tseslint.config( |
| 8 | + { |
| 9 | + files: ['**/*.ts'], |
| 10 | + extends: [ |
| 11 | + eslint.configs.recommended, |
| 12 | + ...tseslint.configs.recommended, |
| 13 | + ...tseslint.configs.stylistic, |
| 14 | + ...angular.configs.tsRecommended, |
| 15 | + { |
| 16 | + languageOptions: { |
| 17 | + parserOptions: { |
| 18 | + projectService: true, |
| 19 | + tsconfigRootDir: __dirname, |
| 20 | + }, |
| 21 | + }, |
| 22 | + }, |
| 23 | + ], |
| 24 | + plugins: { |
| 25 | + rxjs, |
| 26 | + }, |
| 27 | + processor: angular.processInlineTemplates, |
| 28 | + 'rules': { |
| 29 | + '@typescript-eslint/explicit-function-return-type': [ |
| 30 | + 'error' |
| 31 | + ], |
| 32 | + 'no-extra-boolean-cast': [ |
| 33 | + 'off' |
| 34 | + ], |
| 35 | + '@angular-eslint/component-selector': [ |
| 36 | + 'error', |
| 37 | + { |
| 38 | + 'type': 'element', |
| 39 | + 'prefix': '', |
| 40 | + 'style': 'kebab-case' |
| 41 | + } |
| 42 | + ], |
| 43 | + '@angular-eslint/directive-selector': [ |
| 44 | + 'error', |
| 45 | + { |
| 46 | + 'type': 'attribute', |
| 47 | + 'prefix': '', |
| 48 | + 'style': 'camelCase' |
| 49 | + } |
| 50 | + ], |
| 51 | + 'comma-dangle': [ |
| 52 | + 'error', |
| 53 | + { |
| 54 | + 'objects': 'never', |
| 55 | + 'arrays': 'always-multiline', |
| 56 | + 'functions': 'never' |
| 57 | + } |
| 58 | + ], |
| 59 | + 'rxjs/finnish': [ |
| 60 | + 'error', |
| 61 | + { |
| 62 | + 'functions': true, |
| 63 | + 'methods': true, |
| 64 | + 'names': { |
| 65 | + '^(canActivate|canActivateChild|canDeactivate|canLoad|intercept|resolve|validate)$': false |
| 66 | + }, |
| 67 | + 'parameters': true, |
| 68 | + 'properties': true, |
| 69 | + 'strict': false, |
| 70 | + 'types': { |
| 71 | + '^EventEmitter$': false |
| 72 | + }, |
| 73 | + 'variables': true |
| 74 | + } |
| 75 | + ], |
| 76 | + 'rxjs/no-implicit-any-catch': [ |
| 77 | + 'error', |
| 78 | + { |
| 79 | + 'allowExplicitAny': true |
| 80 | + } |
| 81 | + ] |
| 82 | + }, |
| 83 | + }, |
| 84 | + { |
| 85 | + files: ['**/*.html'], |
| 86 | + extends: [ |
| 87 | + ...angular.configs.templateRecommended, |
| 88 | + ...angular.configs.templateAccessibility, |
| 89 | + ], |
| 90 | + rules: {}, |
| 91 | + } |
| 92 | +); |
0 commit comments