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 CHANGED
@@ -5,7 +5,7 @@ A comprehensive collection of ESLint Flat configurations for modern web applicat
5
5
  ## Features
6
6
 
7
7
  - **TypeScript Linting**: Strict typing rules, consistent imports, and code organization
8
- - **Angular Support**: Component best practices and template accessibility rules
8
+ - **Angular Support**: Component best practices (including Signals), template accessibility rules, and modern control flow
9
9
  - **RxJS Guidelines**: Observable patterns, Finnish notation, and operator safety
10
10
  - **Code Style**: Formatting rules, line limits, and structural consistency
11
11
  - **Accessibility**: ARIA validation, keyboard events, and semantic HTML
@@ -51,6 +51,7 @@ You can selectively include configurations you need.
51
51
  - `jest`: Testing configurations
52
52
  - `json`: JSON file linting
53
53
  - `storybook`: Storybook support
54
+ - `boundaries`: Enforce module boundaries (feature, data-access, ui, etc.)
54
55
 
55
56
  ## Customization
56
57
 
package/index.cjs CHANGED
@@ -33,23 +33,29 @@ __export(index_exports, {
33
33
  angular: () => angular,
34
34
  angularTemplate: () => angularTemplate,
35
35
  base: () => base,
36
+ boundaries: () => boundaries,
36
37
  javascript: () => javascript,
37
38
  jest: () => jest,
38
39
  json: () => json,
40
+ playwright: () => playwright,
39
41
  recommended: () => recommended,
40
42
  rxjs: () => rxjs,
41
43
  storybook: () => storybook,
42
- typescript: () => typescript
44
+ typescript: () => typescript,
45
+ vitest: () => vitest
43
46
  });
44
47
  module.exports = __toCommonJS(index_exports);
45
48
 
46
49
  // packages/lint-suite/src/lib/angular-template.ts
47
50
  var import_angular_eslint = require("angular-eslint");
48
- var import_typescript_eslint = require("typescript-eslint");
49
- var angularTemplate = (0, import_typescript_eslint.config)([
51
+ var import_config = require("eslint/config");
52
+ var angularTemplate = (0, import_config.defineConfig)([
50
53
  {
51
54
  files: ["**/*.html"],
52
- extends: [...import_angular_eslint.configs.templateAccessibility, ...import_angular_eslint.configs.templateRecommended],
55
+ extends: [
56
+ ...import_angular_eslint.configs.templateAccessibility,
57
+ ...import_angular_eslint.configs.templateRecommended
58
+ ],
53
59
  rules: {
54
60
  "@angular-eslint/template/prefer-template-literal": "error",
55
61
  "@angular-eslint/template/no-any": "error",
@@ -67,6 +73,14 @@ var angularTemplate = (0, import_typescript_eslint.config)([
67
73
  "@angular-eslint/template/prefer-control-flow": "error",
68
74
  "@angular-eslint/template/prefer-self-closing-tags": "error",
69
75
  "@angular-eslint/template/prefer-ngsrc": "error",
76
+ "@angular-eslint/template/prefer-empty-for": "error",
77
+ "@angular-eslint/template/prefer-built-in-pipes": "error",
78
+ "@angular-eslint/template/no-call-expression": "error",
79
+ "@angular-eslint/template/no-interpolation-in-attributes": "error",
80
+ "@angular-eslint/template/no-empty-control-flow-blocks": "error",
81
+ "@angular-eslint/template/no-nested-tags": "error",
82
+ "@angular-eslint/template/use-track-by-function": "error",
83
+ "@angular-eslint/template/label-has-associated-control": "error",
70
84
  "@angular-eslint/template/attributes-order": [
71
85
  "error",
72
86
  {
@@ -94,8 +108,8 @@ var angularTemplate = (0, import_typescript_eslint.config)([
94
108
  // packages/lint-suite/src/lib/angular.ts
95
109
  var import_globals = __toESM(require("globals"), 1);
96
110
  var import_angular_eslint2 = require("angular-eslint");
97
- var import_typescript_eslint2 = require("typescript-eslint");
98
- var angular = (0, import_typescript_eslint2.config)([
111
+ var import_config2 = require("eslint/config");
112
+ var angular = (0, import_config2.defineConfig)([
99
113
  {
100
114
  files: ["**/*.ts"],
101
115
  extends: [...import_angular_eslint2.configs.tsRecommended],
@@ -107,11 +121,13 @@ var angular = (0, import_typescript_eslint2.config)([
107
121
  }
108
122
  },
109
123
  processor: import_angular_eslint2.processInlineTemplates,
110
- plugins: { "@angular-eslint": import_angular_eslint2.tsPlugin },
111
124
  rules: {
112
125
  "@angular-eslint/prefer-on-push-component-change-detection": "error",
113
126
  "@angular-eslint/prefer-signals": "error",
114
- "@angular-eslint/use-injectable-provided-in": "error"
127
+ "@angular-eslint/use-injectable-provided-in": "error",
128
+ "@angular-eslint/prefer-signal-model": "error",
129
+ "@angular-eslint/no-uncalled-signals": "error",
130
+ "@angular-eslint/prefer-host-metadata-property": "error"
115
131
  }
116
132
  }
117
133
  ]);
@@ -120,8 +136,8 @@ var angular = (0, import_typescript_eslint2.config)([
120
136
  var import_eslint_plugin = require("@nx/eslint-plugin");
121
137
  var import_eslint_plugin2 = __toESM(require("@stylistic/eslint-plugin"), 1);
122
138
  var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
123
- var import_typescript_eslint3 = require("typescript-eslint");
124
- var base = (0, import_typescript_eslint3.config)([
139
+ var import_config3 = require("eslint/config");
140
+ var base = (0, import_config3.defineConfig)([
125
141
  { extends: [...import_eslint_plugin.configs["flat/base"]] },
126
142
  {
127
143
  files: [
@@ -187,7 +203,10 @@ var base = (0, import_typescript_eslint3.config)([
187
203
  // Warn if function complexity is high
188
204
  "max-depth": ["warn", 4],
189
205
  // Warn on deeply nested blocks
190
- "max-lines-per-function": ["warn", 50],
206
+ "max-lines-per-function": [
207
+ "warn",
208
+ { max: 50, skipBlankLines: true, skipComments: true }
209
+ ],
191
210
  // Warn on long functions
192
211
  "max-params": ["warn", 4],
193
212
  // Warn on functions with many parameters
@@ -304,10 +323,17 @@ var base = (0, import_typescript_eslint3.config)([
304
323
  }
305
324
  },
306
325
  {
307
- files: ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.js", "**/*.test.js"],
326
+ files: [
327
+ "**/*.spec.ts",
328
+ "**/*.test.ts",
329
+ "**/*.spec.js",
330
+ "**/*.test.js",
331
+ "**/*.e2e.ts",
332
+ "**/*.e2e.js"
333
+ ],
308
334
  rules: {
309
335
  "max-lines-per-function": "off",
310
- complexity: ["warn", { max: 1 }],
336
+ complexity: ["warn", { max: 3 }],
311
337
  "max-lines": [
312
338
  "error",
313
339
  {
@@ -334,19 +360,18 @@ var base = (0, import_typescript_eslint3.config)([
334
360
 
335
361
  // packages/lint-suite/src/lib/javascript.ts
336
362
  var import_eslint_plugin3 = require("@nx/eslint-plugin");
337
- var import_typescript_eslint4 = require("typescript-eslint");
338
- var javascript = (0, import_typescript_eslint4.config)({
363
+ var import_config4 = require("eslint/config");
364
+ var javascript = (0, import_config4.defineConfig)({
339
365
  files: ["**/*.js", "**/*.jsx", "**/*.cjs", "**/*.mjs"],
340
- extends: [...import_eslint_plugin3.configs["flat/javascript"]],
341
- rules: {}
366
+ extends: [...import_eslint_plugin3.configs["flat/javascript"]]
342
367
  });
343
368
 
344
369
  // packages/lint-suite/src/lib/jest.ts
345
370
  var import_eslint_plugin_jest = __toESM(require("eslint-plugin-jest"), 1);
346
- var import_typescript_eslint5 = require("typescript-eslint");
347
- var jest = (0, import_typescript_eslint5.config)([
371
+ var import_config5 = require("eslint/config");
372
+ var jest = (0, import_config5.defineConfig)([
348
373
  {
349
- files: ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.js", "**/*.test.js"],
374
+ files: ["**/*.spec.ts", "**/*.spec.js"],
350
375
  extends: [import_eslint_plugin_jest.default.configs["flat/all"]],
351
376
  rules: {
352
377
  "jest/no-done-callback": "off"
@@ -356,19 +381,18 @@ var jest = (0, import_typescript_eslint5.config)([
356
381
 
357
382
  // packages/lint-suite/src/lib/json.ts
358
383
  var import_eslint_plugin_json = __toESM(require("eslint-plugin-json"), 1);
359
- var import_typescript_eslint6 = require("typescript-eslint");
360
- var json = (0, import_typescript_eslint6.config)([
384
+ var import_config6 = require("eslint/config");
385
+ var json = (0, import_config6.defineConfig)([
361
386
  {
362
387
  files: ["**/*.json"],
363
- extends: [import_eslint_plugin_json.default.configs.recommended],
364
- rules: {}
388
+ extends: [import_eslint_plugin_json.default.configs.recommended]
365
389
  }
366
390
  ]);
367
391
 
368
392
  // packages/lint-suite/src/lib/rxjs.ts
369
393
  var import_eslint_plugin_rxjs = __toESM(require("@smarttools/eslint-plugin-rxjs"), 1);
370
- var import_typescript_eslint7 = require("typescript-eslint");
371
- var rxjs = (0, import_typescript_eslint7.config)([
394
+ var import_config7 = require("eslint/config");
395
+ var rxjs = (0, import_config7.defineConfig)([
372
396
  {
373
397
  files: [
374
398
  "**/*.js",
@@ -437,13 +461,12 @@ var rxjs = (0, import_typescript_eslint7.config)([
437
461
 
438
462
  // packages/lint-suite/src/lib/storybook.ts
439
463
  var import_eslint_plugin_storybook = __toESM(require("eslint-plugin-storybook"), 1);
440
- var import_typescript_eslint8 = require("typescript-eslint");
441
- var storybook = (0, import_typescript_eslint8.config)([
464
+ var import_config8 = require("eslint/config");
465
+ var storybook = (0, import_config8.defineConfig)([
442
466
  {
443
467
  ignores: ["!.storybook"],
444
468
  files: ["**/*.stories.ts"],
445
- extends: [import_eslint_plugin_storybook.default.configs["flat/recommended"]],
446
- rules: {}
469
+ extends: [import_eslint_plugin_storybook.default.configs["flat/recommended"]]
447
470
  }
448
471
  ]);
449
472
 
@@ -451,6 +474,7 @@ var storybook = (0, import_typescript_eslint8.config)([
451
474
  var import_eslint_plugin4 = require("@nx/eslint-plugin");
452
475
  var import_eslint_import_resolver_typescript = require("eslint-import-resolver-typescript");
453
476
  var import_eslint_plugin_import_x2 = __toESM(require("eslint-plugin-import-x"), 1);
477
+ var import_config9 = require("eslint/config");
454
478
 
455
479
  // packages/lint-suite/src/lib/rules/explicit-accessibility.ts
456
480
  var import_utils = require("@typescript-eslint/utils");
@@ -487,9 +511,6 @@ var getNodeName = (node) => {
487
511
  }
488
512
  return "<destructured parameter>";
489
513
  }
490
- if (param.type === import_utils.TSESTree.AST_NODE_TYPES.RestElement && param.argument.type === import_utils.TSESTree.AST_NODE_TYPES.Identifier) {
491
- return `...${param.argument.name}`;
492
- }
493
514
  return "<complex parameter>";
494
515
  }
495
516
  return "<unknown>";
@@ -589,13 +610,12 @@ var explicit_accessibility_default = createRule({
589
610
  });
590
611
 
591
612
  // packages/lint-suite/src/lib/typescript.ts
592
- var import_typescript_eslint9 = require("typescript-eslint");
593
613
  var localTypescriptRules = {
594
614
  rules: {
595
615
  "explicit-accessibility": explicit_accessibility_default
596
616
  }
597
617
  };
598
- var typescript = (0, import_typescript_eslint9.config)([
618
+ var typescript = (0, import_config9.defineConfig)([
599
619
  // NOTE: Checks for 'prettier' and 'eslint-plugin-prettier'
600
620
  {
601
621
  files: ["**/*.ts", "**/*.tsx", "**/*.cts", "**/*.mts"],
@@ -724,6 +744,21 @@ var typescript = (0, import_typescript_eslint9.config)([
724
744
  group: "builtin",
725
745
  position: "before"
726
746
  },
747
+ {
748
+ pattern: "@shared/**",
749
+ group: "internal",
750
+ position: "before"
751
+ },
752
+ {
753
+ pattern: "@backend/**",
754
+ group: "internal",
755
+ position: "before"
756
+ },
757
+ {
758
+ pattern: "@frontend/**",
759
+ group: "internal",
760
+ position: "before"
761
+ },
727
762
  {
728
763
  pattern: "@*/shared/**",
729
764
  group: "internal",
@@ -740,7 +775,7 @@ var typescript = (0, import_typescript_eslint9.config)([
740
775
  position: "after"
741
776
  }
742
777
  ],
743
- pathGroupsExcludedImportTypes: ["@angular/**", "@nestjs/**"],
778
+ pathGroupsExcludedImportTypes: ["builtin"],
744
779
  "newlines-between": "always",
745
780
  alphabetize: { order: "asc", caseInsensitive: true }
746
781
  }
@@ -780,7 +815,14 @@ var typescript = (0, import_typescript_eslint9.config)([
780
815
  }
781
816
  },
782
817
  {
783
- files: ["**/*.spec.ts", "**/*.test.ts", "**/*.spec.js", "**/*.test.js"],
818
+ files: [
819
+ "**/*.spec.ts",
820
+ "**/*.test.ts",
821
+ "**/*.spec.js",
822
+ "**/*.test.js",
823
+ "**/*.e2e.ts",
824
+ "**/*.e2e.js"
825
+ ],
784
826
  rules: {
785
827
  "@typescript-eslint/no-empty-function": "off",
786
828
  "@typescript-eslint/no-unbound-method": "off",
@@ -796,6 +838,130 @@ var typescript = (0, import_typescript_eslint9.config)([
796
838
  }
797
839
  ]);
798
840
 
841
+ // packages/lint-suite/src/lib/vitest.ts
842
+ var import_eslint_plugin5 = __toESM(require("@vitest/eslint-plugin"), 1);
843
+ var import_config10 = require("eslint/config");
844
+ var vitestPlugin = {
845
+ vitest: import_eslint_plugin5.default
846
+ };
847
+ var vitest = (0, import_config10.defineConfig)([
848
+ {
849
+ files: ["**/*.spec.ts", "**/*.spec.js", "**/*.test.ts", "**/*.test.js"],
850
+ plugins: vitestPlugin,
851
+ rules: {
852
+ ...import_eslint_plugin5.default.configs.recommended.rules,
853
+ "vitest/max-nested-describe": ["error", { max: 3 }]
854
+ }
855
+ }
856
+ ]);
857
+
858
+ // packages/lint-suite/src/lib/playwright.ts
859
+ var import_eslint_plugin_playwright = __toESM(require("eslint-plugin-playwright"), 1);
860
+ var import_config11 = require("eslint/config");
861
+ var playwright = (0, import_config11.defineConfig)([
862
+ {
863
+ ...import_eslint_plugin_playwright.default.configs["flat/recommended"],
864
+ files: ["**/*.e2e.ts", "**/*.e2e.js"],
865
+ rules: {
866
+ ...import_eslint_plugin_playwright.default.configs["flat/recommended"].rules
867
+ }
868
+ }
869
+ ]);
870
+
871
+ // packages/lint-suite/src/lib/boundaries.ts
872
+ var import_eslint_plugin_boundaries = __toESM(require("eslint-plugin-boundaries"), 1);
873
+ var import_config12 = require("eslint/config");
874
+ var boundaries = (0, import_config12.defineConfig)([
875
+ {
876
+ files: [
877
+ "**/*.js",
878
+ "**/*.jsx",
879
+ "**/*.ts",
880
+ "**/*.tsx",
881
+ "**/*.cts",
882
+ "**/*.mts"
883
+ ],
884
+ plugins: {
885
+ boundaries: import_eslint_plugin_boundaries.default
886
+ },
887
+ settings: {
888
+ "boundaries/elements": [
889
+ {
890
+ type: "feature",
891
+ pattern: "**/feature/**"
892
+ },
893
+ {
894
+ type: "data-access",
895
+ pattern: "**/data-access/**"
896
+ },
897
+ {
898
+ type: "domain-logic",
899
+ pattern: "**/domain-logic/**"
900
+ },
901
+ {
902
+ type: "ui",
903
+ pattern: "**/ui/**"
904
+ },
905
+ {
906
+ type: "common",
907
+ pattern: "**/common/**"
908
+ },
909
+ {
910
+ type: "utils",
911
+ pattern: "**/utils/**"
912
+ }
913
+ ],
914
+ "import/resolver": {
915
+ typescript: {
916
+ alwaysTryTypes: true
917
+ }
918
+ }
919
+ },
920
+ rules: {
921
+ ...import_eslint_plugin_boundaries.default.configs.recommended.rules,
922
+ "boundaries/element-types": [
923
+ "error",
924
+ {
925
+ default: "disallow",
926
+ message: "${dependency.type} is not allowed to be imported in ${file.type}",
927
+ rules: [
928
+ {
929
+ from: "feature",
930
+ allow: ["feature", "ui", "domain-logic", "utils", "common"]
931
+ },
932
+ {
933
+ from: "domain-logic",
934
+ allow: ["domain-logic", "data-access", "utils", "common"]
935
+ },
936
+ {
937
+ from: "data-access",
938
+ allow: ["data-access", "utils", "common"]
939
+ },
940
+ {
941
+ from: "ui",
942
+ allow: ["ui", "utils", "common"]
943
+ },
944
+ {
945
+ from: "utils",
946
+ allow: ["utils", "common"]
947
+ },
948
+ {
949
+ from: "common",
950
+ allow: ["common"]
951
+ }
952
+ ]
953
+ }
954
+ ]
955
+ }
956
+ },
957
+ {
958
+ files: ["**/*.stories.ts"],
959
+ rules: {
960
+ "boundaries/element-types": "off"
961
+ }
962
+ }
963
+ ]);
964
+
799
965
  // packages/lint-suite/src/index.ts
800
966
  var recommended = [
801
967
  ...base,
@@ -806,19 +972,25 @@ var recommended = [
806
972
  ...rxjs,
807
973
  ...jest,
808
974
  ...json,
809
- ...storybook
975
+ ...boundaries,
976
+ ...storybook,
977
+ ...vitest,
978
+ ...playwright
810
979
  ];
811
980
  // Annotate the CommonJS export names for ESM import in node:
812
981
  0 && (module.exports = {
813
982
  angular,
814
983
  angularTemplate,
815
984
  base,
985
+ boundaries,
816
986
  javascript,
817
987
  jest,
818
988
  json,
989
+ playwright,
819
990
  recommended,
820
991
  rxjs,
821
992
  storybook,
822
- typescript
993
+ typescript,
994
+ vitest
823
995
  });
824
996
  //# sourceMappingURL=index.cjs.map