@abinnovision/eslint-config-base 3.2.0-beta.2 → 3.2.0-beta.4

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/dist/index.cjs CHANGED
@@ -33,7 +33,8 @@ __export(src_exports, {
33
33
  base: () => config,
34
34
  configFiles: () => config2,
35
35
  nestjs: () => config3,
36
- vitest: () => config4
36
+ stylistic: () => config4,
37
+ vitest: () => config5
37
38
  });
38
39
  module.exports = __toCommonJS(src_exports);
39
40
 
@@ -234,6 +235,54 @@ var config = (0, import_config.defineConfig)([
234
235
  * @see https://eslint.org/docs/latest/rules/prefer-spread
235
236
  */
236
237
  "prefer-spread": "error",
238
+ /**
239
+ * Disallow returning a value from a Promise executor.
240
+ *
241
+ * @see https://eslint.org/docs/latest/rules/no-promise-executor-return
242
+ */
243
+ "no-promise-executor-return": "error",
244
+ /**
245
+ * Disallow template literal placeholder syntax in regular strings.
246
+ *
247
+ * @see https://eslint.org/docs/latest/rules/no-template-curly-in-string
248
+ */
249
+ "no-template-curly-in-string": "error",
250
+ /**
251
+ * Disallow unmodified conditions of loops.
252
+ *
253
+ * @see https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
254
+ */
255
+ "no-unmodified-loop-condition": "error",
256
+ /**
257
+ * Disallow unnecessary nested blocks.
258
+ *
259
+ * @see https://eslint.org/docs/latest/rules/no-lone-blocks
260
+ */
261
+ "no-lone-blocks": "error",
262
+ /**
263
+ * Disallow renaming import, export, and destructured assignments to the same name.
264
+ *
265
+ * @see https://eslint.org/docs/latest/rules/no-useless-rename
266
+ */
267
+ "no-useless-rename": "error",
268
+ /**
269
+ * Disallow unnecessary computed property keys in objects and classes.
270
+ *
271
+ * @see https://eslint.org/docs/latest/rules/no-useless-computed-key
272
+ */
273
+ "no-useless-computed-key": "error",
274
+ /**
275
+ * Disallow await inside of loops.
276
+ *
277
+ * @see https://eslint.org/docs/latest/rules/no-await-in-loop
278
+ */
279
+ "no-await-in-loop": "warn",
280
+ /**
281
+ * Disallow reassigning function parameters.
282
+ *
283
+ * @see https://eslint.org/docs/latest/rules/no-param-reassign
284
+ */
285
+ "no-param-reassign": "error",
237
286
  /**
238
287
  * Custom JS Rules: Code Quality & Complexity
239
288
  */
@@ -660,10 +709,109 @@ var config3 = (0, import_config3.defineConfig)([
660
709
  }
661
710
  ]);
662
711
 
663
- // src/configs/flavour-vitest.ts
664
- var import_eslint_plugin = __toESM(require("@vitest/eslint-plugin"), 1);
712
+ // src/configs/flavour-stylistic.ts
713
+ var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
665
714
  var import_config4 = require("eslint/config");
666
715
  var config4 = (0, import_config4.defineConfig)([
716
+ {
717
+ files: ["**/*.{ts,tsx,js,jsx}"],
718
+ plugins: {
719
+ "@stylistic": import_eslint_plugin.default
720
+ },
721
+ rules: {
722
+ /**
723
+ * Enforce block comments to use starred-block style (multiline).
724
+ * Prevents inline block comments like: /** foo *​/
725
+ *
726
+ * @see https://eslint.style/rules/default/multiline-comment-style
727
+ */
728
+ "@stylistic/multiline-comment-style": ["error", "starred-block"],
729
+ /**
730
+ * Enforce consistent spacing after // or /* delimiters.
731
+ *
732
+ * @see https://eslint.style/rules/default/spaced-comment
733
+ */
734
+ "@stylistic/spaced-comment": ["error", "always"],
735
+ /**
736
+ * Require a blank line before block and line comments.
737
+ * Comments belong to the following code block, so only enforce
738
+ * before, not after. Allows comments at the start of blocks,
739
+ * objects, arrays, and classes without a preceding blank line.
740
+ *
741
+ * @see https://eslint.style/rules/default/lines-around-comment
742
+ */
743
+ "@stylistic/lines-around-comment": [
744
+ "error",
745
+ {
746
+ beforeBlockComment: true,
747
+ beforeLineComment: true,
748
+ allowBlockStart: true,
749
+ allowObjectStart: true,
750
+ allowArrayStart: true,
751
+ allowClassStart: true
752
+ }
753
+ ],
754
+ /**
755
+ * Enforce line comments to be placed above the code line.
756
+ *
757
+ * @see https://eslint.style/rules/default/line-comment-position
758
+ */
759
+ "@stylistic/line-comment-position": ["error", "above"],
760
+ /**
761
+ * Require blank lines between specific statement types.
762
+ * - After block-like statements (if, for, while, try, switch).
763
+ * - Before return statements.
764
+ * - After directives ("use strict", etc.).
765
+ *
766
+ * @see https://eslint.style/rules/default/padding-line-between-statements
767
+ */
768
+ "@stylistic/padding-line-between-statements": [
769
+ "error",
770
+ { blankLine: "always", prev: "block-like", next: "*" },
771
+ { blankLine: "always", prev: "*", next: "return" },
772
+ { blankLine: "always", prev: "directive", next: "*" }
773
+ ],
774
+ /**
775
+ * Disallow padding inside blocks.
776
+ * No empty lines right after { or before }.
777
+ *
778
+ * @see https://eslint.style/rules/default/padded-blocks
779
+ */
780
+ "@stylistic/padded-blocks": ["error", "never"],
781
+ /**
782
+ * Require blank lines between class members.
783
+ * Except after single-line members and TypeScript overloads
784
+ * to keep compact field declarations readable.
785
+ *
786
+ * @see https://eslint.style/rules/default/lines-between-class-members
787
+ */
788
+ "@stylistic/lines-between-class-members": [
789
+ "error",
790
+ "always",
791
+ {
792
+ exceptAfterSingleLine: true,
793
+ exceptAfterOverload: true
794
+ }
795
+ ],
796
+ /**
797
+ * Limit consecutive empty lines.
798
+ * Prettier already collapses multiple blank lines within code,
799
+ * but this additionally prevents blank lines at the start of files.
800
+ *
801
+ * @see https://eslint.style/rules/default/no-multiple-empty-lines
802
+ */
803
+ "@stylistic/no-multiple-empty-lines": [
804
+ "error",
805
+ { max: 1, maxBOF: 0, maxEOF: 0 }
806
+ ]
807
+ }
808
+ }
809
+ ]);
810
+
811
+ // src/configs/flavour-vitest.ts
812
+ var import_eslint_plugin2 = __toESM(require("@vitest/eslint-plugin"), 1);
813
+ var import_config5 = require("eslint/config");
814
+ var config5 = (0, import_config5.defineConfig)([
667
815
  {
668
816
  files: [
669
817
  "**/*.test.{ts,tsx,js,jsx}",
@@ -671,11 +819,11 @@ var config4 = (0, import_config4.defineConfig)([
671
819
  "**/__tests__/**/*.{ts,tsx,js,jsx}"
672
820
  ],
673
821
  plugins: {
674
- vitest: import_eslint_plugin.default
822
+ vitest: import_eslint_plugin2.default
675
823
  },
676
824
  languageOptions: {
677
825
  globals: {
678
- ...import_eslint_plugin.default.environments.env.globals
826
+ ...import_eslint_plugin2.default.environments.env.globals
679
827
  }
680
828
  },
681
829
  settings: {
@@ -687,7 +835,7 @@ var config4 = (0, import_config4.defineConfig)([
687
835
  /**
688
836
  * Enable Vitest recommended rules.
689
837
  */
690
- ...import_eslint_plugin.default.configs.recommended.rules,
838
+ ...import_eslint_plugin2.default.configs.recommended.rules,
691
839
  /**
692
840
  * Enforce a maximum number of parameters in function definitions.
693
841
  * Increased to 5 for test setup functions that receive fixtures and mocks.
@@ -882,5 +1030,6 @@ var config4 = (0, import_config4.defineConfig)([
882
1030
  base,
883
1031
  configFiles,
884
1032
  nestjs,
1033
+ stylistic,
885
1034
  vitest
886
1035
  });
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import * as eslint_config from 'eslint/config';
3
3
  /**
4
4
  * Base ESLint Configuration
5
5
  */
6
- declare const config$3: eslint_config.Config[];
6
+ declare const config$4: eslint_config.Config[];
7
7
 
8
8
  /**
9
9
  * ESLint configuration for build tool and project configuration files.
@@ -24,7 +24,7 @@ declare const config$3: eslint_config.Config[];
24
24
  * ];
25
25
  * ```
26
26
  */
27
- declare const config$2: eslint_config.Config[];
27
+ declare const config$3: eslint_config.Config[];
28
28
 
29
29
  /**
30
30
  * ESLint configuration tailored for NestJS projects.
@@ -33,6 +33,16 @@ declare const config$2: eslint_config.Config[];
33
33
  * NOTE: This configuration is meant to be used in conjunction with
34
34
  * the base TypeScript ESLint configuration.
35
35
  */
36
+ declare const config$2: eslint_config.Config[];
37
+
38
+ /**
39
+ * ESLint configuration for optional stylistic rules.
40
+ * Enforces consistent code style for comments, spacing, and padding
41
+ * that Prettier does not handle.
42
+ *
43
+ * NOTE: This configuration is meant to be used in conjunction with
44
+ * the base TypeScript ESLint configuration.
45
+ */
36
46
  declare const config$1: eslint_config.Config[];
37
47
 
38
48
  /**
@@ -45,4 +55,4 @@ declare const config$1: eslint_config.Config[];
45
55
  */
46
56
  declare const config: eslint_config.Config[];
47
57
 
48
- export { config$3 as base, config$2 as configFiles, config$1 as nestjs, config as vitest };
58
+ export { config$4 as base, config$3 as configFiles, config$2 as nestjs, config$1 as stylistic, config as vitest };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import * as eslint_config from 'eslint/config';
3
3
  /**
4
4
  * Base ESLint Configuration
5
5
  */
6
- declare const config$3: eslint_config.Config[];
6
+ declare const config$4: eslint_config.Config[];
7
7
 
8
8
  /**
9
9
  * ESLint configuration for build tool and project configuration files.
@@ -24,7 +24,7 @@ declare const config$3: eslint_config.Config[];
24
24
  * ];
25
25
  * ```
26
26
  */
27
- declare const config$2: eslint_config.Config[];
27
+ declare const config$3: eslint_config.Config[];
28
28
 
29
29
  /**
30
30
  * ESLint configuration tailored for NestJS projects.
@@ -33,6 +33,16 @@ declare const config$2: eslint_config.Config[];
33
33
  * NOTE: This configuration is meant to be used in conjunction with
34
34
  * the base TypeScript ESLint configuration.
35
35
  */
36
+ declare const config$2: eslint_config.Config[];
37
+
38
+ /**
39
+ * ESLint configuration for optional stylistic rules.
40
+ * Enforces consistent code style for comments, spacing, and padding
41
+ * that Prettier does not handle.
42
+ *
43
+ * NOTE: This configuration is meant to be used in conjunction with
44
+ * the base TypeScript ESLint configuration.
45
+ */
36
46
  declare const config$1: eslint_config.Config[];
37
47
 
38
48
  /**
@@ -45,4 +55,4 @@ declare const config$1: eslint_config.Config[];
45
55
  */
46
56
  declare const config: eslint_config.Config[];
47
57
 
48
- export { config$3 as base, config$2 as configFiles, config$1 as nestjs, config as vitest };
58
+ export { config$4 as base, config$3 as configFiles, config$2 as nestjs, config$1 as stylistic, config as vitest };
package/dist/index.js CHANGED
@@ -195,6 +195,54 @@ var config = defineConfig([
195
195
  * @see https://eslint.org/docs/latest/rules/prefer-spread
196
196
  */
197
197
  "prefer-spread": "error",
198
+ /**
199
+ * Disallow returning a value from a Promise executor.
200
+ *
201
+ * @see https://eslint.org/docs/latest/rules/no-promise-executor-return
202
+ */
203
+ "no-promise-executor-return": "error",
204
+ /**
205
+ * Disallow template literal placeholder syntax in regular strings.
206
+ *
207
+ * @see https://eslint.org/docs/latest/rules/no-template-curly-in-string
208
+ */
209
+ "no-template-curly-in-string": "error",
210
+ /**
211
+ * Disallow unmodified conditions of loops.
212
+ *
213
+ * @see https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
214
+ */
215
+ "no-unmodified-loop-condition": "error",
216
+ /**
217
+ * Disallow unnecessary nested blocks.
218
+ *
219
+ * @see https://eslint.org/docs/latest/rules/no-lone-blocks
220
+ */
221
+ "no-lone-blocks": "error",
222
+ /**
223
+ * Disallow renaming import, export, and destructured assignments to the same name.
224
+ *
225
+ * @see https://eslint.org/docs/latest/rules/no-useless-rename
226
+ */
227
+ "no-useless-rename": "error",
228
+ /**
229
+ * Disallow unnecessary computed property keys in objects and classes.
230
+ *
231
+ * @see https://eslint.org/docs/latest/rules/no-useless-computed-key
232
+ */
233
+ "no-useless-computed-key": "error",
234
+ /**
235
+ * Disallow await inside of loops.
236
+ *
237
+ * @see https://eslint.org/docs/latest/rules/no-await-in-loop
238
+ */
239
+ "no-await-in-loop": "warn",
240
+ /**
241
+ * Disallow reassigning function parameters.
242
+ *
243
+ * @see https://eslint.org/docs/latest/rules/no-param-reassign
244
+ */
245
+ "no-param-reassign": "error",
198
246
  /**
199
247
  * Custom JS Rules: Code Quality & Complexity
200
248
  */
@@ -621,10 +669,109 @@ var config3 = defineConfig3([
621
669
  }
622
670
  ]);
623
671
 
624
- // src/configs/flavour-vitest.ts
625
- import vitest from "@vitest/eslint-plugin";
672
+ // src/configs/flavour-stylistic.ts
673
+ import stylistic from "@stylistic/eslint-plugin";
626
674
  import { defineConfig as defineConfig4 } from "eslint/config";
627
675
  var config4 = defineConfig4([
676
+ {
677
+ files: ["**/*.{ts,tsx,js,jsx}"],
678
+ plugins: {
679
+ "@stylistic": stylistic
680
+ },
681
+ rules: {
682
+ /**
683
+ * Enforce block comments to use starred-block style (multiline).
684
+ * Prevents inline block comments like: /** foo *​/
685
+ *
686
+ * @see https://eslint.style/rules/default/multiline-comment-style
687
+ */
688
+ "@stylistic/multiline-comment-style": ["error", "starred-block"],
689
+ /**
690
+ * Enforce consistent spacing after // or /* delimiters.
691
+ *
692
+ * @see https://eslint.style/rules/default/spaced-comment
693
+ */
694
+ "@stylistic/spaced-comment": ["error", "always"],
695
+ /**
696
+ * Require a blank line before block and line comments.
697
+ * Comments belong to the following code block, so only enforce
698
+ * before, not after. Allows comments at the start of blocks,
699
+ * objects, arrays, and classes without a preceding blank line.
700
+ *
701
+ * @see https://eslint.style/rules/default/lines-around-comment
702
+ */
703
+ "@stylistic/lines-around-comment": [
704
+ "error",
705
+ {
706
+ beforeBlockComment: true,
707
+ beforeLineComment: true,
708
+ allowBlockStart: true,
709
+ allowObjectStart: true,
710
+ allowArrayStart: true,
711
+ allowClassStart: true
712
+ }
713
+ ],
714
+ /**
715
+ * Enforce line comments to be placed above the code line.
716
+ *
717
+ * @see https://eslint.style/rules/default/line-comment-position
718
+ */
719
+ "@stylistic/line-comment-position": ["error", "above"],
720
+ /**
721
+ * Require blank lines between specific statement types.
722
+ * - After block-like statements (if, for, while, try, switch).
723
+ * - Before return statements.
724
+ * - After directives ("use strict", etc.).
725
+ *
726
+ * @see https://eslint.style/rules/default/padding-line-between-statements
727
+ */
728
+ "@stylistic/padding-line-between-statements": [
729
+ "error",
730
+ { blankLine: "always", prev: "block-like", next: "*" },
731
+ { blankLine: "always", prev: "*", next: "return" },
732
+ { blankLine: "always", prev: "directive", next: "*" }
733
+ ],
734
+ /**
735
+ * Disallow padding inside blocks.
736
+ * No empty lines right after { or before }.
737
+ *
738
+ * @see https://eslint.style/rules/default/padded-blocks
739
+ */
740
+ "@stylistic/padded-blocks": ["error", "never"],
741
+ /**
742
+ * Require blank lines between class members.
743
+ * Except after single-line members and TypeScript overloads
744
+ * to keep compact field declarations readable.
745
+ *
746
+ * @see https://eslint.style/rules/default/lines-between-class-members
747
+ */
748
+ "@stylistic/lines-between-class-members": [
749
+ "error",
750
+ "always",
751
+ {
752
+ exceptAfterSingleLine: true,
753
+ exceptAfterOverload: true
754
+ }
755
+ ],
756
+ /**
757
+ * Limit consecutive empty lines.
758
+ * Prettier already collapses multiple blank lines within code,
759
+ * but this additionally prevents blank lines at the start of files.
760
+ *
761
+ * @see https://eslint.style/rules/default/no-multiple-empty-lines
762
+ */
763
+ "@stylistic/no-multiple-empty-lines": [
764
+ "error",
765
+ { max: 1, maxBOF: 0, maxEOF: 0 }
766
+ ]
767
+ }
768
+ }
769
+ ]);
770
+
771
+ // src/configs/flavour-vitest.ts
772
+ import vitest from "@vitest/eslint-plugin";
773
+ import { defineConfig as defineConfig5 } from "eslint/config";
774
+ var config5 = defineConfig5([
628
775
  {
629
776
  files: [
630
777
  "**/*.test.{ts,tsx,js,jsx}",
@@ -842,5 +989,6 @@ export {
842
989
  config as base,
843
990
  config2 as configFiles,
844
991
  config3 as nestjs,
845
- config4 as vitest
992
+ config4 as stylistic,
993
+ config5 as vitest
846
994
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-base",
3
- "version": "3.2.0-beta.2",
3
+ "version": "3.2.0-beta.4",
4
4
  "publishConfig": {
5
5
  "npm": true,
6
6
  "ghpr": true,
@@ -48,6 +48,7 @@
48
48
  "prettier": "@abinnovision/prettier-config",
49
49
  "dependencies": {
50
50
  "@eslint/js": "^9.0.0",
51
+ "@stylistic/eslint-plugin": "^5.10.0",
51
52
  "@vitest/eslint-plugin": "^1.6.9",
52
53
  "eslint-plugin-import": "^2.32.0",
53
54
  "eslint-plugin-unused-imports": "^4.4.1",