@taiga-ui/eslint-plugin-experience-next 0.299.0 → 0.301.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/html-eslint.d.ts +51 -0
- package/index.d.ts +1 -0
- package/index.esm.js +64 -11
- package/package.json +5 -5
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import html from '@html-eslint/eslint-plugin';
|
|
2
|
+
import htmlParser from '@html-eslint/parser';
|
|
3
|
+
declare const _default: ({
|
|
4
|
+
ignores: string[];
|
|
5
|
+
files?: undefined;
|
|
6
|
+
rules?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
files: string[];
|
|
9
|
+
plugins: {
|
|
10
|
+
'@html-eslint': typeof html;
|
|
11
|
+
};
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: typeof htmlParser;
|
|
14
|
+
};
|
|
15
|
+
rules: {
|
|
16
|
+
'@html-eslint/indent': string;
|
|
17
|
+
'@html-eslint/no-extra-spacing-attrs': string;
|
|
18
|
+
'@html-eslint/no-multiple-h1': string;
|
|
19
|
+
'@html-eslint/no-restricted-attr-values': (string | {
|
|
20
|
+
attrPatterns: string[];
|
|
21
|
+
attrValuePatterns: string[];
|
|
22
|
+
message: string;
|
|
23
|
+
})[];
|
|
24
|
+
'@html-eslint/require-closing-tags': string;
|
|
25
|
+
'@html-eslint/require-img-alt': (string | {
|
|
26
|
+
substitute: string[];
|
|
27
|
+
})[];
|
|
28
|
+
'@html-eslint/use-baseline': string;
|
|
29
|
+
"@html-eslint/require-lang": "error";
|
|
30
|
+
"@html-eslint/require-doctype": "error";
|
|
31
|
+
"@html-eslint/require-title": "error";
|
|
32
|
+
"@html-eslint/attrs-newline": "error";
|
|
33
|
+
"@html-eslint/element-newline": ["error", {
|
|
34
|
+
inline: string[];
|
|
35
|
+
}];
|
|
36
|
+
"@html-eslint/no-duplicate-id": "error";
|
|
37
|
+
"@html-eslint/require-li-container": "error";
|
|
38
|
+
"@html-eslint/quotes": "error";
|
|
39
|
+
"@html-eslint/no-obsolete-tags": "error";
|
|
40
|
+
"@html-eslint/no-duplicate-attrs": "error";
|
|
41
|
+
"@html-eslint/no-duplicate-in-head": "error";
|
|
42
|
+
};
|
|
43
|
+
ignores?: undefined;
|
|
44
|
+
} | {
|
|
45
|
+
files: string[];
|
|
46
|
+
rules: {
|
|
47
|
+
'@html-eslint/no-restricted-attr-values': string;
|
|
48
|
+
};
|
|
49
|
+
ignores?: undefined;
|
|
50
|
+
})[];
|
|
51
|
+
export default _default;
|
package/index.d.ts
CHANGED
package/index.esm.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { readFileSync as readFileSync$1 } from 'fs';
|
|
2
|
+
import html from '@html-eslint/eslint-plugin';
|
|
3
|
+
import htmlParser from '@html-eslint/parser';
|
|
2
4
|
import rxjs from '@smarttools/eslint-plugin-rxjs';
|
|
3
5
|
import stylistic from '@stylistic/eslint-plugin';
|
|
4
6
|
import angular from 'angular-eslint';
|
|
@@ -17,6 +19,43 @@ import fs, { readFileSync } from 'node:fs';
|
|
|
17
19
|
import { globSync } from 'glob';
|
|
18
20
|
import path from 'node:path';
|
|
19
21
|
|
|
22
|
+
var htmlEslint = [{
|
|
23
|
+
ignores: ['**/tests-report/**', '**/snapshots/**', '**/test-results/**', '**/.nx/**', '**/node_modules/**', '**/coverage/**']
|
|
24
|
+
}, {
|
|
25
|
+
...html.configs['flat/recommended'],
|
|
26
|
+
files: ['**/*.html'],
|
|
27
|
+
plugins: {
|
|
28
|
+
'@html-eslint': html
|
|
29
|
+
},
|
|
30
|
+
languageOptions: {
|
|
31
|
+
parser: htmlParser
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
...html.configs['flat/recommended'].rules,
|
|
35
|
+
'@html-eslint/indent': 'off',
|
|
36
|
+
// prettier conflicts
|
|
37
|
+
'@html-eslint/no-extra-spacing-attrs': 'off',
|
|
38
|
+
// prettier conflicts
|
|
39
|
+
'@html-eslint/no-multiple-h1': 'off',
|
|
40
|
+
'@html-eslint/no-restricted-attr-values': ['error', {
|
|
41
|
+
attrPatterns: ['iconStart', 'iconEnd', 'icon'],
|
|
42
|
+
attrValuePatterns: ['@tui'],
|
|
43
|
+
message: 'Icons must be configured, for example: \n<button tuiIconButton [iconStart]="options.iconStart" [iconEnd]="options.iconEnd" /> \n<tui-icon [icon]="options.icon" />'
|
|
44
|
+
}],
|
|
45
|
+
'@html-eslint/require-closing-tags': 'off',
|
|
46
|
+
// prettier conflicts
|
|
47
|
+
'@html-eslint/require-img-alt': ['error', {
|
|
48
|
+
substitute: ['[alt]', '[attr.alt]']
|
|
49
|
+
}],
|
|
50
|
+
'@html-eslint/use-baseline': 'off'
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
53
|
+
files: ['**/demo/**/*.html'],
|
|
54
|
+
rules: {
|
|
55
|
+
'@html-eslint/no-restricted-attr-values': 'off'
|
|
56
|
+
}
|
|
57
|
+
}];
|
|
58
|
+
|
|
20
59
|
function getDefaultExportFromCjs (x) {
|
|
21
60
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
22
61
|
}
|
|
@@ -726,6 +765,17 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
726
765
|
'@typescript-eslint/require-await': 'error',
|
|
727
766
|
'@typescript-eslint/restrict-plus-operands': 'error',
|
|
728
767
|
'@typescript-eslint/sort-type-constituents': 'error',
|
|
768
|
+
'@typescript-eslint/strict-boolean-expressions': ['error', {
|
|
769
|
+
allowAny: true,
|
|
770
|
+
allowNullableBoolean: true,
|
|
771
|
+
allowNullableEnum: false,
|
|
772
|
+
allowNullableNumber: true,
|
|
773
|
+
allowNullableObject: true,
|
|
774
|
+
allowNullableString: true,
|
|
775
|
+
allowNumber: true,
|
|
776
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
|
|
777
|
+
allowString: true
|
|
778
|
+
}],
|
|
729
779
|
'@typescript-eslint/switch-exhaustiveness-check': ['error', {
|
|
730
780
|
considerDefaultExhaustiveForUnions: true,
|
|
731
781
|
allowDefaultCaseForExhaustiveSwitch: true,
|
|
@@ -791,6 +841,7 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
791
841
|
'no-empty': ['error', {
|
|
792
842
|
allowEmptyCatch: true
|
|
793
843
|
}],
|
|
844
|
+
'no-extra-boolean-cast': 'error',
|
|
794
845
|
'no-implicit-coercion': ['error', {
|
|
795
846
|
allow: ['!!']
|
|
796
847
|
}],
|
|
@@ -867,6 +918,7 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
867
918
|
selector: "CallExpression[callee.name='inject'][arguments.0.name='Injector']"
|
|
868
919
|
}],
|
|
869
920
|
'no-return-assign': ['error', 'always'],
|
|
921
|
+
'no-unneeded-ternary': 'error',
|
|
870
922
|
'no-useless-concat': 'error',
|
|
871
923
|
'no-useless-escape': 'error',
|
|
872
924
|
'no-useless-rename': ['error', {
|
|
@@ -930,6 +982,7 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
930
982
|
case: 'kebabCase'
|
|
931
983
|
}],
|
|
932
984
|
'unicorn/new-for-builtins': 'error',
|
|
985
|
+
'unicorn/no-array-method-this-argument': 'error',
|
|
933
986
|
'unicorn/no-array-push-push': 'error',
|
|
934
987
|
'unicorn/no-await-in-promise-methods': 'error',
|
|
935
988
|
'unicorn/no-empty-file': 'error',
|
|
@@ -987,7 +1040,6 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
987
1040
|
'@typescript-eslint/no-misused-promises': 'off',
|
|
988
1041
|
'@typescript-eslint/no-mixed-enums': 'off',
|
|
989
1042
|
'@typescript-eslint/no-redundant-type-constituents': 'off',
|
|
990
|
-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
|
|
991
1043
|
'@typescript-eslint/no-unnecessary-qualifier': 'off',
|
|
992
1044
|
'@typescript-eslint/no-unnecessary-template-expression': 'off',
|
|
993
1045
|
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
|
|
@@ -1005,7 +1057,6 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
1005
1057
|
'@typescript-eslint/prefer-destructuring': 'off',
|
|
1006
1058
|
'@typescript-eslint/prefer-find': 'off',
|
|
1007
1059
|
'@typescript-eslint/prefer-includes': 'off',
|
|
1008
|
-
'@typescript-eslint/prefer-optional-chain': 'off',
|
|
1009
1060
|
'@typescript-eslint/prefer-promise-reject-errors': 'off',
|
|
1010
1061
|
'@typescript-eslint/prefer-readonly': 'off',
|
|
1011
1062
|
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
|
|
@@ -1139,7 +1190,6 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
1139
1190
|
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
1140
1191
|
'@typescript-eslint/no-require-imports': 'off',
|
|
1141
1192
|
'@typescript-eslint/no-shadow': 'off',
|
|
1142
|
-
'@typescript-eslint/no-unnecessary-condition': 'off',
|
|
1143
1193
|
'@typescript-eslint/no-unnecessary-template-expression': 'off',
|
|
1144
1194
|
'@typescript-eslint/no-unnecessary-type-parameters': 'off',
|
|
1145
1195
|
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
@@ -1153,7 +1203,6 @@ var recommended = tseslint.config(progress.configs['recommended-ci'], require('e
|
|
|
1153
1203
|
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
1154
1204
|
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
|
|
1155
1205
|
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
1156
|
-
'@typescript-eslint/strict-boolean-expressions': 'off',
|
|
1157
1206
|
'@typescript-eslint/unbound-method': 'off',
|
|
1158
1207
|
camelcase: 'off',
|
|
1159
1208
|
'class-methods-use-this': 'off',
|
|
@@ -1431,7 +1480,7 @@ const config$8 = {
|
|
|
1431
1480
|
const classesInFile = new Map();
|
|
1432
1481
|
return {
|
|
1433
1482
|
ClassDeclaration(node) {
|
|
1434
|
-
if (node.id
|
|
1483
|
+
if (node.id.name) {
|
|
1435
1484
|
classesInFile.set(node.id.name, true);
|
|
1436
1485
|
}
|
|
1437
1486
|
},
|
|
@@ -1459,9 +1508,7 @@ const config$8 = {
|
|
|
1459
1508
|
},
|
|
1460
1509
|
ImportDeclaration(node) {
|
|
1461
1510
|
for (const specifier of node.specifiers) {
|
|
1462
|
-
|
|
1463
|
-
classesInFile.set(specifier.local.name, true);
|
|
1464
|
-
}
|
|
1511
|
+
classesInFile.set(specifier.local.name, true);
|
|
1465
1512
|
}
|
|
1466
1513
|
}
|
|
1467
1514
|
};
|
|
@@ -1495,7 +1542,7 @@ const config$7 = {
|
|
|
1495
1542
|
const decoratorArguments = Array.from(expression.arguments ?? []);
|
|
1496
1543
|
for (const argument of decoratorArguments) {
|
|
1497
1544
|
const properties = Array.from(argument.properties ?? []);
|
|
1498
|
-
const current = properties.map(prop => prop.key?.name).filter(Boolean)
|
|
1545
|
+
const current = properties.map(prop => prop.key?.name).filter(Boolean);
|
|
1499
1546
|
const correct = getCorrectOrderRelative(orderList, current);
|
|
1500
1547
|
if (!isCorrectSortedAccording(correct, current)) {
|
|
1501
1548
|
context.report({
|
|
@@ -1714,7 +1761,7 @@ const config$3 = {
|
|
|
1714
1761
|
create(context) {
|
|
1715
1762
|
return {
|
|
1716
1763
|
ClassDeclaration: function reportUnwantedName(node) {
|
|
1717
|
-
const members = Array.from(node
|
|
1764
|
+
const members = Array.from(node.body.body);
|
|
1718
1765
|
members.forEach(member => {
|
|
1719
1766
|
if (member?.key?.type === 'PrivateIdentifier') {
|
|
1720
1767
|
context.report({
|
|
@@ -1801,7 +1848,7 @@ const config$2 = {
|
|
|
1801
1848
|
}
|
|
1802
1849
|
};
|
|
1803
1850
|
function findNearestEntryPoint(filePath) {
|
|
1804
|
-
const pathSegments = (filePath ?? '')
|
|
1851
|
+
const pathSegments = (filePath ?? '').split('/');
|
|
1805
1852
|
for (let i = pathSegments.length - 1; i >= 0; i--) {
|
|
1806
1853
|
const possibleEntryPoint = pathSegments.slice(0, i).join('/');
|
|
1807
1854
|
if (fs.existsSync(`${possibleEntryPoint}/ng-package.json`)) {
|
|
@@ -1980,6 +2027,12 @@ const plugin = {
|
|
|
1980
2027
|
// https://eslint.org/docs/latest/extend/plugins
|
|
1981
2028
|
// assign configs here so we can reference `plugin`
|
|
1982
2029
|
Object.assign(plugin.configs, {
|
|
2030
|
+
['html-eslint']: [{
|
|
2031
|
+
files: ['**/*.html'],
|
|
2032
|
+
plugins: {
|
|
2033
|
+
'@taiga-ui/experience-next': plugin
|
|
2034
|
+
}
|
|
2035
|
+
}, ...htmlEslint],
|
|
1983
2036
|
recommended: [{
|
|
1984
2037
|
files: ['**/*.ts', '**/*.js'],
|
|
1985
2038
|
plugins: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/eslint-plugin-experience-next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.301.0",
|
|
4
4
|
"description": "An ESLint plugin to enforce a consistent code styles across taiga-ui projects",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"@eslint/compat": ">=1.3.1",
|
|
12
|
-
"@html-eslint/eslint-plugin": ">=0.
|
|
13
|
-
"@html-eslint/parser": ">=0.
|
|
12
|
+
"@html-eslint/eslint-plugin": ">=0.44.0",
|
|
13
|
+
"@html-eslint/parser": ">=0.44.0",
|
|
14
14
|
"@smarttools/eslint-plugin-rxjs": ">=1.0.22",
|
|
15
15
|
"@stylistic/eslint-plugin": ">=5.2.2",
|
|
16
16
|
"@types/glob": "*",
|
|
17
17
|
"angular-eslint": ">=20.1.1",
|
|
18
18
|
"eslint": ">=9.32.0",
|
|
19
19
|
"eslint-config-prettier": ">=10.1.7",
|
|
20
|
-
"eslint-plugin-de-morgan": ">=1.3.
|
|
20
|
+
"eslint-plugin-de-morgan": ">=1.3.1",
|
|
21
21
|
"eslint-plugin-decorator-position": ">=6.0.0",
|
|
22
22
|
"eslint-plugin-file-progress": ">=3.0.2",
|
|
23
23
|
"eslint-plugin-import": ">=2.32.0",
|
|
24
24
|
"eslint-plugin-jest": ">=29.0.1",
|
|
25
25
|
"eslint-plugin-perfectionist": ">=4.15.0",
|
|
26
|
-
"eslint-plugin-playwright": ">=2.2.
|
|
26
|
+
"eslint-plugin-playwright": ">=2.2.2",
|
|
27
27
|
"eslint-plugin-prettier": ">=5.5.3",
|
|
28
28
|
"eslint-plugin-promise": ">=7.2.1",
|
|
29
29
|
"eslint-plugin-simple-import-sort": ">=12.1.1",
|