diff --git a/.gitignore b/.gitignore index b1d3a1b1ac0..517a64896a2 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ lerna-debug.log # Yarn lock file yarn.lock + +# Custom typings +custom_typing/*.js diff --git a/package-lock.json b/package-lock.json index c80a8f2436a..59a34424841 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18247,6 +18247,35 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, + "tslint": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.10.0.tgz", + "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.12.1" + } + }, + "tsutils": { + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.1.tgz", + "integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", diff --git a/package.json b/package.json index 802f23095a1..5a6013a2efb 100644 --- a/package.json +++ b/package.json @@ -25,22 +25,25 @@ "bin" ], "scripts": { - "lint": "eslint \"./bin/*.js\" \"./test/**/*.js\" \"./packages/**/!(node_modules)/*.js\" ", + "appveyor:lint": "lerna bootstrap && npm run lint", + "appveyor:test": "npm run test", + "bootstrap": "npm run clean:all && npm install && lerna bootstrap", + "build": "tsc", + "bundlesize": "bundlesize", + "changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile CHANGELOG.md --same-file", + "clean:all": "rimraf node_modules package-lock.json packages/*/node_modules packages/*/package-lock.json", "format": "prettier-eslint ./bin/*.js ./test/**/*.js ./packages/**/*.js --write", + "jsdoc": "jsdoc -c jsdoc.json -r -d docs", "lint:codeOnly": "eslint \"{bin}/**/!(__testfixtures__)/*.js\" \"{bin}/**.js\"", + "lint": "eslint \"./bin/*.js\" \"./test/**/*.js\" \"{packages}/**/!(node_modules)/*.test.js\" && npm run tslint", "precommit": "lint-staged", "pretest": "npm run lint", - "test": "nyc jest", "reportCoverage": "nyc report --reporter=json && codecov -f coverage/coverage-final.json --disable=gcov", - "jsdoc": "jsdoc -c jsdoc.json -r -d docs", - "appveyor:lint": "lerna bootstrap && npm run lint", - "appveyor:test": "npm run test", + "test": "nyc jest", "travis:integration": "npm run test && npm run reportCoverage", "travis:lint": "lerna bootstrap && npm run lint && npm run bundlesize", - "bundlesize": "bundlesize", - "changelog": "conventional-changelog --config ./build/changelog-generator/index.js --infile CHANGELOG.md --same-file", - "clean:all": "rimraf node_modules package-lock.json packages/*/node_modules packages/*/package-lock.json", - "bootstrap": "npm run clean:all && npm install && lerna bootstrap" + "tslint": "tslint -c tslint.json \"{packages}/**/!(node_modules)/*.ts\"", + "watch": "tsc -w" }, "lint-staged": { "{packages,bin}/**/!(__testfixtures__)/**.js": [ @@ -128,6 +131,8 @@ "prettier-eslint-cli": "^4.7.1", "rimraf": "^2.6.2", "schema-utils": "^0.4.5", + "tslint": "^5.10.0", + "typescript": "^2.9.2", "webpack": "^4.8.3", "webpack-dev-server": "^3.1.4" } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000000..7e692ad4acb --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "allowJs": true, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true + }, + "include": [ + "packages/**/*.ts" + ], + "exclude": [ + "node_modules/**", + "packages/*/node_modules/**" + ] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 00000000000..0ce40166829 --- /dev/null +++ b/tslint.json @@ -0,0 +1,15 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint:recommended" + ], + "jsRules": {}, + "rules": {}, + "rulesDirectory": [], + "linterOptions": { + "exclude": [ + "node_modules/**", + "packages/*/node_modules/**" + ] + } +}