-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheslint.config.js
69 lines (67 loc) · 2.44 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
const eslint = require("@eslint/js");
const tseslint = require("typescript-eslint");
const angular = require("angular-eslint");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");
// Export our config array, which is composed together thanks to the typed utility function from typescript-eslint
module.exports = tseslint.config(
{
//This ignore is redudant when using npm run lint, but is necessary when running npx eslint --fix and other eslint direct commands
ignores: ["dist/app/"]
},
{
files: ["**/*.ts"],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
eslintPluginPrettierRecommended
],
// 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,
// Override specific rules for TypeScript files (these will take priority over the extended configs above)
rules: {
"@angular-eslint/directive-selector": [
"error",
{
type: "attribute",
prefix: "app",
style: "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
type: "element",
prefix: "app",
style: "kebab-case"
}
],
//We need the following rule to be set to "type" to avoid conflicts with the Typescript recommended
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
//The codebase is not ready for this rules yet:
"@typescript-eslint/no-explicit-any": "warn",
"@angular-eslint/component-selector": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
vars: "all",
ignoreRestSiblings: false,
argsIgnorePattern: "^_",
varsIgnorePattern: "^_"
}
],
"no-case-declarations": "warn",
"@typescript-eslint/no-unused-expressions": "warn",
"@typescript-eslint/no-empty-object-type": "warn",
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn"
}
},
{
files: ["**/*.html"],
extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
rules: {}
}
);