Browse Source

perf: check typescript with eslint

pull/18051/head
orzyyyy 5 years ago
parent
commit
ce124a36f8
  1. 6
      .eslintrc.js
  2. 7
      package.json

6
.eslintrc.js

@ -1,5 +1,5 @@
const eslintrc = { const eslintrc = {
extends: ['airbnb', 'prettier', 'plugin:jest/recommended'], extends: ['airbnb', 'prettier', 'plugin:jest/recommended', 'plugin:react/recommended'],
env: { env: {
browser: true, browser: true,
node: true, node: true,
@ -7,8 +7,8 @@ const eslintrc = {
jest: true, jest: true,
es6: true, es6: true,
}, },
parser: 'babel-eslint', parser: '@typescript-eslint/parser',
plugins: ['markdown', 'react', 'babel', 'jest'], plugins: ['markdown', 'react', 'babel', 'jest', '@typescript-eslint'],
rules: { rules: {
'react/jsx-one-expression-per-line': 0, 'react/jsx-one-expression-per-line': 0,
'react/prop-types': 0, 'react/prop-types': 0,

7
package.json

@ -97,6 +97,7 @@
}, },
"devDependencies": { "devDependencies": {
"@ant-design/colors": "^3.1.0", "@ant-design/colors": "^3.1.0",
"@ant-design/tools": "^8.0.0",
"@packtracker/webpack-plugin": "^2.0.1", "@packtracker/webpack-plugin": "^2.0.1",
"@sentry/browser": "^5.4.0", "@sentry/browser": "^5.4.0",
"@types/classnames": "^2.2.8", "@types/classnames": "^2.2.8",
@ -105,9 +106,10 @@
"@types/react-dom": "^16.8.4", "@types/react-dom": "^16.8.4",
"@types/react-intl": "^2.3.17", "@types/react-intl": "^2.3.17",
"@types/warning": "^3.0.0", "@types/warning": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"@yesmeck/offline-plugin": "^5.0.5", "@yesmeck/offline-plugin": "^5.0.5",
"antd-theme-generator": "^1.1.6", "antd-theme-generator": "^1.1.6",
"@ant-design/tools": "^8.0.0",
"babel-eslint": "^10.0.1", "babel-eslint": "^10.0.1",
"babel-plugin-add-react-displayname": "^0.0.5", "babel-plugin-add-react-displayname": "^0.0.5",
"bisheng": "^1.3.0", "bisheng": "^1.3.0",
@ -125,7 +127,7 @@
"enzyme": "^3.10.0", "enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0", "enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.3.5", "enzyme-to-json": "^3.3.5",
"eslint": "^6.0.0", "eslint": "^6.1.0",
"eslint-config-airbnb": "^17.1.0", "eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^6.0.0", "eslint-config-prettier": "^6.0.0",
"eslint-plugin-babel": "^5.3.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:code": "eslint --fix tests site scripts components ./.*.js ./webpack.config.js --ext '.js,.jsx'",
"lint-fix:demo": "eslint-tinker ./components/*/demo/*.md", "lint-fix:demo": "eslint-tinker ./components/*/demo/*.md",
"lint-fix:style": "stylelint --fix '{site,components}/**/*.less' --syntax less", "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", "sort-api": "antd-tools run sort-api-table",
"api-collection": "antd-tools run api-collection", "api-collection": "antd-tools run api-collection",
"dist": "antd-tools run dist", "dist": "antd-tools run dist",

Loading…
Cancel
Save