@abinnovision/eslint-config-base 2.1.1 → 2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [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)
4
+
5
+
6
+ ### Features
7
+
8
+ * **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))
9
+
10
+ ## [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)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * migrate to Linter.Config type ([#340](https://github.com/abinnovision/js-commons/issues/340)) ([30a1c19](https://github.com/abinnovision/js-commons/commit/30a1c19c3a2f4c2b94e6086486951145b399e15d))
16
+ * only support eslint v9 ([#345](https://github.com/abinnovision/js-commons/issues/345)) ([7425fdc](https://github.com/abinnovision/js-commons/commit/7425fdc9c2d8912988697ab07b9a8f42d96786d4))
17
+ * remove fixupPluginRules for eslint-plugin-import ([#346](https://github.com/abinnovision/js-commons/issues/346)) ([f964079](https://github.com/abinnovision/js-commons/commit/f9640791b8f811fb1bbe12b3544872ea25a77d16))
18
+ * use spaces for markdown files ([#349](https://github.com/abinnovision/js-commons/issues/349)) ([eeb8b33](https://github.com/abinnovision/js-commons/commit/eeb8b335916602b55ca02cfdea352bc296fa7ffb))
19
+
3
20
  ## [2.1.1](https://github.com/abinnovision/js-commons/compare/eslint-config-base-v2.1.0...eslint-config-base-v2.1.1) (2024-10-10)
4
21
 
5
22
 
package/README.md CHANGED
@@ -1,10 +1,9 @@
1
1
  # @abinnovision/eslint-config-base
2
2
 
3
3
  Base ESLint config, which can be used with Javascript only if applied
4
- standalone.
5
- This config is based on
6
- the [AlloyTeam ESLint Config](https://github.com/AlloyTeam/eslint-config-alloy)
7
- with some additional goodies on top.
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.
8
7
 
9
8
  ## Installation
10
9
 
package/dist/index.cjs CHANGED
@@ -33,16 +33,15 @@ __export(src_exports, {
33
33
  default: () => src_default
34
34
  });
35
35
  module.exports = __toCommonJS(src_exports);
36
- var import_compat = require("@eslint/compat");
37
36
  var import_base = __toESM(require("eslint-config-alloy/base.js"), 1);
38
37
  var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
38
+ var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
39
39
  var config = [
40
40
  {
41
41
  files: ["**/*.{ts,tsx,js,jsx}"],
42
42
  languageOptions: {
43
43
  ecmaVersion: "latest"
44
44
  },
45
- ignores: [".next", "dist", ".wrangler", ".vercel", ".turbo", ".yarn"],
46
45
  plugins: {
47
46
  /**
48
47
  * eslint-plugin-import is not yet compatible with ESLint v9.
@@ -50,7 +49,8 @@ var config = [
50
49
  *
51
50
  * @see https://github.com/import-js/eslint-plugin-import/issues/2948
52
51
  */
53
- import: (0, import_compat.fixupPluginRules)(import_eslint_plugin_import.default)
52
+ import: import_eslint_plugin_import.default,
53
+ "unused-imports": import_eslint_plugin_unused_imports.default
54
54
  },
55
55
  rules: {
56
56
  /**
@@ -105,7 +105,21 @@ var config = [
105
105
  /**
106
106
  * Disable the "no-return-await" rule.
107
107
  */
108
- "no-return-await": "off"
108
+ "no-return-await": "off",
109
+ /**
110
+ * Disable the "no-unused-vars" rule as unused-imports is used instead.
111
+ */
112
+ "no-unused-vars": "off",
113
+ "unused-imports/no-unused-imports": "error",
114
+ "unused-imports/no-unused-vars": [
115
+ "warn",
116
+ {
117
+ vars: "all",
118
+ varsIgnorePattern: "^_",
119
+ args: "after-used",
120
+ argsIgnorePattern: "^_"
121
+ }
122
+ ]
109
123
  }
110
124
  }
111
125
  ];
package/dist/index.d.cts CHANGED
@@ -5,7 +5,6 @@ declare const config: {
5
5
  languageOptions: {
6
6
  ecmaVersion: "latest";
7
7
  };
8
- ignores: string[];
9
8
  plugins: {
10
9
  /**
11
10
  * eslint-plugin-import is not yet compatible with ESLint v9.
@@ -13,7 +12,8 @@ declare const config: {
13
12
  *
14
13
  * @see https://github.com/import-js/eslint-plugin-import/issues/2948
15
14
  */
16
- import: eslint.ESLint.Plugin;
15
+ import: Plugin;
16
+ "unused-imports": eslint.ESLint.Plugin;
17
17
  };
18
18
  rules: {
19
19
  /**
@@ -56,6 +56,17 @@ declare const config: {
56
56
  * Disable the "no-return-await" rule.
57
57
  */
58
58
  "no-return-await": "off";
59
+ /**
60
+ * Disable the "no-unused-vars" rule as unused-imports is used instead.
61
+ */
62
+ "no-unused-vars": "off";
63
+ "unused-imports/no-unused-imports": "error";
64
+ "unused-imports/no-unused-vars": ["warn", {
65
+ vars: string;
66
+ varsIgnorePattern: string;
67
+ args: string;
68
+ argsIgnorePattern: string;
69
+ }];
59
70
  };
60
71
  }[];
61
72
 
package/dist/index.d.ts CHANGED
@@ -5,7 +5,6 @@ declare const config: {
5
5
  languageOptions: {
6
6
  ecmaVersion: "latest";
7
7
  };
8
- ignores: string[];
9
8
  plugins: {
10
9
  /**
11
10
  * eslint-plugin-import is not yet compatible with ESLint v9.
@@ -13,7 +12,8 @@ declare const config: {
13
12
  *
14
13
  * @see https://github.com/import-js/eslint-plugin-import/issues/2948
15
14
  */
16
- import: eslint.ESLint.Plugin;
15
+ import: Plugin;
16
+ "unused-imports": eslint.ESLint.Plugin;
17
17
  };
18
18
  rules: {
19
19
  /**
@@ -56,6 +56,17 @@ declare const config: {
56
56
  * Disable the "no-return-await" rule.
57
57
  */
58
58
  "no-return-await": "off";
59
+ /**
60
+ * Disable the "no-unused-vars" rule as unused-imports is used instead.
61
+ */
62
+ "no-unused-vars": "off";
63
+ "unused-imports/no-unused-imports": "error";
64
+ "unused-imports/no-unused-vars": ["warn", {
65
+ vars: string;
66
+ varsIgnorePattern: string;
67
+ args: string;
68
+ argsIgnorePattern: string;
69
+ }];
59
70
  };
60
71
  }[];
61
72
 
package/dist/index.js CHANGED
@@ -1,14 +1,13 @@
1
1
  // src/index.ts
2
- import { fixupPluginRules } from "@eslint/compat";
3
2
  import AlloyBase from "eslint-config-alloy/base.js";
4
3
  import eslintPluginImport from "eslint-plugin-import";
4
+ import unusedImports from "eslint-plugin-unused-imports";
5
5
  var config = [
6
6
  {
7
7
  files: ["**/*.{ts,tsx,js,jsx}"],
8
8
  languageOptions: {
9
9
  ecmaVersion: "latest"
10
10
  },
11
- ignores: [".next", "dist", ".wrangler", ".vercel", ".turbo", ".yarn"],
12
11
  plugins: {
13
12
  /**
14
13
  * eslint-plugin-import is not yet compatible with ESLint v9.
@@ -16,7 +15,8 @@ var config = [
16
15
  *
17
16
  * @see https://github.com/import-js/eslint-plugin-import/issues/2948
18
17
  */
19
- import: fixupPluginRules(eslintPluginImport)
18
+ import: eslintPluginImport,
19
+ "unused-imports": unusedImports
20
20
  },
21
21
  rules: {
22
22
  /**
@@ -71,7 +71,21 @@ var config = [
71
71
  /**
72
72
  * Disable the "no-return-await" rule.
73
73
  */
74
- "no-return-await": "off"
74
+ "no-return-await": "off",
75
+ /**
76
+ * Disable the "no-unused-vars" rule as unused-imports is used instead.
77
+ */
78
+ "no-unused-vars": "off",
79
+ "unused-imports/no-unused-imports": "error",
80
+ "unused-imports/no-unused-vars": [
81
+ "warn",
82
+ {
83
+ vars: "all",
84
+ varsIgnorePattern: "^_",
85
+ args: "after-used",
86
+ argsIgnorePattern: "^_"
87
+ }
88
+ ]
75
89
  }
76
90
  }
77
91
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-base",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "url": "https://github.com/abinnovision/js-commons"
@@ -42,20 +42,19 @@
42
42
  },
43
43
  "prettier": "@abinnovision/prettier-config",
44
44
  "dependencies": {
45
- "@eslint/compat": "^1.2.0",
46
45
  "eslint-config-alloy": "^5.1.2",
47
- "eslint-plugin-import": "^2.29.1"
46
+ "eslint-plugin-import": "^2.31.0",
47
+ "eslint-plugin-unused-imports": "^4.1.4"
48
48
  },
49
49
  "devDependencies": {
50
- "@abinnovision/prettier-config": "^2.1.2",
50
+ "@abinnovision/prettier-config": "^2.1.3",
51
51
  "@types/eslint": "^9.6.1",
52
- "eslint": "^9.9.1",
53
- "globals": "^15.10.0",
52
+ "eslint": "^9.13.0",
53
+ "globals": "^15.11.0",
54
54
  "prettier": "^3.3.3",
55
55
  "tsup": "^8.3.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "eslint": "^8.24.0 || ^9.0.0"
59
- },
60
- "packageManager": "yarn@3.4.1"
58
+ "eslint": "^9.0.0"
59
+ }
61
60
  }