@abinnovision/eslint-config-base 3.2.0 → 3.2.1

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.
@@ -0,0 +1,14 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/configs/flavour-stylistic.d.ts
4
+ /**
5
+ * ESLint configuration for optional stylistic rules.
6
+ * Enforces consistent code style for comments, spacing, and padding
7
+ * that Prettier does not handle.
8
+ *
9
+ * NOTE: This configuration is meant to be used in conjunction with
10
+ * the base TypeScript ESLint configuration.
11
+ */
12
+ declare const config: eslint_config0.Config[];
13
+ //#endregion
14
+ export { config };
@@ -0,0 +1,75 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import stylistic from "@stylistic/eslint-plugin";
3
+ //#region src/configs/flavour-stylistic.ts
4
+ /**
5
+ * ESLint configuration for optional stylistic rules.
6
+ * Enforces consistent code style for comments, spacing, and padding
7
+ * that Prettier does not handle.
8
+ *
9
+ * NOTE: This configuration is meant to be used in conjunction with
10
+ * the base TypeScript ESLint configuration.
11
+ */
12
+ const config = defineConfig([{
13
+ files: ["**/*.{ts,tsx,js,jsx}"],
14
+ plugins: { "@stylistic": stylistic },
15
+ rules: {
16
+ "@stylistic/multiline-comment-style": ["error", "starred-block"],
17
+ "@stylistic/spaced-comment": ["error", "always"],
18
+ "@stylistic/lines-around-comment": ["error", {
19
+ beforeBlockComment: true,
20
+ beforeLineComment: true,
21
+ allowBlockStart: true,
22
+ allowObjectStart: true,
23
+ allowArrayStart: true,
24
+ allowClassStart: true,
25
+ allowInterfaceStart: true,
26
+ allowTypeStart: true,
27
+ allowEnumStart: true,
28
+ allowModuleStart: true
29
+ }],
30
+ "@stylistic/line-comment-position": ["error", "above"],
31
+ "@stylistic/padding-line-between-statements": [
32
+ "error",
33
+ {
34
+ blankLine: "always",
35
+ prev: "block-like",
36
+ next: "*"
37
+ },
38
+ {
39
+ blankLine: "always",
40
+ prev: "*",
41
+ next: "return"
42
+ },
43
+ {
44
+ blankLine: "always",
45
+ prev: "directive",
46
+ next: "*"
47
+ }
48
+ ],
49
+ "@stylistic/padded-blocks": ["error", "never"],
50
+ "@stylistic/lines-between-class-members": [
51
+ "error",
52
+ "always",
53
+ {
54
+ exceptAfterSingleLine: true,
55
+ exceptAfterOverload: true
56
+ }
57
+ ],
58
+ "@stylistic/no-multiple-empty-lines": ["error", {
59
+ max: 1,
60
+ maxBOF: 0,
61
+ maxEOF: 0
62
+ }]
63
+ }
64
+ }, (
65
+ /**
66
+ * Disable lines-around-comment for JSX/TSX files.
67
+ * The rule lacks AST support for JSX-specific contexts, causing
68
+ * unresolvable conflicts with Prettier.
69
+ */
70
+ {
71
+ files: ["**/*.{tsx,jsx}"],
72
+ rules: { "@stylistic/lines-around-comment": "off" }
73
+ })]);
74
+ //#endregion
75
+ export { config };
@@ -0,0 +1,55 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ let eslint_config = require("eslint/config");
3
+ let _vitest_eslint_plugin = require("@vitest/eslint-plugin");
4
+ _vitest_eslint_plugin = require_runtime.__toESM(_vitest_eslint_plugin);
5
+ //#region src/configs/flavour-vitest.ts
6
+ /**
7
+ * ESLint configuration tailored for Vitest test files.
8
+ * Relaxes strict rules to accommodate common testing patterns while adding
9
+ * Vitest-specific linting rules.
10
+ *
11
+ * NOTE: This configuration is meant to be used in conjunction with
12
+ * the base TypeScript ESLint configuration.
13
+ */
14
+ const config = (0, eslint_config.defineConfig)([{
15
+ files: [
16
+ "**/*.test.{ts,tsx,js,jsx}",
17
+ "**/*.spec.{ts,tsx,js,jsx}",
18
+ "**/__tests__/**/*.{ts,tsx,js,jsx}"
19
+ ],
20
+ plugins: { vitest: _vitest_eslint_plugin.default },
21
+ languageOptions: { globals: { ..._vitest_eslint_plugin.default.environments.env.globals } },
22
+ settings: { vitest: { typecheck: true } },
23
+ rules: {
24
+ ..._vitest_eslint_plugin.default.configs.recommended.rules,
25
+ "max-params": ["error", 5],
26
+ "max-nested-callbacks": ["error", 5],
27
+ complexity: ["warn", 30],
28
+ "max-lines-per-function": "off",
29
+ "max-statements": "off",
30
+ "max-lines": "off",
31
+ "@typescript-eslint/no-unsafe-assignment": "off",
32
+ "@typescript-eslint/no-unsafe-member-access": "off",
33
+ "@typescript-eslint/no-unsafe-call": "off",
34
+ "@typescript-eslint/no-unsafe-return": "off",
35
+ "@typescript-eslint/no-unsafe-argument": "off",
36
+ "@typescript-eslint/unbound-method": "off",
37
+ "@typescript-eslint/no-magic-numbers": "off",
38
+ "@typescript-eslint/no-floating-promises": "warn",
39
+ "@typescript-eslint/no-non-null-assertion": "off",
40
+ "no-empty-function": "off",
41
+ "@typescript-eslint/no-empty-function": "off",
42
+ "no-magic-numbers": "off",
43
+ "no-console": "off",
44
+ "vitest/no-focused-tests": "error",
45
+ "vitest/no-disabled-tests": "warn",
46
+ "vitest/prefer-lowercase-title": "warn",
47
+ "vitest/max-nested-describe": ["error", { max: 5 }],
48
+ "vitest/no-conditional-in-test": "error",
49
+ "vitest/no-conditional-expect": "error",
50
+ "vitest/prefer-hooks-in-order": "warn",
51
+ "vitest/prefer-spy-on": "warn"
52
+ }
53
+ }]);
54
+ //#endregion
55
+ exports.config = config;
@@ -0,0 +1,14 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/configs/flavour-vitest.d.ts
4
+ /**
5
+ * ESLint configuration tailored for Vitest test files.
6
+ * Relaxes strict rules to accommodate common testing patterns while adding
7
+ * Vitest-specific linting rules.
8
+ *
9
+ * NOTE: This configuration is meant to be used in conjunction with
10
+ * the base TypeScript ESLint configuration.
11
+ */
12
+ declare const config: eslint_config0.Config[];
13
+ //#endregion
14
+ export { config };
@@ -0,0 +1,14 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/configs/flavour-vitest.d.ts
4
+ /**
5
+ * ESLint configuration tailored for Vitest test files.
6
+ * Relaxes strict rules to accommodate common testing patterns while adding
7
+ * Vitest-specific linting rules.
8
+ *
9
+ * NOTE: This configuration is meant to be used in conjunction with
10
+ * the base TypeScript ESLint configuration.
11
+ */
12
+ declare const config: eslint_config0.Config[];
13
+ //#endregion
14
+ export { config };
@@ -0,0 +1,53 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import vitest from "@vitest/eslint-plugin";
3
+ //#region src/configs/flavour-vitest.ts
4
+ /**
5
+ * ESLint configuration tailored for Vitest test files.
6
+ * Relaxes strict rules to accommodate common testing patterns while adding
7
+ * Vitest-specific linting rules.
8
+ *
9
+ * NOTE: This configuration is meant to be used in conjunction with
10
+ * the base TypeScript ESLint configuration.
11
+ */
12
+ const config = defineConfig([{
13
+ files: [
14
+ "**/*.test.{ts,tsx,js,jsx}",
15
+ "**/*.spec.{ts,tsx,js,jsx}",
16
+ "**/__tests__/**/*.{ts,tsx,js,jsx}"
17
+ ],
18
+ plugins: { vitest },
19
+ languageOptions: { globals: { ...vitest.environments.env.globals } },
20
+ settings: { vitest: { typecheck: true } },
21
+ rules: {
22
+ ...vitest.configs.recommended.rules,
23
+ "max-params": ["error", 5],
24
+ "max-nested-callbacks": ["error", 5],
25
+ complexity: ["warn", 30],
26
+ "max-lines-per-function": "off",
27
+ "max-statements": "off",
28
+ "max-lines": "off",
29
+ "@typescript-eslint/no-unsafe-assignment": "off",
30
+ "@typescript-eslint/no-unsafe-member-access": "off",
31
+ "@typescript-eslint/no-unsafe-call": "off",
32
+ "@typescript-eslint/no-unsafe-return": "off",
33
+ "@typescript-eslint/no-unsafe-argument": "off",
34
+ "@typescript-eslint/unbound-method": "off",
35
+ "@typescript-eslint/no-magic-numbers": "off",
36
+ "@typescript-eslint/no-floating-promises": "warn",
37
+ "@typescript-eslint/no-non-null-assertion": "off",
38
+ "no-empty-function": "off",
39
+ "@typescript-eslint/no-empty-function": "off",
40
+ "no-magic-numbers": "off",
41
+ "no-console": "off",
42
+ "vitest/no-focused-tests": "error",
43
+ "vitest/no-disabled-tests": "warn",
44
+ "vitest/prefer-lowercase-title": "warn",
45
+ "vitest/max-nested-describe": ["error", { max: 5 }],
46
+ "vitest/no-conditional-in-test": "error",
47
+ "vitest/no-conditional-expect": "error",
48
+ "vitest/prefer-hooks-in-order": "warn",
49
+ "vitest/prefer-spy-on": "warn"
50
+ }
51
+ }]);
52
+ //#endregion
53
+ export { config };
@@ -0,0 +1,5 @@
1
+ require("./base.cjs");
2
+ require("./flavour-config-files.cjs");
3
+ require("./flavour-nestjs.cjs");
4
+ require("./flavour-stylistic.cjs");
5
+ require("./flavour-vitest.cjs");
@@ -0,0 +1,5 @@
1
+ import { config } from "./base.mjs";
2
+ import { config as config$1 } from "./flavour-config-files.mjs";
3
+ import { config as config$2 } from "./flavour-nestjs.mjs";
4
+ import { config as config$3 } from "./flavour-stylistic.mjs";
5
+ import { config as config$4 } from "./flavour-vitest.mjs";
@@ -0,0 +1,6 @@
1
+ import "./base.mjs";
2
+ import "./flavour-config-files.mjs";
3
+ import "./flavour-nestjs.mjs";
4
+ import "./flavour-stylistic.mjs";
5
+ import "./flavour-vitest.mjs";
6
+ export {};