@abinnovision/eslint-config-base 2.1.2 → 3.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.0.0](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v2.2.0...eslint-config-base-v3.0.0) (2025-11-08)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * refactor eslint config with new base configs and add flavours
9
+
10
+ ### Features
11
+
12
+ * refactor eslint config with new base configs and add flavours ([581cfce](https://github.com/abinnovision/js-commons/commit/581cfceac98653d5b6f88a16f7807541b49320c8))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * migrate eslint configs to use defineConfig ([#541](https://github.com/abinnovision/js-commons/issues/541)) ([eb24dca](https://github.com/abinnovision/js-commons/commit/eb24dca423b594711b727da84f4c4026f781c9e4))
18
+
19
+ ## [2.2.0](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v2.1.2...eslint-config-base-v2.2.0) (2024-10-24)
20
+
21
+
22
+ ### Features
23
+
24
+ * **eslint:** add unused-imports plugin and update rules ([#356](https://github.com/abinnovision/js-commons/issues/356)) ([303352c](https://github.com/abinnovision/js-commons/commit/303352c986709a06ec7a02aff322ce2e5dcf7342))
25
+
3
26
  ## [2.1.2](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v2.1.1...eslint-config-base-v2.1.2) (2024-10-16)
4
27
 
5
28
 
package/README.md CHANGED
@@ -1,12 +1,88 @@
1
1
  # @abinnovision/eslint-config-base
2
2
 
3
- Base ESLint config, which can be used with Javascript only if applied
4
- standalone. This config is based on the
5
- [AlloyTeam ESLint Config](https://github.com/AlloyTeam/eslint-config-alloy) with
6
- some additional goodies on top.
3
+ ESLint configuration for JavaScript and TypeScript projects.
7
4
 
8
5
  ## Installation
9
6
 
10
7
  ```shell
11
- yarn add --dev @abinnovision/eslint-config-base
8
+ yarn add --dev @abinnovision/eslint-config-base eslint
12
9
  ```
10
+
11
+ ## Usage
12
+
13
+ ```javascript
14
+ // eslint.config.js
15
+ import { base } from "@abinnovision/eslint-config-base";
16
+
17
+ export default [{ extends: [base] }];
18
+ ```
19
+
20
+ ### TypeScript Configuration
21
+
22
+ If your `tsconfig.json` is not in the project root:
23
+
24
+ ```javascript
25
+ // eslint.config.js
26
+ import { base } from "@abinnovision/eslint-config-base";
27
+
28
+ export default [
29
+ {
30
+ extends: [base],
31
+ languageOptions: {
32
+ parserOptions: {
33
+ project: "./path/to/tsconfig.json",
34
+ },
35
+ },
36
+ },
37
+ ];
38
+ ```
39
+
40
+ ## Flavours
41
+
42
+ Specialized configurations for specific project types.
43
+
44
+ ### NestJS
45
+
46
+ For NestJS applications with dependency injection patterns.
47
+
48
+ ```javascript
49
+ import { nestjs } from "@abinnovision/eslint-config-base";
50
+
51
+ export default [{ extends: [nestjs] }];
52
+ ```
53
+
54
+ ### Vitest
55
+
56
+ For test files using Vitest.
57
+
58
+ ```javascript
59
+ import { base, vitest } from "@abinnovision/eslint-config-base";
60
+
61
+ export default [{ extends: [base] }, { extends: [vitest] }];
62
+ ```
63
+
64
+ ### Config Files
65
+
66
+ For build tool and project configuration files. Does not specify file patterns.
67
+
68
+ ```javascript
69
+ import { base, configFiles } from "@abinnovision/eslint-config-base";
70
+
71
+ export default [
72
+ { extends: [base] },
73
+ {
74
+ files: ["**/*.config.{ts,js}"],
75
+ extends: [configFiles],
76
+ },
77
+ ];
78
+ ```
79
+
80
+ ## Related Packages
81
+
82
+ - [@abinnovision/eslint-config-react](../eslint-config-react) - React
83
+ configuration
84
+ - [@abinnovision/prettier-config](../prettier-config) - Code formatting
85
+
86
+ ## License
87
+
88
+ Apache-2.0
package/package.json CHANGED
@@ -1,21 +1,26 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-base",
3
- "version": "2.1.2",
3
+ "version": "3.0.0",
4
+ "publishConfig": {
5
+ "npm": true,
6
+ "ghpr": true,
7
+ "npmAccess": "public"
8
+ },
4
9
  "type": "module",
5
10
  "repository": {
6
11
  "url": "https://github.com/abinnovision/js-commons"
7
12
  },
8
13
  "license": "Apache-2.0",
9
14
  "author": {
10
- "name": "AB INNOVISION GmbH",
11
- "email": "info@abinnovision.com",
12
- "url": "https://abinnovision.com/"
15
+ "name": "abi group GmbH",
16
+ "email": "info@abigroup.io",
17
+ "url": "https://abigroup.io/"
13
18
  },
14
19
  "exports": {
15
20
  ".": {
21
+ "types": "./dist/index.d.ts",
16
22
  "import": "./dist/index.js",
17
- "require": "./dist/index.cjs",
18
- "types": "./dist/index.d.ts"
23
+ "require": "./dist/index.cjs"
19
24
  }
20
25
  },
21
26
  "main": "./dist/index.cjs",
@@ -42,16 +47,19 @@
42
47
  },
43
48
  "prettier": "@abinnovision/prettier-config",
44
49
  "dependencies": {
45
- "eslint-config-alloy": "^5.1.2",
46
- "eslint-plugin-import": "^2.31.0"
50
+ "@eslint/js": "^9.39.1",
51
+ "@vitest/eslint-plugin": "^1.4.0",
52
+ "eslint-plugin-import": "^2.32.0",
53
+ "eslint-plugin-unused-imports": "^4.3.0",
54
+ "globals": "^16.5.0",
55
+ "typescript-eslint": "^8.46.3"
47
56
  },
48
57
  "devDependencies": {
49
- "@abinnovision/prettier-config": "^2.1.3",
50
- "@types/eslint": "^9.6.1",
51
- "eslint": "^9.12.0",
52
- "globals": "^15.11.0",
53
- "prettier": "^3.3.3",
54
- "tsup": "^8.3.0"
58
+ "@abinnovision/prettier-config": "^2.1.4",
59
+ "eslint": "^9.39.1",
60
+ "prettier": "^3.4.2",
61
+ "tsup": "^8.3.6",
62
+ "typescript": "^5.9.3"
55
63
  },
56
64
  "peerDependencies": {
57
65
  "eslint": "^9.0.0"
package/dist/index.cjs DELETED
@@ -1,111 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- default: () => src_default
34
- });
35
- module.exports = __toCommonJS(src_exports);
36
- var import_base = __toESM(require("eslint-config-alloy/base.js"), 1);
37
- var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
38
- var config = [
39
- {
40
- files: ["**/*.{ts,tsx,js,jsx}"],
41
- languageOptions: {
42
- ecmaVersion: "latest"
43
- },
44
- ignores: [".next", "dist", ".wrangler", ".vercel", ".turbo", ".yarn"],
45
- plugins: {
46
- /**
47
- * eslint-plugin-import is not yet compatible with ESLint v9.
48
- * This is a temporary fix to make it compatible in the meantime.
49
- *
50
- * @see https://github.com/import-js/eslint-plugin-import/issues/2948
51
- */
52
- import: import_eslint_plugin_import.default
53
- },
54
- rules: {
55
- /**
56
- * Use the rules from the base config as defaults.
57
- *
58
- * @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1
59
- */
60
- ...import_base.default.rules ?? {},
61
- /**
62
- * Enforce a consistent order and grouping of import statements.
63
- *
64
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
65
- */
66
- "import/order": [
67
- "error",
68
- {
69
- groups: [
70
- // Externals
71
- ["builtin", "external"],
72
- // Internals
73
- ["internal", "unknown", "parent", "sibling", "index"],
74
- // Types
75
- ["object", "type"]
76
- ],
77
- "newlines-between": "always",
78
- alphabetize: { order: "asc", caseInsensitive: true },
79
- warnOnUnassignedImports: true
80
- }
81
- ],
82
- /**
83
- * Enforce the "export" statement is placed at the end of the file.
84
- * This avoids sprinkling export statements throughout the file.
85
- *
86
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
87
- */
88
- "import/exports-last": "warn",
89
- /**
90
- * Import statements should always be the first statements in a file.
91
- * This makes it easier to identify the dependencies of a file.
92
- *
93
- * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
94
- *
95
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
96
- */
97
- "import/first": "error",
98
- /**
99
- * Enforce a newline after the import statements.
100
- *
101
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
102
- */
103
- "import/newline-after-import": "error",
104
- /**
105
- * Disable the "no-return-await" rule.
106
- */
107
- "no-return-await": "off"
108
- }
109
- }
110
- ];
111
- var src_default = config;
package/dist/index.d.cts DELETED
@@ -1,60 +0,0 @@
1
- declare const config: {
2
- files: string[];
3
- languageOptions: {
4
- ecmaVersion: "latest";
5
- };
6
- ignores: string[];
7
- plugins: {
8
- /**
9
- * eslint-plugin-import is not yet compatible with ESLint v9.
10
- * This is a temporary fix to make it compatible in the meantime.
11
- *
12
- * @see https://github.com/import-js/eslint-plugin-import/issues/2948
13
- */
14
- import: Plugin;
15
- };
16
- rules: {
17
- /**
18
- * Enforce a consistent order and grouping of import statements.
19
- *
20
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
21
- */
22
- "import/order": ["error", {
23
- groups: string[][];
24
- "newlines-between": string;
25
- alphabetize: {
26
- order: string;
27
- caseInsensitive: boolean;
28
- };
29
- warnOnUnassignedImports: boolean;
30
- }];
31
- /**
32
- * Enforce the "export" statement is placed at the end of the file.
33
- * This avoids sprinkling export statements throughout the file.
34
- *
35
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
36
- */
37
- "import/exports-last": "warn";
38
- /**
39
- * Import statements should always be the first statements in a file.
40
- * This makes it easier to identify the dependencies of a file.
41
- *
42
- * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
43
- *
44
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
45
- */
46
- "import/first": "error";
47
- /**
48
- * Enforce a newline after the import statements.
49
- *
50
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
51
- */
52
- "import/newline-after-import": "error";
53
- /**
54
- * Disable the "no-return-await" rule.
55
- */
56
- "no-return-await": "off";
57
- };
58
- }[];
59
-
60
- export { config as default };
package/dist/index.d.ts DELETED
@@ -1,60 +0,0 @@
1
- declare const config: {
2
- files: string[];
3
- languageOptions: {
4
- ecmaVersion: "latest";
5
- };
6
- ignores: string[];
7
- plugins: {
8
- /**
9
- * eslint-plugin-import is not yet compatible with ESLint v9.
10
- * This is a temporary fix to make it compatible in the meantime.
11
- *
12
- * @see https://github.com/import-js/eslint-plugin-import/issues/2948
13
- */
14
- import: Plugin;
15
- };
16
- rules: {
17
- /**
18
- * Enforce a consistent order and grouping of import statements.
19
- *
20
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
21
- */
22
- "import/order": ["error", {
23
- groups: string[][];
24
- "newlines-between": string;
25
- alphabetize: {
26
- order: string;
27
- caseInsensitive: boolean;
28
- };
29
- warnOnUnassignedImports: boolean;
30
- }];
31
- /**
32
- * Enforce the "export" statement is placed at the end of the file.
33
- * This avoids sprinkling export statements throughout the file.
34
- *
35
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
36
- */
37
- "import/exports-last": "warn";
38
- /**
39
- * Import statements should always be the first statements in a file.
40
- * This makes it easier to identify the dependencies of a file.
41
- *
42
- * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
43
- *
44
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
45
- */
46
- "import/first": "error";
47
- /**
48
- * Enforce a newline after the import statements.
49
- *
50
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
51
- */
52
- "import/newline-after-import": "error";
53
- /**
54
- * Disable the "no-return-await" rule.
55
- */
56
- "no-return-await": "off";
57
- };
58
- }[];
59
-
60
- export { config as default };
package/dist/index.js DELETED
@@ -1,80 +0,0 @@
1
- // src/index.ts
2
- import AlloyBase from "eslint-config-alloy/base.js";
3
- import eslintPluginImport from "eslint-plugin-import";
4
- var config = [
5
- {
6
- files: ["**/*.{ts,tsx,js,jsx}"],
7
- languageOptions: {
8
- ecmaVersion: "latest"
9
- },
10
- ignores: [".next", "dist", ".wrangler", ".vercel", ".turbo", ".yarn"],
11
- plugins: {
12
- /**
13
- * eslint-plugin-import is not yet compatible with ESLint v9.
14
- * This is a temporary fix to make it compatible in the meantime.
15
- *
16
- * @see https://github.com/import-js/eslint-plugin-import/issues/2948
17
- */
18
- import: eslintPluginImport
19
- },
20
- rules: {
21
- /**
22
- * Use the rules from the base config as defaults.
23
- *
24
- * @see https://alloyteam.github.io/eslint-config-alloy/?hideOff=1
25
- */
26
- ...AlloyBase.rules ?? {},
27
- /**
28
- * Enforce a consistent order and grouping of import statements.
29
- *
30
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md
31
- */
32
- "import/order": [
33
- "error",
34
- {
35
- groups: [
36
- // Externals
37
- ["builtin", "external"],
38
- // Internals
39
- ["internal", "unknown", "parent", "sibling", "index"],
40
- // Types
41
- ["object", "type"]
42
- ],
43
- "newlines-between": "always",
44
- alphabetize: { order: "asc", caseInsensitive: true },
45
- warnOnUnassignedImports: true
46
- }
47
- ],
48
- /**
49
- * Enforce the "export" statement is placed at the end of the file.
50
- * This avoids sprinkling export statements throughout the file.
51
- *
52
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/exports-last.md
53
- */
54
- "import/exports-last": "warn",
55
- /**
56
- * Import statements should always be the first statements in a file.
57
- * This makes it easier to identify the dependencies of a file.
58
- *
59
- * NOTE: Directives (e.g. "use strict") are allowed to come before import statements.
60
- *
61
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/first.md
62
- */
63
- "import/first": "error",
64
- /**
65
- * Enforce a newline after the import statements.
66
- *
67
- * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/newline-after-import.md
68
- */
69
- "import/newline-after-import": "error",
70
- /**
71
- * Disable the "no-return-await" rule.
72
- */
73
- "no-return-await": "off"
74
- }
75
- }
76
- ];
77
- var src_default = config;
78
- export {
79
- src_default as default
80
- };