From 0ee2c42b55e1893f0ae6510916405eb273587844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Wed, 11 Sep 2019 14:24:08 -0400 Subject: [PATCH] chore: add lint-ts rule (#10427) --- Makefile | 7 ++++++- package.json | 1 + scripts/tests/typescript/lint.sh | 7 +++++++ yarn.lock | 5 +++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 scripts/tests/typescript/lint.sh diff --git a/Makefile b/Makefile index 5fa5cb0cfdbf..e8fe2d667f01 100644 --- a/Makefile +++ b/Makefile @@ -54,9 +54,14 @@ watch: clean clean-lib flow: ./node_modules/.bin/flow check --strip-root -lint: +lint: lint-js lint-ts + +lint-js: ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe +lint-ts: + ./scripts/tests/typescript/lint.sh + fix: fix-json ./node_modules/.bin/eslint scripts $(SOURCES) '*.js' --format=codeframe --fix diff --git a/package.json b/package.json index 3cdf83c27715..82008898b833 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "rollup-plugin-replace": "^2.2.0", "test262-stream": "^1.2.0", "through2": "^2.0.0", + "typescript": "^3.6.3", "warnings-to-errors-webpack-plugin": "^2.0.0", "webpack": "^3.4.1", "webpack-dependency-suite": "^2.4.4", diff --git a/scripts/tests/typescript/lint.sh b/scripts/tests/typescript/lint.sh new file mode 100755 index 000000000000..7a5f9193287f --- /dev/null +++ b/scripts/tests/typescript/lint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e + +node="node" +tsFlags="--strict" + +$node ./node_modules/typescript/bin/tsc $tsFlags ./packages/babel-types/lib/index.d.ts diff --git a/yarn.lock b/yarn.lock index 4baaf3fe85ce..92f52fdd60b0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10438,6 +10438,11 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= +typescript@^3.6.3: + version "3.6.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da" + integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw== + uglify-js@3.4.x: version "3.4.10" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.4.10.tgz#9ad9563d8eb3acdfb8d38597d2af1d815f6a755f"