From 98ba4038c1ba532d8c0a187e6e15fd9893575633 Mon Sep 17 00:00:00 2001 From: Amumu Date: Thu, 25 Mar 2021 15:01:13 +0800 Subject: [PATCH] chore: add eslint-plugin-compat (#29885) * chore: dd eslint-plugin-compat * update browserslist * update browserslist * fix lint: lint:demo rules * update @ant-design/tools --- .eslintrc.js | 9 ++++++--- package.json | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f1948ee36bc2..a1906d4a1310 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,6 +2,7 @@ module.exports = { extends: [ 'airbnb', 'prettier', + 'plugin:compat/recommended', 'plugin:jest/recommended', 'plugin:react/recommended', 'plugin:import/typescript', @@ -18,6 +19,7 @@ module.exports = { react: { version: '16.9', }, + polyfills: ['Promise', 'URL'], }, parser: '@typescript-eslint/parser', plugins: ['react', 'babel', 'jest', '@typescript-eslint', 'react-hooks', 'unicorn', 'markdown'], @@ -61,19 +63,20 @@ module.exports = { }, rules: { indent: 0, + 'default-case': 0, + 'eol-last': 0, 'no-console': 0, 'no-plusplus': 0, - 'eol-last': 0, 'no-script-url': 0, - 'default-case': 0, 'prefer-rest-params': 0, + 'compat/compat': 0, 'react/no-access-state-in-setstate': 0, 'react/destructuring-assignment': 0, 'react/no-multi-comp': 0, 'react/no-array-index-key': 0, 'jsx-a11y/href-no-hash': 0, - 'import/no-extraneous-dependencies': 0, 'jsx-a11y/control-has-associated-label': 0, + 'import/no-extraneous-dependencies': 0, }, }, ], diff --git a/package.json b/package.json index 2213f2684d81..6ddb629e9ed1 100644 --- a/package.json +++ b/package.json @@ -103,10 +103,12 @@ } }, "browserslist": [ + "> 0.5%", "last 2 versions", "Firefox ESR", - "> 1%", - "ie >= 11" + "not dead", + "IE 11", + "not IE 10" ], "dependencies": { "@ant-design/colors": "^6.0.0", @@ -155,7 +157,7 @@ "devDependencies": { "@ant-design/bisheng-plugin": "^2.3.0", "@ant-design/hitu": "^0.0.0-alpha.13", - "@ant-design/tools": "^13.3.3", + "@ant-design/tools": "^13.4.0", "@qixian.cs/github-contributors-list": "^1.0.3", "@stackblitz/sdk": "^1.3.0", "@types/classnames": "^2.2.8", @@ -202,6 +204,7 @@ "eslint-config-airbnb": "^18.0.0", "eslint-config-prettier": "^8.0.0", "eslint-plugin-babel": "^5.3.0", + "eslint-plugin-compat": "^3.9.0", "eslint-plugin-import": "^2.21.1", "eslint-plugin-jest": "^24.0.1", "eslint-plugin-jsx-a11y": "^6.2.1",