e22m4u 2 лет назад
Родитель
Сommit
6912df022e
6 измененных файлов с 22 добавлено и 12 удалено
  1. 6 5
      package.json
  2. 1 1
      src/errors/index.d.ts
  3. 3 3
      src/index.d.ts
  4. 1 1
      src/service-container.d.ts
  5. 2 2
      src/service.d.ts
  6. 9 0
      tsconfig.json

+ 6 - 5
package.json

@@ -5,11 +5,11 @@
   "type": "module",
   "type": "module",
   "main": "src/index.js",
   "main": "src/index.js",
   "scripts": {
   "scripts": {
-    "lint": "eslint .",
-    "lint:fix": "eslint . --fix",
+    "lint": "tsc && eslint .",
+    "lint:fix": "tsc && eslint . --fix",
     "format": "prettier --write \"./src/**/*.js\"",
     "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"
     "prepare": "npx husky install"
   },
   },
   "repository": {
   "repository": {
@@ -42,6 +42,7 @@
     "eslint-plugin-mocha": "^10.1.0",
     "eslint-plugin-mocha": "^10.1.0",
     "husky": "^8.0.3",
     "husky": "^8.0.3",
     "mocha": "^10.2.0",
     "mocha": "^10.2.0",
-    "prettier": "^3.0.1"
+    "prettier": "^3.0.1",
+    "typescript": "^5.2.2"
   }
   }
 }
 }

+ 1 - 1
src/errors/index.d.ts

@@ -1 +1 @@
-export * from './invalid-argument-error';
+export * from './invalid-argument-error.js';

+ 3 - 3
src/index.d.ts

@@ -1,3 +1,3 @@
-export * from './types';
-export * from './service';
-export * from './service-container';
+export * from './types.js';
+export * from './service.js';
+export * from './service-container.js';

+ 1 - 1
src/service-container.d.ts

@@ -1,4 +1,4 @@
-import {Constructor} from './types';
+import {Constructor} from './types.js';
 
 
 /**
 /**
  * Service container.
  * Service container.

+ 2 - 2
src/service.d.ts

@@ -1,5 +1,5 @@
-import {Constructor} from './types';
-import {ServiceContainer} from './service-container';
+import {Constructor} from './types.js';
+import {ServiceContainer} from './service-container.js';
 
 
 /**
 /**
  * Service.
  * Service.

+ 9 - 0
tsconfig.json

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