eslint-config-angular-strict 2.3.49 → 2.3.51

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,9 +121,58 @@ 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-classes': [
128
+ 'error',
129
+ {
130
+ customGroups: [
131
+ { groupName: 'decorated-public', modifiers: ['decorated', 'public'], selector: 'property' },
132
+ { groupName: 'decorated-private', modifiers: ['decorated', 'private'], selector: 'property' },
133
+ ],
134
+ groups: [
135
+ 'decorated-public',
136
+ 'decorated-private',
137
+ ['property', 'accessor-property'],
138
+ ['private-property', 'private-accessor-property'],
139
+ 'constructor',
140
+ ['get-method', 'set-method'],
141
+ ['method', 'function-property'],
142
+ ['private-method', 'private-function-property'],
143
+ 'unknown',
144
+ ],
145
+ newlinesBetween: 1,
146
+ order: 'asc',
147
+ type: 'natural',
148
+ },
149
+ ],
150
+ 'perfectionist/sort-imports': [
151
+ 'error',
152
+ {
153
+ customGroups: [
154
+ { elementNamePattern: '^@angular/', groupName: 'angular' },
155
+ { elementNamePattern: '^@nestjs/', groupName: 'nestjs' },
156
+ { elementNamePattern: '^firebase', groupName: 'firebase' },
157
+ { elementNamePattern: '^ng-zorro-antd/', groupName: 'ng-zorro' },
158
+ ],
159
+ groups: [
160
+ 'angular',
161
+ 'nestjs',
162
+ 'firebase',
163
+ 'ng-zorro',
164
+ 'type-import',
165
+ ['value-builtin', 'value-external'],
166
+ 'type-internal',
167
+ 'value-internal',
168
+ ['type-parent', 'type-sibling', 'type-index'],
169
+ ['value-parent', 'value-sibling', 'value-index'],
170
+ 'ts-equals-import',
171
+ 'unknown',
172
+ ],
173
+ },
174
+ ],
175
+
142
176
  // Unicorn rules
143
177
  'unicorn/consistent-function-scoping': ['error', { checkArrowFunctions: false }],
144
178
  'unicorn/new-for-builtins': 'off',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-angular-strict",
3
- "version": "2.3.49",
3
+ "version": "2.3.51",
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": {