Browse Source

Run all TS code (including examples/jsm) through tsc when linting.

Michael Bürge 6 years ago
parent
commit
d4b87ec97e
2 changed files with 10 additions and 1 deletions
  1. 2 1
      package.json
  2. 8 0
      tsconfig.lint.json

+ 2 - 1
package.json

@@ -50,7 +50,7 @@
     "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c -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 -w -m inline\" \"rollup -c test/rollup.unit.config.js -w -m inline\" \"http-server -p 8080\"",
     "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 tsconfig.lint.json",
     "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js",
     "travis": "npm run lint && npm test"
   },
@@ -69,6 +69,7 @@
   "devDependencies": {
     "@typescript-eslint/eslint-plugin": "^2.0.0",
     "@typescript-eslint/parser": "^2.0.0",
+    "@types/webgl2": "0.0.5",
     "concurrently": "^4.1.2",
     "eslint": "^6.2.1",
     "eslint-config-mdcs": "^4.2.3",

+ 8 - 0
tsconfig.lint.json

@@ -0,0 +1,8 @@
+{
+  "compilerOptions": {
+    "noEmit": true,
+  },
+  // NOTE (from https://www.typescriptlang.org/docs/handbook/tsconfig-json.html):
+  // 'If the "files" and "include" are both left unspecified, the compiler defaults to including
+  // all TypeScript (.ts, .d.ts and .tsx) files in the containing directory and subdirectories ...'
+}