Browse Source

fix: d.ts files

e22m4u 2 years ago
parent
commit
56bdf2fa70
3 changed files with 19 additions and 9 deletions
  1. 6 5
      package.json
  2. 4 4
      src/index.d.ts
  3. 9 0
      tsconfig.json

+ 6 - 5
package.json

@@ -5,11 +5,11 @@
   "type": "module",
   "main": "src/index.js",
   "scripts": {
-    "lint": "eslint .",
-    "lint:fix": "eslint . --fix",
+    "lint": "tsc && eslint .",
+    "lint:fix": "tsc && eslint . --fix",
     "format": "prettier --write \"./src/**/*.js\"",
-    "test": "eslint . && c8 --reporter=text-summary mocha",
-    "test:coverage": "eslint . && c8 --reporter=text mocha",
+    "test": "npm run lint && c8 --reporter=text-summary mocha",
+    "test:coverage": "npm run lint && c8 --reporter=text mocha",
     "prepare": "npx husky install"
   },
   "repository": {
@@ -38,6 +38,7 @@
     "eslint-plugin-mocha": "^10.1.0",
     "husky": "^8.0.3",
     "mocha": "^10.2.0",
-    "prettier": "^3.0.1"
+    "prettier": "^3.0.1",
+    "typescript": "^5.2.2"
   }
 }

+ 4 - 4
src/index.d.ts

@@ -1,4 +1,4 @@
-export * from './format';
-export * from './errorf';
-export * from './array-to-list';
-export * from './value-to-string';
+export * from './format.js';
+export * from './errorf.js';
+export * from './array-to-list.js';
+export * from './value-to-string.js';

+ 9 - 0
tsconfig.json

@@ -0,0 +1,9 @@
+{
+  "compilerOptions": {
+    "rootDir": "src",
+    "noEmit": true,
+    "target": "es2022",
+    "module": "NodeNext",
+    "moduleResolution": "NodeNext"
+  }
+}