From ce124a36f837bbe7f4f62c9cc8ca6d347ceb1379 Mon Sep 17 00:00:00 2001 From: orzyyyy Date: Fri, 2 Aug 2019 17:41:16 +0800 Subject: [PATCH] perf: check typescript with eslint --- .eslintrc.js | 6 +++--- package.json | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 73c422cc7d..bd9aa6130c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,5 +1,5 @@ const eslintrc = { - extends: ['airbnb', 'prettier', 'plugin:jest/recommended'], + extends: ['airbnb', 'prettier', 'plugin:jest/recommended', 'plugin:react/recommended'], env: { browser: true, node: true, @@ -7,8 +7,8 @@ const eslintrc = { jest: true, es6: true, }, - parser: 'babel-eslint', - plugins: ['markdown', 'react', 'babel', 'jest'], + parser: '@typescript-eslint/parser', + plugins: ['markdown', 'react', 'babel', 'jest', '@typescript-eslint'], rules: { 'react/jsx-one-expression-per-line': 0, 'react/prop-types': 0, diff --git a/package.json b/package.json index 715908d70b..bd81f879ba 100644 --- a/package.json +++ b/package.json @@ -97,6 +97,7 @@ }, "devDependencies": { "@ant-design/colors": "^3.1.0", + "@ant-design/tools": "^8.0.0", "@packtracker/webpack-plugin": "^2.0.1", "@sentry/browser": "^5.4.0", "@types/classnames": "^2.2.8", @@ -105,9 +106,10 @@ "@types/react-dom": "^16.8.4", "@types/react-intl": "^2.3.17", "@types/warning": "^3.0.0", + "@typescript-eslint/eslint-plugin": "^1.13.0", + "@typescript-eslint/parser": "^1.13.0", "@yesmeck/offline-plugin": "^5.0.5", "antd-theme-generator": "^1.1.6", - "@ant-design/tools": "^8.0.0", "babel-eslint": "^10.0.1", "babel-plugin-add-react-displayname": "^0.0.5", "bisheng": "^1.3.0", @@ -125,7 +127,7 @@ "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.14.0", "enzyme-to-json": "^3.3.5", - "eslint": "^6.0.0", + "eslint": "^6.1.0", "eslint-config-airbnb": "^17.1.0", "eslint-config-prettier": "^6.0.0", "eslint-plugin-babel": "^5.3.0", @@ -204,6 +206,7 @@ "lint-fix:code": "eslint --fix tests site scripts components ./.*.js ./webpack.config.js --ext '.js,.jsx'", "lint-fix:demo": "eslint-tinker ./components/*/demo/*.md", "lint-fix:style": "stylelint --fix '{site,components}/**/*.less' --syntax less", + "lint:ts:with-eslint": "eslint components/**/*.tsx", "sort-api": "antd-tools run sort-api-table", "api-collection": "antd-tools run api-collection", "dist": "antd-tools run dist",