From c0286e72d6dc7464037d6b4ee2fdab7b378927c6 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Fri, 9 Aug 2019 14:28:37 -0700 Subject: [PATCH 1/7] Add linting support for examples --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8fb73d93ebb15a..eb007f96e5b5e4 100644 --- a/package.json +++ b/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 src/Three.d.ts --noEmit && eslint examples/js --ext js --ext ts --ignore-pattern libs && tsc examples/js", "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js", "travis": "npm run lint && npm test" }, From 08d5ffb17f3d691abf9c5e99182ce21fd495502b Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Fri, 9 Aug 2019 14:35:50 -0700 Subject: [PATCH 2/7] Separate source and example linting --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index eb007f96e5b5e4..110a22fa4d7576 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "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 && eslint examples/js --ext js --ext ts --ignore-pattern libs && tsc examples/js", + "lint": "npm run lint-source && npm run lint-examples", + "lint-source": "eslint src --ext js --ext ts && tsc src/Three.d.ts --noEmit", + "lint-examples": "eslint examples/js --ext js --ext ts --ignore-pattern libs && tsc examples/js", "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js", "travis": "npm run lint && npm test" }, From 3a52175010a0d30bf03c9e9b7f47115bd6bf1d80 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Fri, 9 Aug 2019 21:52:41 -0700 Subject: [PATCH 3/7] Add noEmit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 110a22fa4d7576..f78e3818c7f6cc 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "start": "npm run dev", "lint": "npm run lint-source && npm run lint-examples", "lint-source": "eslint src --ext js --ext ts && tsc src/Three.d.ts --noEmit", - "lint-examples": "eslint examples/js --ext js --ext ts --ignore-pattern libs && tsc examples/js", + "lint-examples": "eslint examples/js --ext js --ext ts --ignore-pattern libs && tsc examples/js --noEmit", "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js", "travis": "npm run lint && npm test" }, From f2d98e25da597bfd508ae47cda1a09cc51ae1e08 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Thu, 19 Sep 2019 13:01:59 -0700 Subject: [PATCH 4/7] Update "lint-examples" command --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9a4d376e24635e..6b720d9b9997e8 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "start": "npm run dev", "lint": "npm run lint-source && npm run lint-examples", "lint-source": "eslint src --ext js --ext ts && tsc -p utils/build/tsconfig.lint.json", - "lint-examples": "eslint examples/js --ext js --ext ts --ignore-pattern libs && tsc examples/js --noEmit", + "lint-examples": "eslint examples/jsm --ext js --ext ts --ignore-pattern libs", "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js", "travis": "npm run lint && npm test" }, From 8d44d2a439af7027d0b397db0a12563d41579421 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Thu, 19 Sep 2019 13:30:09 -0700 Subject: [PATCH 5/7] Separate typescript linting command --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6b720d9b9997e8..a29915a1355e26 100644 --- a/package.json +++ b/package.json @@ -52,8 +52,9 @@ "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\"", "start": "npm run dev", - "lint": "npm run lint-source && npm run lint-examples", - "lint-source": "eslint src --ext js --ext ts && tsc -p utils/build/tsconfig.lint.json", + "lint": "npm run lint-source && npm run lint-typescript && npm run lint-examples", + "lint-source": "eslint src --ext js --ext ts", + "lint-typescript": "tsc -p utils/build/tsconfig.lint.json", "lint-examples": "eslint examples/jsm --ext js --ext ts --ignore-pattern libs", "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js", "travis": "npm run lint && npm test" From 80d1d8f5d4ae45b8f501ebcd4c167a74167a43a8 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Wed, 18 Dec 2019 16:42:06 -0800 Subject: [PATCH 6/7] Create just "lint" and "lint-examples" scripts --- package.json | 6 ++---- utils/build/tsconfig-examples.lint.json | 8 ++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 utils/build/tsconfig-examples.lint.json diff --git a/package.json b/package.json index a29915a1355e26..476c73ad1791b9 100644 --- a/package.json +++ b/package.json @@ -52,10 +52,8 @@ "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\"", "start": "npm run dev", - "lint": "npm run lint-source && npm run lint-typescript && npm run lint-examples", - "lint-source": "eslint src --ext js --ext ts", - "lint-typescript": "tsc -p utils/build/tsconfig.lint.json", - "lint-examples": "eslint examples/jsm --ext js --ext ts --ignore-pattern libs", + "lint": "eslint src --ext js --ext ts && tsc -p utils/build/tsconfig.lint.json", + "lint-examples": "eslint examples/jsm --ext js --ext ts --ignore-pattern libs && tsc -p utils/build/tsconfig-examples.lint.json", "test": "npm run build-test && qunit -r failonlyreporter test/unit/three.source.unit.js", "travis": "npm run lint && npm test" }, diff --git a/utils/build/tsconfig-examples.lint.json b/utils/build/tsconfig-examples.lint.json new file mode 100644 index 00000000000000..110d221eac9d3f --- /dev/null +++ b/utils/build/tsconfig-examples.lint.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "noEmit": true, + }, + "include": [ + "../../examples/jsm/**/*.ts" + ] +} From 075000d9c45925d0c69062f52daa7117702a63f6 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Fri, 20 Dec 2019 10:20:28 -0800 Subject: [PATCH 7/7] Fix tsconfig.lint.json to only run against /src --- utils/build/tsconfig.lint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/build/tsconfig.lint.json b/utils/build/tsconfig.lint.json index ac4d440a08417f..8a28313b90d5e2 100644 --- a/utils/build/tsconfig.lint.json +++ b/utils/build/tsconfig.lint.json @@ -3,6 +3,6 @@ "noEmit": true, }, "include": [ - "../../**/*.ts" + "../../src/**/*.ts" ] }