-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy patheslint.config.mjs
115 lines (113 loc) · 3.5 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
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// @ts-check
import globals from "globals";
import angularEslint from "angular-eslint";
import typescriptEslint from "typescript-eslint";
import tsdoc from "eslint-plugin-tsdoc";
import olEslint from "eslint-config-openlayers";
import { fixupPluginRules } from "@eslint/compat";
export default typescriptEslint.config({
languageOptions: {
globals: {
...globals.browser,
},
},
}, {
files: ["**/*.ts"],
extends: [
...olEslint,
typescriptEslint.configs.eslintRecommended,
typescriptEslint.configs.recommended,
angularEslint.configs.tsRecommended,
],
processor: angularEslint.processInlineTemplates,
plugins: {
"@typescript-eslint": typescriptEslint.plugin,
"@angular-eslint": angularEslint.tsPlugin,
"tsdoc": fixupPluginRules(tsdoc),
},
languageOptions: {
parser: typescriptEslint.parser,
ecmaVersion: 2018,
sourceType: "script",
},
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true,
},
node: {
extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
},
},
jsdoc: {
tagNamePreference: {
returns: "returns",
},
},
},
rules: {
"@angular-eslint/directive-selector": ["error", {
type: "attribute",
prefix: "hs",
style: "camelCase",
}],
"@angular-eslint/component-selector": ["error", {
type: "element",
prefix: ["hs", "hslayers"],
style: "kebab-case",
}],
"@angular-eslint/prefer-standalone": "off",
"brace-style": "warn",
"no-console": "warn",
"object-curly-spacing": "warn",
"prefer-arrow-callback": "warn",
"space-before-function-paren": "off",
"import/order": "off",
"import/no-duplicates": "warn",
"import/extensions": ["error", "ignorePackages", {
js: "never",
ts: "never",
}],
"@typescript-eslint/no-empty-function": ["error", {
allow: ["constructors"],
}],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"valid-jsdoc": "off",
"jsdoc/check-param-names": "off",
"jsdoc/require-returns-type": "off",
"jsdoc/require-hyphen-before-param-description": "off",
"jsdoc/require-param": "off",
"jsdoc/require-param-type": "off",
"jsdoc/require-returns": 'off',
"jsdoc/require-returns-check": "warn",
"tsdoc/syntax": "warn",
},
}, {
files: ["**/*.html"],
extends: [
...angularEslint.configs.templateRecommended,
...angularEslint.configs.templateAccessibility,
],
/*plugins: {
"@angular-eslint/template": angularEslintTemplate,
},
languageOptions: {
parser: angularEslintParser,
},*/
rules: {
"@angular-eslint/template/interactive-supports-focus": "off",
"@angular-eslint/template/click-events-have-key-events": "off",
"@angular-eslint/template/mouse-events-have-key-events": "off",
"@angular-eslint/template/elements-content": "warn",
"@angular-eslint/template/label-has-associated-control": "warn",
"@angular-eslint/template/alt-text": "warn",
},
}, {
files: ["**/*.spec.ts"],
languageOptions: {
globals: {
...globals.jasmine,
},
},
});