@kazupon/eslint-config 0.4.0 → 0.4.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.
package/dist/index.cjs CHANGED
@@ -39,12 +39,11 @@ async function interopDefault(mod) {
39
39
  return (resolved).default || resolved;
40
40
  }
41
41
  async function loadPlugin(name) {
42
- try {
43
- return interopDefault(import(name));
44
- } catch (e) {
45
- console.error(e);
42
+ const mod = await import(name).catch((err) => {
43
+ console.error(err);
46
44
  throw new Error(`Failed to load eslint plugin '${name}'. Please install it!`);
47
- }
45
+ });
46
+ return interopDefault(mod);
48
47
  }
49
48
 
50
49
  //#endregion
package/dist/index.js CHANGED
@@ -14,12 +14,11 @@ async function interopDefault(mod) {
14
14
  return (resolved).default || resolved;
15
15
  }
16
16
  async function loadPlugin(name) {
17
- try {
18
- return interopDefault(import(name));
19
- } catch (e) {
20
- console.error(e);
17
+ const mod = await import(name).catch((err) => {
18
+ console.error(err);
21
19
  throw new Error(`Failed to load eslint plugin '${name}'. Please install it!`);
22
- }
20
+ });
21
+ return interopDefault(mod);
23
22
  }
24
23
 
25
24
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kazupon/eslint-config",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "ESLint config for @kazupon",
5
5
  "keywords": [
6
6
  "config",
@@ -78,7 +78,8 @@
78
78
  "tsdown": "^0.2.3",
79
79
  "tsx": "^4.16.2",
80
80
  "typescript": "^5.5.3",
81
- "typescript-eslint": "^7.15.0"
81
+ "typescript-eslint": "^7.15.0",
82
+ "vitest": "^1.6.0"
82
83
  },
83
84
  "lint-staged": {
84
85
  "*.{json,md,yml}": [
@@ -104,6 +105,7 @@
104
105
  "fix:prettier": "prettier . --write",
105
106
  "fix:eslint": "eslint . --fix",
106
107
  "dev": "pnpx @eslint/config-inspector --config eslint.config.ts",
108
+ "test": "vitest",
107
109
  "build": "tsdown",
108
110
  "build:inspector": "pnpm build && pnpx @eslint/config-inspector build",
109
111
  "typecheck": "tsc -p ."