From 33100297f9dafe357e65bcb469c05c41b8d3a603 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 25 Apr 2019 15:00:28 +0200 Subject: [PATCH] REMOVE tslint, and use eslint for everything --- .eslintignore | 3 +-- .eslintrc.js | 23 ++++++++++++++++++++--- .gitignore | 2 ++ package.json | 26 +++++++++++++++++++++----- yarn.lock | 41 ++++++++++++++++++++++++++++++++++++++++- 5 files changed, 84 insertions(+), 11 deletions(-) diff --git a/.eslintignore b/.eslintignore index 909aea6b614b..73cb24becbf2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,10 +7,9 @@ docs/public storybook-static built-storybooks lib/cli/test +scripts/storage *.bundle.js *.js.map -*.ts -*.tsx !.remarkrc.js !.babelrc.js diff --git a/.eslintrc.js b/.eslintrc.js index 261c74dba1a7..62b5a2c5e140 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,12 +7,29 @@ module.exports = { 'airbnb', 'plugin:jest/recommended', 'plugin:import/react-native', + 'plugin:@typescript-eslint/recommended', 'prettier', 'prettier/react', + 'prettier/@typescript-eslint', ], - plugins: ['prettier', 'jest', 'import', 'react', 'jsx-a11y', 'json', 'html'], - parser: 'babel-eslint', - parserOptions: { ecmaVersion: 8, sourceType: 'module' }, + plugins: [ + '@typescript-eslint', + 'prettier', + 'jest', + 'import', + 'react', + 'jsx-a11y', + 'json', + 'html', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 8, + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, env: { es6: true, node: true, 'jest/globals': true }, settings: { 'import/core-modules': ['enzyme'], diff --git a/.gitignore b/.gitignore index 3d559ddea7f5..59f8c038fc3a 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ integration/__image_snapshots__/__diff_output__ lib/*.jar lib/**/dll .expo/packager-info.json +scripts/storage +htpasswd diff --git a/package.json b/package.json index c91c01b96188..db7f807f884a 100644 --- a/package.json +++ b/package.json @@ -34,12 +34,11 @@ "docs:build": "npm --prefix docs run build", "docs:dev": "npm --prefix docs run dev", "github-release": "github-release-from-changelog", - "lint": "yarn lint:js . && yarn lint:ts **/*.ts **/*.tsx && yarn lint:md .", - "lint:ci": "yarn lint:js --format ./node_modules/eslint-teamcity/index.js . && yarn lint:ts **/*.ts && yarn lint:md .", - "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.json,.html --report-unused-disable-directives", + "lint": "yarn lint:js . && yarn lint:md .", + "lint:ci": "yarn lint:js --format ./node_modules/eslint-teamcity/index.js . && yarn lint:md .", + "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives", "lint:md": "remark -q", "lint:package": "sort-package-json", - "lint:ts": "tslint -p . -c tslint.json -t stylish", "publish:crna": "yarn --cwd examples-native/crna-kitchen-sink expo publish", "publish:debug": "npm run publish:latest -- --npm-tag=debug --no-push", "publish:latest": "lerna publish --exact --concurrency 1 --force-publish", @@ -61,8 +60,24 @@ "yarn lint:js --fix", "git add" ], + "*.jsx": [ + "yarn lint:js --fix", + "git add" + ], + "*.mjs": [ + "yarn lint:js --fix", + "git add" + ], + "*.html": [ + "yarn lint:js --fix", + "git add" + ], "*.ts": [ - "yarn lint:ts --fix", + "yarn lint:js --fix", + "git add" + ], + "*.tsx": [ + "yarn lint:js --fix", "git add" ], "*.json": [ @@ -78,6 +93,7 @@ "browserslist": "defaults", "dependencies": { "@babel/plugin-syntax-dynamic-import": "^7.2.0", + "@typescript-eslint/eslint-plugin": "^1.7.0", "babel-plugin-add-react-displayname": "^0.0.5", "eslint-plugin-html": "^5.0.3", "jest-matcher-utils": "^24.7.0", diff --git a/yarn.lock b/yarn.lock index e9221d5099bb..48943037919c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3259,6 +3259,35 @@ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== +"@typescript-eslint/eslint-plugin@^1.7.0": + version "1.7.0" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.7.0.tgz#570e45dc84fb97852e363f1e00f47e604a0b8bcc" + integrity sha512-NUSz1aTlIzzTjFFVFyzrbo8oFjHg3K/M9MzYByqbMCxeFdErhLAcGITVfXzSz+Yvp5OOpMu3HkIttB0NyKl54Q== + dependencies: + "@typescript-eslint/parser" "1.7.0" + "@typescript-eslint/typescript-estree" "1.7.0" + eslint-utils "^1.3.1" + regexpp "^2.0.1" + requireindex "^1.2.0" + tsutils "^3.7.0" + +"@typescript-eslint/parser@1.7.0": + version "1.7.0" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-1.7.0.tgz#c3ea0d158349ceefbb6da95b5b09924b75357851" + integrity sha512-1QFKxs2V940372srm12ovSE683afqc1jB6zF/f8iKhgLz1yoSjYeGHipasao33VXKI+0a/ob9okeogGdKGvvlg== + dependencies: + "@typescript-eslint/typescript-estree" "1.7.0" + eslint-scope "^4.0.0" + eslint-visitor-keys "^1.0.0" + +"@typescript-eslint/typescript-estree@1.7.0": + version "1.7.0" + resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-1.7.0.tgz#59ec02f5371964da1cc679dba7b878a417bc8c60" + integrity sha512-K5uedUxVmlYrVkFbyV3htDipvLqTE3QMOUQEHYJaKtgzxj6r7c5Ca/DG1tGgFxX+fsbi9nDIrf4arq7Ib7H/Yw== + dependencies: + lodash.unescape "4.0.1" + semver "5.5.0" + "@vue/component-compiler-utils@^2.5.1": version "2.6.0" resolved "https://registry.yarnpkg.com/@vue/component-compiler-utils/-/component-compiler-utils-2.6.0.tgz#aa46d2a6f7647440b0b8932434d22f12371e543b" @@ -16837,6 +16866,11 @@ lodash.throttle@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha1-wj6RtxAkKscMN/HhzaknTMOb8vQ= +lodash.unescape@4.0.1: + version "4.0.1" + resolved "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz#bf2249886ce514cda112fae9218cdc065211fc9c" + integrity sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw= + lodash.uniq@^4.2.0, lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" @@ -22933,6 +22967,11 @@ require-self-ref@^2.0.1: dependencies: lasso-package-root "^1.0.0" +requireindex@^1.2.0: + version "1.2.0" + resolved "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz#3463cdb22ee151902635aa6c9535d4de9c2ef1ef" + integrity sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -25736,7 +25775,7 @@ tsutils@^2.29.0: dependencies: tslib "^1.8.1" -tsutils@^3.0.0, tsutils@^3.5.0: +tsutils@^3.0.0, tsutils@^3.5.0, tsutils@^3.7.0: version "3.10.0" resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.10.0.tgz#6f1c95c94606e098592b0dff06590cf9659227d6" integrity sha512-q20XSMq7jutbGB8luhKKsQldRKWvyBO2BGqni3p4yq8Ys9bEP/xQw3KepKmMRt9gJ4lvQSScrihJrcKdKoSU7Q==