@taiga-ui/eslint-plugin-experience-next 0.428.0 → 0.430.0
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/configs/utils/get-ng-version.d.ts +8 -0
- package/configs/utils/project-json-exist.d.ts +1 -0
- package/index.esm.js +90 -44
- package/package.json +33 -10
- package/rules/convention.d.ts +22 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function projectJsonExist(filename: string): string;
|
package/index.esm.js
CHANGED
|
@@ -2,25 +2,31 @@ import fs, { readFileSync } from 'node:fs';
|
|
|
2
2
|
import html from '@html-eslint/eslint-plugin';
|
|
3
3
|
import htmlParser from '@html-eslint/parser';
|
|
4
4
|
import { defineConfig } from 'eslint/config';
|
|
5
|
-
import { createRequire } from 'node:module';
|
|
6
5
|
import eslint from '@eslint/js';
|
|
7
6
|
import markdown from '@eslint/markdown';
|
|
8
7
|
import rxjs from '@smarttools/eslint-plugin-rxjs';
|
|
9
8
|
import stylistic from '@stylistic/eslint-plugin';
|
|
10
9
|
import angular from 'angular-eslint';
|
|
11
10
|
import compat from 'eslint-plugin-compat';
|
|
11
|
+
import cypress from 'eslint-plugin-cypress';
|
|
12
|
+
import { configs } from 'eslint-plugin-de-morgan';
|
|
13
|
+
import decoratorPosition from 'eslint-plugin-decorator-position';
|
|
12
14
|
import progress from 'eslint-plugin-file-progress';
|
|
15
|
+
import importPlugin from 'eslint-plugin-import';
|
|
13
16
|
import jest from 'eslint-plugin-jest';
|
|
14
|
-
import packageJson, { configs as configs$
|
|
17
|
+
import packageJson, { configs as configs$2 } from 'eslint-plugin-package-json';
|
|
18
|
+
import perfectionist from 'eslint-plugin-perfectionist';
|
|
15
19
|
import playwright from 'eslint-plugin-playwright';
|
|
16
20
|
import prettier from 'eslint-plugin-prettier';
|
|
17
|
-
import
|
|
21
|
+
import promise from 'eslint-plugin-promise';
|
|
22
|
+
import regexp, { configs as configs$1 } from 'eslint-plugin-regexp';
|
|
18
23
|
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
19
24
|
import sonarjs from 'eslint-plugin-sonarjs';
|
|
20
25
|
import unicorn from 'eslint-plugin-unicorn';
|
|
21
26
|
import unusedImports from 'eslint-plugin-unused-imports';
|
|
22
27
|
import globals from 'globals';
|
|
23
28
|
import tseslint from 'typescript-eslint';
|
|
29
|
+
import { createRequire } from 'node:module';
|
|
24
30
|
import { globSync } from 'glob';
|
|
25
31
|
import { ESLintUtils, AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
26
32
|
import ts from 'typescript';
|
|
@@ -119,7 +125,7 @@ const TUI_RECOMMENDED_NAMING_CONVENTION = [
|
|
|
119
125
|
},
|
|
120
126
|
{
|
|
121
127
|
format: ['camelCase'],
|
|
122
|
-
selector: ['classMethod', '
|
|
128
|
+
selector: ['classMethod', 'classProperty'],
|
|
123
129
|
},
|
|
124
130
|
{
|
|
125
131
|
format: ['UPPER_CASE', 'camelCase', 'PascalCase'],
|
|
@@ -130,6 +136,18 @@ const TUI_RECOMMENDED_NAMING_CONVENTION = [
|
|
|
130
136
|
format: null,
|
|
131
137
|
selector: 'variable',
|
|
132
138
|
},
|
|
139
|
+
{
|
|
140
|
+
custom: {
|
|
141
|
+
match: true,
|
|
142
|
+
regex: String.raw `^[\x00-\x7F]+$`,
|
|
143
|
+
},
|
|
144
|
+
format: null,
|
|
145
|
+
selector: 'parameter',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
format: ['camelCase'],
|
|
149
|
+
selector: 'function',
|
|
150
|
+
},
|
|
133
151
|
];
|
|
134
152
|
const TUI_CUSTOM_TAIGA_NAMING_CONVENTION = [
|
|
135
153
|
...TUI_RECOMMENDED_NAMING_CONVENTION,
|
|
@@ -193,18 +211,17 @@ const TUI_MEMBER_ORDERING_CONVENTION = [
|
|
|
193
211
|
'#private-instance-method',
|
|
194
212
|
];
|
|
195
213
|
|
|
196
|
-
const require$
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
};
|
|
214
|
+
const require$2 = createRequire(import.meta.url);
|
|
215
|
+
function getAngularVersion() {
|
|
216
|
+
try {
|
|
217
|
+
const { major } = require$2('@angular/cli').VERSION;
|
|
218
|
+
return Number.parseInt(major, 10);
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return 16;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const angularVersion = getAngularVersion();
|
|
208
225
|
const modernAngularRules = {
|
|
209
226
|
defaultStandalone: 19,
|
|
210
227
|
modernStyles: 17,
|
|
@@ -212,12 +229,28 @@ const modernAngularRules = {
|
|
|
212
229
|
preferSignals: 17,
|
|
213
230
|
templateLiteral: 19,
|
|
214
231
|
};
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
232
|
+
|
|
233
|
+
const require$1 = createRequire(import.meta.url);
|
|
234
|
+
function projectJsonExist(filename) {
|
|
235
|
+
try {
|
|
236
|
+
const path = require$1('node:path').resolve(filename);
|
|
237
|
+
return require$1('node:fs').existsSync(path) ? path : '';
|
|
238
|
+
}
|
|
239
|
+
catch {
|
|
240
|
+
return '';
|
|
241
|
+
}
|
|
218
242
|
}
|
|
219
|
-
|
|
243
|
+
|
|
220
244
|
const ALL_TS_JS_FILES = ['**/*.{js,mjs,ts,cjs,tsx,jsx}'];
|
|
245
|
+
const tsconfig = projectJsonExist('tsconfig.eslint.json') ||
|
|
246
|
+
projectJsonExist('tsconfig.json') ||
|
|
247
|
+
projectJsonExist('tsconfig.base.json');
|
|
248
|
+
const parserOptions = tsconfig
|
|
249
|
+
? { project: [tsconfig] }
|
|
250
|
+
: {
|
|
251
|
+
projectService: true,
|
|
252
|
+
tsconfigRootDir: process.cwd(),
|
|
253
|
+
};
|
|
221
254
|
var recommended = defineConfig([
|
|
222
255
|
progress.configs['recommended-ci'],
|
|
223
256
|
{
|
|
@@ -240,13 +273,12 @@ var recommended = defineConfig([
|
|
|
240
273
|
'**/LICENSE',
|
|
241
274
|
],
|
|
242
275
|
},
|
|
243
|
-
require$1('eslint-config-prettier'),
|
|
244
276
|
{
|
|
245
277
|
files: ALL_TS_JS_FILES,
|
|
246
278
|
plugins: {
|
|
247
279
|
'@stylistic': stylistic,
|
|
248
|
-
'decorator-position':
|
|
249
|
-
perfectionist
|
|
280
|
+
'decorator-position': decoratorPosition,
|
|
281
|
+
perfectionist,
|
|
250
282
|
prettier,
|
|
251
283
|
regexp,
|
|
252
284
|
'simple-import-sort': simpleImportSort,
|
|
@@ -255,13 +287,12 @@ var recommended = defineConfig([
|
|
|
255
287
|
'unused-imports': unusedImports,
|
|
256
288
|
},
|
|
257
289
|
extends: [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
290
|
+
configs.recommended,
|
|
291
|
+
importPlugin.flatConfigs.recommended,
|
|
292
|
+
importPlugin.flatConfigs.typescript,
|
|
293
|
+
promise.configs['flat/recommended'],
|
|
262
294
|
compat.configs['flat/recommended'],
|
|
263
|
-
configs['flat/recommended'],
|
|
264
|
-
eslint.configs.recommended,
|
|
295
|
+
configs$1['flat/recommended'],
|
|
265
296
|
eslint.configs.recommended,
|
|
266
297
|
tseslint.configs.all,
|
|
267
298
|
],
|
|
@@ -383,10 +414,6 @@ var recommended = defineConfig([
|
|
|
383
414
|
{ default: TUI_MEMBER_ORDERING_CONVENTION },
|
|
384
415
|
],
|
|
385
416
|
'@typescript-eslint/method-signature-style': ['error', 'method'],
|
|
386
|
-
'@typescript-eslint/naming-convention': [
|
|
387
|
-
'error',
|
|
388
|
-
...TUI_RECOMMENDED_NAMING_CONVENTION,
|
|
389
|
-
],
|
|
390
417
|
'@typescript-eslint/no-base-to-string': 'off',
|
|
391
418
|
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
392
419
|
'@typescript-eslint/no-confusing-void-expression': 'off',
|
|
@@ -778,7 +805,7 @@ var recommended = defineConfig([
|
|
|
778
805
|
},
|
|
779
806
|
{
|
|
780
807
|
files: ['**/*.{ts,tsx}'],
|
|
781
|
-
plugins: { rxjs },
|
|
808
|
+
plugins: { rxjs: rxjs },
|
|
782
809
|
extends: [angular.configs.tsRecommended],
|
|
783
810
|
processor: angular.processInlineTemplates,
|
|
784
811
|
rules: {
|
|
@@ -1049,8 +1076,31 @@ var recommended = defineConfig([
|
|
|
1049
1076
|
'jest/valid-title': 'error',
|
|
1050
1077
|
},
|
|
1051
1078
|
},
|
|
1079
|
+
{
|
|
1080
|
+
files: ['**/*.ts'],
|
|
1081
|
+
rules: {
|
|
1082
|
+
'@typescript-eslint/naming-convention': [
|
|
1083
|
+
'error',
|
|
1084
|
+
...TUI_RECOMMENDED_NAMING_CONVENTION,
|
|
1085
|
+
],
|
|
1086
|
+
},
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
files: ['**/*.tsx'],
|
|
1090
|
+
rules: {
|
|
1091
|
+
'@typescript-eslint/naming-convention': [
|
|
1092
|
+
'error',
|
|
1093
|
+
...TUI_RECOMMENDED_NAMING_CONVENTION.filter(({ selector }) => selector !== 'function'),
|
|
1094
|
+
{
|
|
1095
|
+
format: ['camelCase', 'PascalCase'],
|
|
1096
|
+
selector: 'function',
|
|
1097
|
+
},
|
|
1098
|
+
],
|
|
1099
|
+
},
|
|
1100
|
+
},
|
|
1052
1101
|
{
|
|
1053
1102
|
files: ['**/*.cy.ts'],
|
|
1103
|
+
plugins: { cypress },
|
|
1054
1104
|
rules: {
|
|
1055
1105
|
'compat/compat': 'off',
|
|
1056
1106
|
'cypress/no-unnecessary-waiting': 'off',
|
|
@@ -1070,9 +1120,12 @@ var recommended = defineConfig([
|
|
|
1070
1120
|
{
|
|
1071
1121
|
files: ['**/package.json'],
|
|
1072
1122
|
plugins: { 'package-json': packageJson },
|
|
1073
|
-
extends: [tseslint.configs.disableTypeChecked, configs$
|
|
1123
|
+
extends: [tseslint.configs.disableTypeChecked, configs$2.recommended],
|
|
1074
1124
|
rules: {
|
|
1075
1125
|
'package-json/require-description': ['error', { ignorePrivate: true }],
|
|
1126
|
+
'package-json/require-exports': 'off',
|
|
1127
|
+
'package-json/require-files': 'off',
|
|
1128
|
+
'package-json/require-sideEffects': 'off',
|
|
1076
1129
|
'package-json/require-type': ['off', { ignorePrivate: true }],
|
|
1077
1130
|
'package-json/specify-peers-locally': 'off',
|
|
1078
1131
|
},
|
|
@@ -1089,15 +1142,6 @@ var recommended = defineConfig([
|
|
|
1089
1142
|
rules: { 'no-irregular-whitespace': 'off' },
|
|
1090
1143
|
},
|
|
1091
1144
|
]);
|
|
1092
|
-
function projectJsonExist(filename) {
|
|
1093
|
-
try {
|
|
1094
|
-
const path = require$1('node:path').resolve(filename);
|
|
1095
|
-
return require$1('node:fs').existsSync(path) ? path : '';
|
|
1096
|
-
}
|
|
1097
|
-
catch {
|
|
1098
|
-
return '';
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
1145
|
|
|
1102
1146
|
const allPackageJSONs = globSync('**/package.json', {
|
|
1103
1147
|
ignore: ['**/node_modules/**', '**/dist/**'],
|
|
@@ -2784,6 +2828,8 @@ const DEFAULT_EXCEPTIONS = [
|
|
|
2784
2828
|
{ from: 'TuiTextfieldOptionsDirective', to: 'TuiTextfield' },
|
|
2785
2829
|
{ from: 'TuiPreviewDialogDirective', to: 'TuiPreview' },
|
|
2786
2830
|
{ from: 'TuiAccountComponent', to: 'TuiAccountComponent' },
|
|
2831
|
+
{ from: 'TuiIslandDirective', to: 'TuiIsland' },
|
|
2832
|
+
{ from: 'TuiTableBarsHostComponent', to: 'TuiTableBarsHost' },
|
|
2787
2833
|
];
|
|
2788
2834
|
const createRule$2 = ESLintUtils.RuleCreator((name) => name);
|
|
2789
2835
|
const rule$1 = createRule$2({
|
package/package.json
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/eslint-plugin-experience-next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.430.0",
|
|
4
4
|
"description": "An ESLint plugin to enforce a consistent code styles across taiga-ui projects",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/taiga-family/toolkit.git"
|
|
8
|
+
},
|
|
5
9
|
"license": "Apache-2.0",
|
|
10
|
+
"contributors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Alex Inkin",
|
|
13
|
+
"email": "alexander@inkin.ru"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Maksim Ivanov",
|
|
17
|
+
"email": "splincodewd@yandex.ru"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "Vladimir Potekhin",
|
|
21
|
+
"email": "vladimir.potekh@gmail.com"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Nikita Barsukov",
|
|
25
|
+
"email": "nikita.s.barsukov@gmail.com"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
6
28
|
"type": "module",
|
|
7
29
|
"devDependencies": {
|
|
8
|
-
"@typescript-eslint/rule-tester": "8.57.
|
|
30
|
+
"@typescript-eslint/rule-tester": "8.57.1",
|
|
9
31
|
"glob": "13.0.6"
|
|
10
32
|
},
|
|
11
33
|
"peerDependencies": {
|
|
@@ -21,24 +43,25 @@
|
|
|
21
43
|
"eslint": "^9.39.2",
|
|
22
44
|
"eslint-config-prettier": "^10.1.7",
|
|
23
45
|
"eslint-plugin-compat": "^7.0.1",
|
|
24
|
-
"eslint-plugin-
|
|
46
|
+
"eslint-plugin-cypress": "^6.2.0",
|
|
47
|
+
"eslint-plugin-de-morgan": "^2.1.1",
|
|
25
48
|
"eslint-plugin-decorator-position": "^6.0.0",
|
|
26
49
|
"eslint-plugin-file-progress": "^3.0.2",
|
|
27
50
|
"eslint-plugin-import": "^2.32.0",
|
|
28
|
-
"eslint-plugin-jest": "^29.
|
|
29
|
-
"eslint-plugin-package-json": "^0.
|
|
30
|
-
"eslint-plugin-perfectionist": "^5.
|
|
31
|
-
"eslint-plugin-playwright": "^2.
|
|
51
|
+
"eslint-plugin-jest": "^29.15.0",
|
|
52
|
+
"eslint-plugin-package-json": "^0.91.0",
|
|
53
|
+
"eslint-plugin-perfectionist": "^5.6.0",
|
|
54
|
+
"eslint-plugin-playwright": "^2.10.0",
|
|
32
55
|
"eslint-plugin-prettier": "^5.5.5",
|
|
33
56
|
"eslint-plugin-promise": "^7.2.1",
|
|
34
|
-
"eslint-plugin-regexp": "^3.
|
|
57
|
+
"eslint-plugin-regexp": "^3.1.0",
|
|
35
58
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
36
|
-
"eslint-plugin-sonarjs": "^4.0.
|
|
59
|
+
"eslint-plugin-sonarjs": "^4.0.2",
|
|
37
60
|
"eslint-plugin-unicorn": "^63.0.0",
|
|
38
61
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
39
62
|
"glob": "*",
|
|
40
63
|
"globals": "^17.4.0",
|
|
41
|
-
"typescript-eslint": "^8.57.
|
|
64
|
+
"typescript-eslint": "^8.57.1"
|
|
42
65
|
},
|
|
43
66
|
"publishConfig": {
|
|
44
67
|
"access": "public"
|
package/rules/convention.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const TUI_RECOMMENDED_NAMING_CONVENTION: readonly [{
|
|
|
3
3
|
readonly selector: readonly ["class", "interface", "typeAlias", "typeLike", "enum", "enumMember"];
|
|
4
4
|
}, {
|
|
5
5
|
readonly format: readonly ["camelCase"];
|
|
6
|
-
readonly selector: readonly ["classMethod", "
|
|
6
|
+
readonly selector: readonly ["classMethod", "classProperty"];
|
|
7
7
|
}, {
|
|
8
8
|
readonly format: readonly ["UPPER_CASE", "camelCase", "PascalCase"];
|
|
9
9
|
readonly selector: readonly ["variable"];
|
|
@@ -11,13 +11,23 @@ export declare const TUI_RECOMMENDED_NAMING_CONVENTION: readonly [{
|
|
|
11
11
|
readonly filter: "__non_webpack_require__";
|
|
12
12
|
readonly format: null;
|
|
13
13
|
readonly selector: "variable";
|
|
14
|
+
}, {
|
|
15
|
+
readonly custom: {
|
|
16
|
+
readonly match: true;
|
|
17
|
+
readonly regex: string;
|
|
18
|
+
};
|
|
19
|
+
readonly format: null;
|
|
20
|
+
readonly selector: "parameter";
|
|
21
|
+
}, {
|
|
22
|
+
readonly format: readonly ["camelCase"];
|
|
23
|
+
readonly selector: "function";
|
|
14
24
|
}];
|
|
15
25
|
export declare const TUI_CUSTOM_TAIGA_NAMING_CONVENTION: readonly [{
|
|
16
26
|
readonly format: readonly ["PascalCase"];
|
|
17
27
|
readonly selector: readonly ["class", "interface", "typeAlias", "typeLike", "enum", "enumMember"];
|
|
18
28
|
}, {
|
|
19
29
|
readonly format: readonly ["camelCase"];
|
|
20
|
-
readonly selector: readonly ["classMethod", "
|
|
30
|
+
readonly selector: readonly ["classMethod", "classProperty"];
|
|
21
31
|
}, {
|
|
22
32
|
readonly format: readonly ["UPPER_CASE", "camelCase", "PascalCase"];
|
|
23
33
|
readonly selector: readonly ["variable"];
|
|
@@ -25,6 +35,16 @@ export declare const TUI_CUSTOM_TAIGA_NAMING_CONVENTION: readonly [{
|
|
|
25
35
|
readonly filter: "__non_webpack_require__";
|
|
26
36
|
readonly format: null;
|
|
27
37
|
readonly selector: "variable";
|
|
38
|
+
}, {
|
|
39
|
+
readonly custom: {
|
|
40
|
+
readonly match: true;
|
|
41
|
+
readonly regex: string;
|
|
42
|
+
};
|
|
43
|
+
readonly format: null;
|
|
44
|
+
readonly selector: "parameter";
|
|
45
|
+
}, {
|
|
46
|
+
readonly format: readonly ["camelCase"];
|
|
47
|
+
readonly selector: "function";
|
|
28
48
|
}, {
|
|
29
49
|
readonly format: readonly ["PascalCase"];
|
|
30
50
|
readonly modifiers: readonly ["exported"];
|