Browse Source

Merge pull request #17415 from MichaelBuerge/examples-typings

Run all TS code (including examples/jsm) through tsc when linting.
Mr.doob 5 years ago
parent
commit
a44f5aee70
3 changed files with 16 additions and 1 deletions
  1. 6 0
      package-lock.json
  2. 2 1
      package.json
  3. 8 0
      utils/build/tsconfig.lint.json

+ 6 - 0
package-lock.json

@@ -48,6 +48,12 @@
       "integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==",
       "integrity": "sha512-dyYO+f6ihZEtNPDcWNR1fkoTDf3zAK3lAABDze3mz6POyIercH0lEUawUFXlG8xaQZmm1yEBON/4TsYv/laDYg==",
       "dev": true
       "dev": true
     },
     },
+    "@types/webgl2": {
+      "version": "0.0.5",
+      "resolved": "https://registry.npmjs.org/@types/webgl2/-/webgl2-0.0.5.tgz",
+      "integrity": "sha512-oGaKsBbxQOY5+aJFV3KECDhGaXt+yZJt2y/OZsnQGLRkH6Fvr7rv4pCt3SRH1somIHfej/c4u7NSpCyd9x+1Ow==",
+      "dev": true
+    },
     "@typescript-eslint/eslint-plugin": {
     "@typescript-eslint/eslint-plugin": {
       "version": "2.0.0",
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.0.0.tgz",
       "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.0.0.tgz",

+ 2 - 1
package.json

@@ -52,7 +52,7 @@
     "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"http-server -c-1 -p 8080\"",
     "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"http-server -c-1 -p 8080\"",
     "dev-test": "concurrently --names \"ROLLUP,ROLLUPTEST,HTTP\" -c \"bgBlue.bold,bgRed.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"rollup -c test/rollup.unit.config.js -w -m inline\" \"http-server -p 8080\"",
     "dev-test": "concurrently --names \"ROLLUP,ROLLUPTEST,HTTP\" -c \"bgBlue.bold,bgRed.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"rollup -c test/rollup.unit.config.js -w -m inline\" \"http-server -p 8080\"",
     "start": "npm run dev",
     "start": "npm run dev",
-    "lint": "eslint src --ext js --ext ts && tsc src/Three.d.ts --noEmit",
+    "lint": "eslint src --ext js --ext ts && tsc -p utils/build/tsconfig.lint.json",
     "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js",
     "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js",
     "travis": "npm run lint && npm test"
     "travis": "npm run lint && npm test"
   },
   },
@@ -73,6 +73,7 @@
   "devDependencies": {
   "devDependencies": {
     "@typescript-eslint/eslint-plugin": "^2.0.0",
     "@typescript-eslint/eslint-plugin": "^2.0.0",
     "@typescript-eslint/parser": "^2.0.0",
     "@typescript-eslint/parser": "^2.0.0",
+    "@types/webgl2": "0.0.5",
     "concurrently": "^4.1.2",
     "concurrently": "^4.1.2",
     "eslint": "^6.2.1",
     "eslint": "^6.2.1",
     "eslint-config-mdcs": "^4.2.3",
     "eslint-config-mdcs": "^4.2.3",

+ 8 - 0
utils/build/tsconfig.lint.json

@@ -0,0 +1,8 @@
+{
+  "compilerOptions": {
+    "noEmit": true,
+  },
+  "include": [
+    "../../**/*.ts"
+  ]
+}