eslint-config-angular-strict 2.3.48 → 2.3.50

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.
Binary file
package/index.js CHANGED
@@ -1,13 +1,14 @@
1
+ import { configs, rules } from 'eslint-config-airbnb-extended';
1
2
  import angularEslintPlugin from '@angular-eslint/eslint-plugin';
2
3
  import angularTemplateParser from '@angular-eslint/template-parser';
3
4
  import angularTemplatePlugin from '@angular-eslint/eslint-plugin-template';
4
5
  import importXPlugin from 'eslint-plugin-import-x';
5
6
  import ngModuleSortPlugin from 'eslint-plugin-ng-module-sort';
7
+ import perfectionistPlugin from 'eslint-plugin-perfectionist';
6
8
  import stylistic from '@stylistic/eslint-plugin';
7
9
  import tsEslintParser from '@typescript-eslint/parser';
8
10
  import tsEslintPlugin from '@typescript-eslint/eslint-plugin';
9
11
  import unicornPlugin from 'eslint-plugin-unicorn';
10
- import { configs, rules } from 'eslint-config-airbnb-extended';
11
12
 
12
13
  export default [
13
14
  {
@@ -22,9 +23,10 @@ export default [
22
23
  },
23
24
 
24
25
  ...configs.base.all,
25
- unicornPlugin.configs.all,
26
+ perfectionistPlugin.configs['recommended-natural'],
26
27
  rules.base.importsStrict,
27
28
  rules.typescript.typescriptEslintStrict,
29
+ unicornPlugin.configs.all,
28
30
 
29
31
  // TypeScript files configuration
30
32
  {
@@ -51,7 +53,6 @@ export default [
51
53
  'no-return-assign': 'off',
52
54
  'no-underscore-dangle': ['error', { allowAfterThis: true }],
53
55
  'radix': ['error', 'as-needed'],
54
- 'sort-keys': ['error', 'asc', { allowLineSeparatedGroups: true, natural: true }],
55
56
 
56
57
  // Import rules
57
58
  'import-x/no-anonymous-default-export': 'error',
@@ -59,22 +60,7 @@ export default [
59
60
  'import-x/no-cycle': ['error', { maxDepth: 2 }],
60
61
  'import-x/no-deprecated': 'error',
61
62
  'import-x/no-import-module-exports': 'off',
62
- 'import-x/order': [
63
- 'error',
64
- {
65
- alphabetize: { order: 'asc', caseInsensitive: true },
66
- named: true,
67
- 'newlines-between': 'always',
68
- pathGroups: [
69
- { pattern: '@angular/**', group: 'external', position: 'before' },
70
- { pattern: '@nestjs/**', group: 'external', position: 'before' },
71
- { pattern: 'firebase*/**', group: 'external', position: 'before', patternOptions: { partial: true } },
72
- { pattern: 'ng-zorro-antd/**', group: 'external', position: 'before' },
73
- ],
74
- pathGroupsExcludedImportTypes: [],
75
- warnOnUnassignedImports: true,
76
- },
77
- ],
63
+ 'import-x/order': 'off',
78
64
  'import-x/prefer-default-export': 'off',
79
65
 
80
66
  // NgModule sort rules
@@ -111,7 +97,6 @@ export default [
111
97
  overrides: { accessors: 'explicit', constructors: 'no-public', methods: 'explicit', properties: 'explicit', parameterProperties: 'explicit' },
112
98
  },
113
99
  ],
114
- '@typescript-eslint/member-ordering': ['error', { default: { order: 'natural-case-insensitive' } }],
115
100
  '@typescript-eslint/naming-convention': [
116
101
  'error',
117
102
  { selector: 'function', format: ['camelCase'] },
@@ -136,16 +121,41 @@ export default [
136
121
  '@typescript-eslint/no-useless-default-assignment': 'error',
137
122
  '@typescript-eslint/prefer-readonly': 'error',
138
123
  '@typescript-eslint/promise-function-async': ['error', { checkArrowFunctions: false }],
139
- '@typescript-eslint/sort-type-constituents': 'error',
140
124
  '@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
141
125
 
126
+ // Perfectionist rules
127
+ 'perfectionist/sort-imports': [
128
+ 'error',
129
+ {
130
+ customGroups: [
131
+ { elementNamePattern: '^@angular/', groupName: 'angular' },
132
+ { elementNamePattern: '^@nestjs/', groupName: 'nestjs' },
133
+ { elementNamePattern: '^firebase', groupName: 'firebase' },
134
+ { elementNamePattern: '^ng-zorro-antd/', groupName: 'ng-zorro' },
135
+ ],
136
+ groups: [
137
+ 'angular',
138
+ 'nestjs',
139
+ 'firebase',
140
+ 'ng-zorro',
141
+ 'type-import',
142
+ ['value-builtin', 'value-external'],
143
+ 'type-internal',
144
+ 'value-internal',
145
+ ['type-parent', 'type-sibling', 'type-index'],
146
+ ['value-parent', 'value-sibling', 'value-index'],
147
+ 'ts-equals-import',
148
+ 'unknown',
149
+ ],
150
+ },
151
+ ],
152
+
142
153
  // Unicorn rules
143
154
  'unicorn/consistent-function-scoping': ['error', { checkArrowFunctions: false }],
144
155
  'unicorn/new-for-builtins': 'off',
145
156
  'unicorn/no-abusive-eslint-disable': 'off',
146
157
  'unicorn/no-array-for-each': 'off',
147
158
  'unicorn/no-null': 'off',
148
- 'unicorn/no-useless-promise-resolve-reject': 'off',
149
159
  'unicorn/prefer-top-level-await': 'off',
150
160
  'unicorn/switch-case-braces': ['error', 'avoid'],
151
161
  },
@@ -168,6 +178,7 @@ export default [
168
178
  '@angular-eslint/template/label-has-associated-control': 'off',
169
179
  '@angular-eslint/template/no-call-expression':'off',
170
180
  '@angular-eslint/template/no-inline-styles': 'off',
181
+ '@angular-eslint/template/prefer-ngsrc': 'off',
171
182
 
172
183
  // Unicorn rules
173
184
  'unicorn/prefer-string-raw': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-angular-strict",
3
- "version": "2.3.48",
3
+ "version": "2.3.50",
4
4
  "description": "Modern ESLint configuration with strict rules for Angular development.",
5
5
  "keywords": [
6
6
  "angular",
@@ -48,6 +48,7 @@
48
48
  "eslint-config-airbnb-extended": "3.0.1",
49
49
  "eslint-plugin-import-x": "4.16.2",
50
50
  "eslint-plugin-ng-module-sort": "1.4.0",
51
+ "eslint-plugin-perfectionist": "5.7.0",
51
52
  "eslint-plugin-unicorn": "64.0.0"
52
53
  },
53
54
  "devDependencies": {