-
-
Notifications
You must be signed in to change notification settings - Fork 120
/
eslint.config.mjs
58 lines (57 loc) · 2.23 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import angular from 'angular-eslint';
import eslint from '@eslint/js';
import cypress from 'eslint-plugin-cypress/flat';
import n from 'eslint-plugin-n';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: [
'.angular/*',
'test/jest-coverage/',
],
},
{
extends: [
// Apply the recommended rules
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
],
plugins: {
cypress,
n
},
// Everything in this config object targets our TypeScript files (Components, Directives, Pipes etc)
files: ['**/*.ts'],
// Set the custom processor which will allow us to have our inline Component templates extracted
// and treated as if they are HTML files (and therefore have the .html config below applied to them)
processor: angular.processInlineTemplates,
rules: {
'@angular-eslint/directive-selector': ['error', { type: 'attribute', prefix: 'app', style: 'camelCase' }],
'@angular-eslint/component-selector': ['error', { type: 'element', style: 'kebab-case' }],
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_', 'destructuredArrayIgnorePattern': '^_', caughtErrors: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
'no-case-declarations': 'off',
},
},
{
// Everything in this config object targets our HTML files (external templates,
// and inline templates as long as we have the `processor` set on our TypeScript config above)
files: ['**/*.html'],
extends: [
// Apply the recommended Angular template rules and focus on accessibility of our apps
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {
'@angular-eslint/template/label-has-associated-control': 'off',
'@angular-eslint/template/click-events-have-key-events': 'off',
'@angular-eslint/template/interactive-supports-focus': 'off',
},
},
);