lint-suite 1.0.10 → 1.2.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/README.md +2 -1
- package/index.cjs +211 -39
- package/index.cjs.map +4 -4
- package/index.d.ts +4 -1
- package/index.d.ts.map +1 -1
- package/index.js +208 -39
- package/index.js.map +4 -4
- package/lib/angular-template.d.ts +2 -2
- package/lib/angular-template.d.ts.map +1 -1
- package/lib/angular.d.ts +2 -2
- package/lib/angular.d.ts.map +1 -1
- package/lib/base.d.ts +1 -2
- package/lib/base.d.ts.map +1 -1
- package/lib/boundaries.d.ts +2 -0
- package/lib/boundaries.d.ts.map +1 -0
- package/lib/javascript.d.ts +2 -2
- package/lib/javascript.d.ts.map +1 -1
- package/lib/jest.d.ts +1 -2
- package/lib/jest.d.ts.map +1 -1
- package/lib/json.d.ts +1 -2
- package/lib/json.d.ts.map +1 -1
- package/lib/playwright.d.ts +2 -0
- package/lib/playwright.d.ts.map +1 -0
- package/lib/rules/explicit-accessibility.d.ts.map +1 -1
- package/lib/rxjs.d.ts +1 -2
- package/lib/rxjs.d.ts.map +1 -1
- package/lib/storybook.d.ts +1 -2
- package/lib/storybook.d.ts.map +1 -1
- package/lib/typescript.d.ts +2 -2
- package/lib/typescript.d.ts.map +1 -1
- package/lib/vitest.d.ts +2 -0
- package/lib/vitest.d.ts.map +1 -0
- package/package.json +19 -10
package/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
// packages/lint-suite/src/lib/angular-template.ts
|
|
2
2
|
import { configs } from "angular-eslint";
|
|
3
|
-
import {
|
|
4
|
-
var angularTemplate =
|
|
3
|
+
import { defineConfig } from "eslint/config";
|
|
4
|
+
var angularTemplate = defineConfig([
|
|
5
5
|
{
|
|
6
6
|
files: ["**/*.html"],
|
|
7
|
-
extends: [
|
|
7
|
+
extends: [
|
|
8
|
+
...configs.templateAccessibility,
|
|
9
|
+
...configs.templateRecommended
|
|
10
|
+
],
|
|
8
11
|
rules: {
|
|
9
12
|
"@angular-eslint/template/prefer-template-literal": "error",
|
|
10
13
|
"@angular-eslint/template/no-any": "error",
|
|
@@ -22,6 +25,14 @@ var angularTemplate = config([
|
|
|
22
25
|
"@angular-eslint/template/prefer-control-flow": "error",
|
|
23
26
|
"@angular-eslint/template/prefer-self-closing-tags": "error",
|
|
24
27
|
"@angular-eslint/template/prefer-ngsrc": "error",
|
|
28
|
+
"@angular-eslint/template/prefer-empty-for": "error",
|
|
29
|
+
"@angular-eslint/template/prefer-built-in-pipes": "error",
|
|
30
|
+
"@angular-eslint/template/no-call-expression": "error",
|
|
31
|
+
"@angular-eslint/template/no-interpolation-in-attributes": "error",
|
|
32
|
+
"@angular-eslint/template/no-empty-control-flow-blocks": "error",
|
|
33
|
+
"@angular-eslint/template/no-nested-tags": "error",
|
|
34
|
+
"@angular-eslint/template/use-track-by-function": "error",
|
|
35
|
+
"@angular-eslint/template/label-has-associated-control": "error",
|
|
25
36
|
"@angular-eslint/template/attributes-order": [
|
|
26
37
|
"error",
|
|
27
38
|
{
|
|
@@ -48,9 +59,9 @@ var angularTemplate = config([
|
|
|
48
59
|
|
|
49
60
|
// packages/lint-suite/src/lib/angular.ts
|
|
50
61
|
import globals from "globals";
|
|
51
|
-
import { configs as configs2, processInlineTemplates
|
|
52
|
-
import {
|
|
53
|
-
var angular =
|
|
62
|
+
import { configs as configs2, processInlineTemplates } from "angular-eslint";
|
|
63
|
+
import { defineConfig as defineConfig2 } from "eslint/config";
|
|
64
|
+
var angular = defineConfig2([
|
|
54
65
|
{
|
|
55
66
|
files: ["**/*.ts"],
|
|
56
67
|
extends: [...configs2.tsRecommended],
|
|
@@ -62,11 +73,13 @@ var angular = config2([
|
|
|
62
73
|
}
|
|
63
74
|
},
|
|
64
75
|
processor: processInlineTemplates,
|
|
65
|
-
plugins: { "@angular-eslint": tsPlugin },
|
|
66
76
|
rules: {
|
|
67
77
|
"@angular-eslint/prefer-on-push-component-change-detection": "error",
|
|
68
78
|
"@angular-eslint/prefer-signals": "error",
|
|
69
|
-
"@angular-eslint/use-injectable-provided-in": "error"
|
|
79
|
+
"@angular-eslint/use-injectable-provided-in": "error",
|
|
80
|
+
"@angular-eslint/prefer-signal-model": "error",
|
|
81
|
+
"@angular-eslint/no-uncalled-signals": "error",
|
|
82
|
+
"@angular-eslint/prefer-host-metadata-property": "error"
|
|
70
83
|
}
|
|
71
84
|
}
|
|
72
85
|
]);
|
|
@@ -75,8 +88,8 @@ var angular = config2([
|
|
|
75
88
|
import { configs as configs3 } from "@nx/eslint-plugin";
|
|
76
89
|
import stylistic from "@stylistic/eslint-plugin";
|
|
77
90
|
import importPluginX from "eslint-plugin-import-x";
|
|
78
|
-
import {
|
|
79
|
-
var base =
|
|
91
|
+
import { defineConfig as defineConfig3 } from "eslint/config";
|
|
92
|
+
var base = defineConfig3([
|
|
80
93
|
{ extends: [...configs3["flat/base"]] },
|
|
81
94
|
{
|
|
82
95
|
files: [
|
|
@@ -142,7 +155,10 @@ var base = config3([
|
|
|
142
155
|
// Warn if function complexity is high
|
|
143
156
|
"max-depth": ["warn", 4],
|
|
144
157
|
// Warn on deeply nested blocks
|
|
145
|
-
"max-lines-per-function": [
|
|
158
|
+
"max-lines-per-function": [
|
|
159
|
+
"warn",
|
|
160
|
+
{ max: 50, skipBlankLines: true, skipComments: true }
|
|
161
|
+
],
|
|
146
162
|
// Warn on long functions
|
|
147
163
|
"max-params": ["warn", 4],
|
|
148
164
|
// Warn on functions with many parameters
|
|
@@ -259,10 +275,17 @@ var base = config3([
|
|
|
259
275
|
}
|
|
260
276
|
},
|
|
261
277
|
{
|
|
262
|
-
files: [
|
|
278
|
+
files: [
|
|
279
|
+
"**/*.spec.ts",
|
|
280
|
+
"**/*.test.ts",
|
|
281
|
+
"**/*.spec.js",
|
|
282
|
+
"**/*.test.js",
|
|
283
|
+
"**/*.e2e.ts",
|
|
284
|
+
"**/*.e2e.js"
|
|
285
|
+
],
|
|
263
286
|
rules: {
|
|
264
287
|
"max-lines-per-function": "off",
|
|
265
|
-
complexity: ["warn", { max:
|
|
288
|
+
complexity: ["warn", { max: 3 }],
|
|
266
289
|
"max-lines": [
|
|
267
290
|
"error",
|
|
268
291
|
{
|
|
@@ -289,19 +312,18 @@ var base = config3([
|
|
|
289
312
|
|
|
290
313
|
// packages/lint-suite/src/lib/javascript.ts
|
|
291
314
|
import { configs as configs4 } from "@nx/eslint-plugin";
|
|
292
|
-
import {
|
|
293
|
-
var javascript =
|
|
315
|
+
import { defineConfig as defineConfig4 } from "eslint/config";
|
|
316
|
+
var javascript = defineConfig4({
|
|
294
317
|
files: ["**/*.js", "**/*.jsx", "**/*.cjs", "**/*.mjs"],
|
|
295
|
-
extends: [...configs4["flat/javascript"]]
|
|
296
|
-
rules: {}
|
|
318
|
+
extends: [...configs4["flat/javascript"]]
|
|
297
319
|
});
|
|
298
320
|
|
|
299
321
|
// packages/lint-suite/src/lib/jest.ts
|
|
300
322
|
import jestEslint from "eslint-plugin-jest";
|
|
301
|
-
import {
|
|
302
|
-
var jest =
|
|
323
|
+
import { defineConfig as defineConfig5 } from "eslint/config";
|
|
324
|
+
var jest = defineConfig5([
|
|
303
325
|
{
|
|
304
|
-
files: ["**/*.spec.ts", "**/*.
|
|
326
|
+
files: ["**/*.spec.ts", "**/*.spec.js"],
|
|
305
327
|
extends: [jestEslint.configs["flat/all"]],
|
|
306
328
|
rules: {
|
|
307
329
|
"jest/no-done-callback": "off"
|
|
@@ -311,19 +333,18 @@ var jest = config5([
|
|
|
311
333
|
|
|
312
334
|
// packages/lint-suite/src/lib/json.ts
|
|
313
335
|
import jsonEslint from "eslint-plugin-json";
|
|
314
|
-
import {
|
|
315
|
-
var json =
|
|
336
|
+
import { defineConfig as defineConfig6 } from "eslint/config";
|
|
337
|
+
var json = defineConfig6([
|
|
316
338
|
{
|
|
317
339
|
files: ["**/*.json"],
|
|
318
|
-
extends: [jsonEslint.configs.recommended]
|
|
319
|
-
rules: {}
|
|
340
|
+
extends: [jsonEslint.configs.recommended]
|
|
320
341
|
}
|
|
321
342
|
]);
|
|
322
343
|
|
|
323
344
|
// packages/lint-suite/src/lib/rxjs.ts
|
|
324
345
|
import rxjsEslint from "@smarttools/eslint-plugin-rxjs";
|
|
325
|
-
import {
|
|
326
|
-
var rxjs =
|
|
346
|
+
import { defineConfig as defineConfig7 } from "eslint/config";
|
|
347
|
+
var rxjs = defineConfig7([
|
|
327
348
|
{
|
|
328
349
|
files: [
|
|
329
350
|
"**/*.js",
|
|
@@ -392,13 +413,12 @@ var rxjs = config7([
|
|
|
392
413
|
|
|
393
414
|
// packages/lint-suite/src/lib/storybook.ts
|
|
394
415
|
import storybookEslint from "eslint-plugin-storybook";
|
|
395
|
-
import {
|
|
396
|
-
var storybook =
|
|
416
|
+
import { defineConfig as defineConfig8 } from "eslint/config";
|
|
417
|
+
var storybook = defineConfig8([
|
|
397
418
|
{
|
|
398
419
|
ignores: ["!.storybook"],
|
|
399
420
|
files: ["**/*.stories.ts"],
|
|
400
|
-
extends: [storybookEslint.configs["flat/recommended"]]
|
|
401
|
-
rules: {}
|
|
421
|
+
extends: [storybookEslint.configs["flat/recommended"]]
|
|
402
422
|
}
|
|
403
423
|
]);
|
|
404
424
|
|
|
@@ -406,6 +426,7 @@ var storybook = config8([
|
|
|
406
426
|
import { configs as configs5 } from "@nx/eslint-plugin";
|
|
407
427
|
import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
|
|
408
428
|
import importPluginX2 from "eslint-plugin-import-x";
|
|
429
|
+
import { defineConfig as defineConfig9 } from "eslint/config";
|
|
409
430
|
|
|
410
431
|
// packages/lint-suite/src/lib/rules/explicit-accessibility.ts
|
|
411
432
|
import { ESLintUtils, TSESTree } from "@typescript-eslint/utils";
|
|
@@ -442,9 +463,6 @@ var getNodeName = (node) => {
|
|
|
442
463
|
}
|
|
443
464
|
return "<destructured parameter>";
|
|
444
465
|
}
|
|
445
|
-
if (param.type === TSESTree.AST_NODE_TYPES.RestElement && param.argument.type === TSESTree.AST_NODE_TYPES.Identifier) {
|
|
446
|
-
return `...${param.argument.name}`;
|
|
447
|
-
}
|
|
448
466
|
return "<complex parameter>";
|
|
449
467
|
}
|
|
450
468
|
return "<unknown>";
|
|
@@ -544,13 +562,12 @@ var explicit_accessibility_default = createRule({
|
|
|
544
562
|
});
|
|
545
563
|
|
|
546
564
|
// packages/lint-suite/src/lib/typescript.ts
|
|
547
|
-
import { config as config9 } from "typescript-eslint";
|
|
548
565
|
var localTypescriptRules = {
|
|
549
566
|
rules: {
|
|
550
567
|
"explicit-accessibility": explicit_accessibility_default
|
|
551
568
|
}
|
|
552
569
|
};
|
|
553
|
-
var typescript =
|
|
570
|
+
var typescript = defineConfig9([
|
|
554
571
|
// NOTE: Checks for 'prettier' and 'eslint-plugin-prettier'
|
|
555
572
|
{
|
|
556
573
|
files: ["**/*.ts", "**/*.tsx", "**/*.cts", "**/*.mts"],
|
|
@@ -679,6 +696,21 @@ var typescript = config9([
|
|
|
679
696
|
group: "builtin",
|
|
680
697
|
position: "before"
|
|
681
698
|
},
|
|
699
|
+
{
|
|
700
|
+
pattern: "@shared/**",
|
|
701
|
+
group: "internal",
|
|
702
|
+
position: "before"
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
pattern: "@backend/**",
|
|
706
|
+
group: "internal",
|
|
707
|
+
position: "before"
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
pattern: "@frontend/**",
|
|
711
|
+
group: "internal",
|
|
712
|
+
position: "before"
|
|
713
|
+
},
|
|
682
714
|
{
|
|
683
715
|
pattern: "@*/shared/**",
|
|
684
716
|
group: "internal",
|
|
@@ -695,7 +727,7 @@ var typescript = config9([
|
|
|
695
727
|
position: "after"
|
|
696
728
|
}
|
|
697
729
|
],
|
|
698
|
-
pathGroupsExcludedImportTypes: ["
|
|
730
|
+
pathGroupsExcludedImportTypes: ["builtin"],
|
|
699
731
|
"newlines-between": "always",
|
|
700
732
|
alphabetize: { order: "asc", caseInsensitive: true }
|
|
701
733
|
}
|
|
@@ -735,7 +767,14 @@ var typescript = config9([
|
|
|
735
767
|
}
|
|
736
768
|
},
|
|
737
769
|
{
|
|
738
|
-
files: [
|
|
770
|
+
files: [
|
|
771
|
+
"**/*.spec.ts",
|
|
772
|
+
"**/*.test.ts",
|
|
773
|
+
"**/*.spec.js",
|
|
774
|
+
"**/*.test.js",
|
|
775
|
+
"**/*.e2e.ts",
|
|
776
|
+
"**/*.e2e.js"
|
|
777
|
+
],
|
|
739
778
|
rules: {
|
|
740
779
|
"@typescript-eslint/no-empty-function": "off",
|
|
741
780
|
"@typescript-eslint/no-unbound-method": "off",
|
|
@@ -751,6 +790,130 @@ var typescript = config9([
|
|
|
751
790
|
}
|
|
752
791
|
]);
|
|
753
792
|
|
|
793
|
+
// packages/lint-suite/src/lib/vitest.ts
|
|
794
|
+
import vitestEslint from "@vitest/eslint-plugin";
|
|
795
|
+
import { defineConfig as defineConfig10 } from "eslint/config";
|
|
796
|
+
var vitestPlugin = {
|
|
797
|
+
vitest: vitestEslint
|
|
798
|
+
};
|
|
799
|
+
var vitest = defineConfig10([
|
|
800
|
+
{
|
|
801
|
+
files: ["**/*.spec.ts", "**/*.spec.js", "**/*.test.ts", "**/*.test.js"],
|
|
802
|
+
plugins: vitestPlugin,
|
|
803
|
+
rules: {
|
|
804
|
+
...vitestEslint.configs.recommended.rules,
|
|
805
|
+
"vitest/max-nested-describe": ["error", { max: 3 }]
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
]);
|
|
809
|
+
|
|
810
|
+
// packages/lint-suite/src/lib/playwright.ts
|
|
811
|
+
import playwrightEslint from "eslint-plugin-playwright";
|
|
812
|
+
import { defineConfig as defineConfig11 } from "eslint/config";
|
|
813
|
+
var playwright = defineConfig11([
|
|
814
|
+
{
|
|
815
|
+
...playwrightEslint.configs["flat/recommended"],
|
|
816
|
+
files: ["**/*.e2e.ts", "**/*.e2e.js"],
|
|
817
|
+
rules: {
|
|
818
|
+
...playwrightEslint.configs["flat/recommended"].rules
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
]);
|
|
822
|
+
|
|
823
|
+
// packages/lint-suite/src/lib/boundaries.ts
|
|
824
|
+
import boundariesPlugin from "eslint-plugin-boundaries";
|
|
825
|
+
import { defineConfig as defineConfig12 } from "eslint/config";
|
|
826
|
+
var boundaries = defineConfig12([
|
|
827
|
+
{
|
|
828
|
+
files: [
|
|
829
|
+
"**/*.js",
|
|
830
|
+
"**/*.jsx",
|
|
831
|
+
"**/*.ts",
|
|
832
|
+
"**/*.tsx",
|
|
833
|
+
"**/*.cts",
|
|
834
|
+
"**/*.mts"
|
|
835
|
+
],
|
|
836
|
+
plugins: {
|
|
837
|
+
boundaries: boundariesPlugin
|
|
838
|
+
},
|
|
839
|
+
settings: {
|
|
840
|
+
"boundaries/elements": [
|
|
841
|
+
{
|
|
842
|
+
type: "feature",
|
|
843
|
+
pattern: "**/feature/**"
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
type: "data-access",
|
|
847
|
+
pattern: "**/data-access/**"
|
|
848
|
+
},
|
|
849
|
+
{
|
|
850
|
+
type: "domain-logic",
|
|
851
|
+
pattern: "**/domain-logic/**"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
type: "ui",
|
|
855
|
+
pattern: "**/ui/**"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
type: "common",
|
|
859
|
+
pattern: "**/common/**"
|
|
860
|
+
},
|
|
861
|
+
{
|
|
862
|
+
type: "utils",
|
|
863
|
+
pattern: "**/utils/**"
|
|
864
|
+
}
|
|
865
|
+
],
|
|
866
|
+
"import/resolver": {
|
|
867
|
+
typescript: {
|
|
868
|
+
alwaysTryTypes: true
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
},
|
|
872
|
+
rules: {
|
|
873
|
+
...boundariesPlugin.configs.recommended.rules,
|
|
874
|
+
"boundaries/element-types": [
|
|
875
|
+
"error",
|
|
876
|
+
{
|
|
877
|
+
default: "disallow",
|
|
878
|
+
message: "${dependency.type} is not allowed to be imported in ${file.type}",
|
|
879
|
+
rules: [
|
|
880
|
+
{
|
|
881
|
+
from: "feature",
|
|
882
|
+
allow: ["feature", "ui", "domain-logic", "utils", "common"]
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
from: "domain-logic",
|
|
886
|
+
allow: ["domain-logic", "data-access", "utils", "common"]
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
from: "data-access",
|
|
890
|
+
allow: ["data-access", "utils", "common"]
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
from: "ui",
|
|
894
|
+
allow: ["ui", "utils", "common"]
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
from: "utils",
|
|
898
|
+
allow: ["utils", "common"]
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
from: "common",
|
|
902
|
+
allow: ["common"]
|
|
903
|
+
}
|
|
904
|
+
]
|
|
905
|
+
}
|
|
906
|
+
]
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
files: ["**/*.stories.ts"],
|
|
911
|
+
rules: {
|
|
912
|
+
"boundaries/element-types": "off"
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
]);
|
|
916
|
+
|
|
754
917
|
// packages/lint-suite/src/index.ts
|
|
755
918
|
var recommended = [
|
|
756
919
|
...base,
|
|
@@ -761,18 +924,24 @@ var recommended = [
|
|
|
761
924
|
...rxjs,
|
|
762
925
|
...jest,
|
|
763
926
|
...json,
|
|
764
|
-
...
|
|
927
|
+
...boundaries,
|
|
928
|
+
...storybook,
|
|
929
|
+
...vitest,
|
|
930
|
+
...playwright
|
|
765
931
|
];
|
|
766
932
|
export {
|
|
767
933
|
angular,
|
|
768
934
|
angularTemplate,
|
|
769
935
|
base,
|
|
936
|
+
boundaries,
|
|
770
937
|
javascript,
|
|
771
938
|
jest,
|
|
772
939
|
json,
|
|
940
|
+
playwright,
|
|
773
941
|
recommended,
|
|
774
942
|
rxjs,
|
|
775
943
|
storybook,
|
|
776
|
-
typescript
|
|
944
|
+
typescript,
|
|
945
|
+
vitest
|
|
777
946
|
};
|
|
778
947
|
//# sourceMappingURL=index.js.map
|