@abinnovision/eslint-config-base 3.2.0-beta.3 → 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 +107 -6
- package/dist/index.d.cts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +103 -3
- package/package.json +2 -1
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
|
-
|
|
36
|
+
stylistic: () => config4,
|
|
37
|
+
vitest: () => config5
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(src_exports);
|
|
39
40
|
|
|
@@ -708,10 +709,109 @@ var config3 = (0, import_config3.defineConfig)([
|
|
|
708
709
|
}
|
|
709
710
|
]);
|
|
710
711
|
|
|
711
|
-
// src/configs/flavour-
|
|
712
|
-
var import_eslint_plugin = __toESM(require("@
|
|
712
|
+
// src/configs/flavour-stylistic.ts
|
|
713
|
+
var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
|
|
713
714
|
var import_config4 = require("eslint/config");
|
|
714
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)([
|
|
715
815
|
{
|
|
716
816
|
files: [
|
|
717
817
|
"**/*.test.{ts,tsx,js,jsx}",
|
|
@@ -719,11 +819,11 @@ var config4 = (0, import_config4.defineConfig)([
|
|
|
719
819
|
"**/__tests__/**/*.{ts,tsx,js,jsx}"
|
|
720
820
|
],
|
|
721
821
|
plugins: {
|
|
722
|
-
vitest:
|
|
822
|
+
vitest: import_eslint_plugin2.default
|
|
723
823
|
},
|
|
724
824
|
languageOptions: {
|
|
725
825
|
globals: {
|
|
726
|
-
...
|
|
826
|
+
...import_eslint_plugin2.default.environments.env.globals
|
|
727
827
|
}
|
|
728
828
|
},
|
|
729
829
|
settings: {
|
|
@@ -735,7 +835,7 @@ var config4 = (0, import_config4.defineConfig)([
|
|
|
735
835
|
/**
|
|
736
836
|
* Enable Vitest recommended rules.
|
|
737
837
|
*/
|
|
738
|
-
...
|
|
838
|
+
...import_eslint_plugin2.default.configs.recommended.rules,
|
|
739
839
|
/**
|
|
740
840
|
* Enforce a maximum number of parameters in function definitions.
|
|
741
841
|
* Increased to 5 for test setup functions that receive fixtures and mocks.
|
|
@@ -930,5 +1030,6 @@ var config4 = (0, import_config4.defineConfig)([
|
|
|
930
1030
|
base,
|
|
931
1031
|
configFiles,
|
|
932
1032
|
nestjs,
|
|
1033
|
+
stylistic,
|
|
933
1034
|
vitest
|
|
934
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
@@ -669,10 +669,109 @@ var config3 = defineConfig3([
|
|
|
669
669
|
}
|
|
670
670
|
]);
|
|
671
671
|
|
|
672
|
-
// src/configs/flavour-
|
|
673
|
-
import
|
|
672
|
+
// src/configs/flavour-stylistic.ts
|
|
673
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
674
674
|
import { defineConfig as defineConfig4 } from "eslint/config";
|
|
675
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([
|
|
676
775
|
{
|
|
677
776
|
files: [
|
|
678
777
|
"**/*.test.{ts,tsx,js,jsx}",
|
|
@@ -890,5 +989,6 @@ export {
|
|
|
890
989
|
config as base,
|
|
891
990
|
config2 as configFiles,
|
|
892
991
|
config3 as nestjs,
|
|
893
|
-
config4 as
|
|
992
|
+
config4 as stylistic,
|
|
993
|
+
config5 as vitest
|
|
894
994
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abinnovision/eslint-config-base",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
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",
|