eslint-config-angular-strict 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +20 -30
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
// ESLint 9 flat configuration export
|
|
2
1
|
import angular from '@angular-eslint/eslint-plugin';
|
|
3
2
|
import angularTemplate from '@angular-eslint/eslint-plugin-template';
|
|
4
3
|
import angularTemplateParser from '@angular-eslint/template-parser';
|
|
5
|
-
import importPlugin from 'eslint-plugin-import-x';
|
|
6
4
|
import stylistic from '@stylistic/eslint-plugin';
|
|
5
|
+
import tsParser from '@typescript-eslint/parser';
|
|
7
6
|
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
8
|
-
import
|
|
7
|
+
import { importX } from 'eslint-plugin-import-x';
|
|
9
8
|
|
|
10
9
|
export default [
|
|
11
|
-
|
|
10
|
+
importX.flatConfigs.recommended,
|
|
11
|
+
importX.flatConfigs.typescript,
|
|
12
12
|
{
|
|
13
|
+
// TypeScript files configuration
|
|
13
14
|
files: ['**/*.ts'],
|
|
14
|
-
languageOptions: {
|
|
15
|
-
parser: typescriptParser,
|
|
16
|
-
parserOptions: {
|
|
17
|
-
ecmaVersion: 2022,
|
|
18
|
-
project: './tsconfig.json',
|
|
19
|
-
sourceType: 'module',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
15
|
+
languageOptions: { ecmaVersion: 'latest', parser: tsParser, sourceType: 'module' },
|
|
22
16
|
plugins: {
|
|
23
17
|
'@angular-eslint': angular,
|
|
24
18
|
'@stylistic': stylistic,
|
|
25
19
|
'@typescript-eslint': typescriptEslint,
|
|
26
|
-
import:
|
|
20
|
+
import: importX,
|
|
27
21
|
},
|
|
28
22
|
rules: {
|
|
29
23
|
// Angular ESLint rules
|
|
@@ -89,15 +83,15 @@ export default [
|
|
|
89
83
|
'@stylistic/space-infix-ops': 'error',
|
|
90
84
|
|
|
91
85
|
// Import rules
|
|
92
|
-
'import/extensions': ['error', 'ignorePackages', { ts: 'never' }],
|
|
93
|
-
'import/no-anonymous-default-export': 'error',
|
|
94
|
-
'import/no-commonjs': 'error',
|
|
95
|
-
'import/no-cycle': ['error', { maxDepth: 2 }],
|
|
96
|
-
'import/no-deprecated': 'error',
|
|
97
|
-
'import/no-empty-named-blocks': 'error',
|
|
98
|
-
'import/no-import-module-exports': 'off',
|
|
99
|
-
'import/no-named-as-default-member': 'error',
|
|
100
|
-
'import/order': [
|
|
86
|
+
'import-x/extensions': ['error', 'ignorePackages', { ts: 'never' }],
|
|
87
|
+
'import-x/no-anonymous-default-export': 'error',
|
|
88
|
+
'import-x/no-commonjs': 'error',
|
|
89
|
+
'import-x/no-cycle': ['error', { maxDepth: 2 }],
|
|
90
|
+
'import-x/no-deprecated': 'error',
|
|
91
|
+
'import-x/no-empty-named-blocks': 'error',
|
|
92
|
+
'import-x/no-import-module-exports': 'off',
|
|
93
|
+
'import-x/no-named-as-default-member': 'error',
|
|
94
|
+
'import-x/order': [
|
|
101
95
|
'error',
|
|
102
96
|
{
|
|
103
97
|
alphabetize: { order: 'asc', caseInsensitive: true },
|
|
@@ -113,7 +107,7 @@ export default [
|
|
|
113
107
|
warnOnUnassignedImports: true,
|
|
114
108
|
},
|
|
115
109
|
],
|
|
116
|
-
'import/prefer-default-export': 'off',
|
|
110
|
+
'import-x/prefer-default-export': 'off',
|
|
117
111
|
|
|
118
112
|
// General rules
|
|
119
113
|
'arrow-parens': ['error', 'as-needed', { requireForBlockBody: true }],
|
|
@@ -145,15 +139,11 @@ export default [
|
|
|
145
139
|
},
|
|
146
140
|
},
|
|
147
141
|
|
|
148
|
-
// HTML Template files configuration
|
|
149
142
|
{
|
|
143
|
+
// HTML Template files configuration
|
|
150
144
|
files: ['**/*.html'],
|
|
151
|
-
languageOptions: {
|
|
152
|
-
|
|
153
|
-
},
|
|
154
|
-
plugins: {
|
|
155
|
-
'@angular-eslint/template': angularTemplate,
|
|
156
|
-
},
|
|
145
|
+
languageOptions: { parser: angularTemplateParser },
|
|
146
|
+
plugins: { '@angular-eslint/template': angularTemplate },
|
|
157
147
|
rules: {
|
|
158
148
|
'@angular-eslint/template/attributes-order': ['error', { alphabetical: true }],
|
|
159
149
|
'@angular-eslint/template/banana-in-box': 'error',
|