-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.js
100 lines (97 loc) · 2.84 KB
/
eslint.config.js
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { commentDirectiveRules } from "./eslint/comment-directives/comment-directives.js";
import { problemRules } from "./eslint/core/problems.js";
import { suggestionRules } from "./eslint/core/suggestions.js";
import { extensionRulesForTypescript } from "./eslint/typescript/extension-rules.js";
import { typescriptRules } from "./eslint/typescript/typescript-rules.js";
import tsEslint from "typescript-eslint";
import commentDirectivesPlugin from "eslint-plugin-eslint-comments";
import { angularTemplateRules } from "./eslint/angular/angular-eslint_template.js";
import * as templateParser from "@angular-eslint/template-parser";
import templatePlugin from "@angular-eslint/eslint-plugin-template";
import angularPlugin from "@angular-eslint/eslint-plugin";
import { angularRules as ngRules } from "./eslint/angular/angular-eslint.js";
import importPlugin from "eslint-plugin-import";
import { importRules } from "./eslint/imports/imports.js";
const jsRules = {
...problemRules,
...suggestionRules
};
const tsRules = {
...typescriptRules,
...extensionRulesForTypescript
};
export default [
{
ignores: [
"node_modules/**/*",
"dist/**/*",
"coverage/**/*",
"out-tsc/**/*",
".angular/**/*"
]
},
{
plugins: {
directives: commentDirectivesPlugin
},
rules: commentDirectiveRules
},
{
files: ["**/*.ts"],
languageOptions: {
parser: tsEslint.parser,
parserOptions: {
ecmaVersion: "latest",
project: ["tsconfig.eslint.json"]
}
},
plugins: {
typescript: tsEslint.plugin,
directives: commentDirectivesPlugin,
angular: angularPlugin,
import: importPlugin
},
settings: {
"import/parser": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
typescript: true
}
},
rules: {
...jsRules,
...tsRules,
...ngRules,
...importRules
}
},
{
files: ["**/*.js"],
plugins: {
directives: commentDirectivesPlugin,
import: importPlugin
},
rules: {
...jsRules,
...importRules
}
},
{
files: ["**/*.html"],
languageOptions: {
parser: {
...templateParser,
/* This added property is a hack in order to make the parser serializable.
* See https://github.com/eslint/eslint/pull/16944.
* Presumably, an upcoming version of the parser will include this
* property and we will be able to delete this line. */
meta: { name: "angular-eslint/template-parser", version: "17.3.0" }
}
},
plugins: {
template: templatePlugin
},
rules: angularTemplateRules
}
];