From d57f1c7d8af5cdf800cf1a65f668e718f219b50e Mon Sep 17 00:00:00 2001 From: Amumu Date: Wed, 7 Dec 2022 15:35:41 +0800 Subject: [PATCH] feat: replace eslint-plugin-babel with @babel/eslint-plugin and enable new rules (#39335) * feat: replace eslint-plugin-babel with @babel/eslint-plugin and enable new rules * My empty commit with a message --- .eslintrc.js | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 2b8af60c88..12628ed2b1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,7 +25,7 @@ module.exports = { }, }, parser: '@typescript-eslint/parser', - plugins: ['react', 'babel', 'jest', '@typescript-eslint', 'react-hooks', 'unicorn', 'markdown'], + plugins: ['react', '@babel', 'jest', '@typescript-eslint', 'react-hooks', 'unicorn', 'markdown'], // https://github.com/typescript-eslint/typescript-eslint/issues/46#issuecomment-470486034 overrides: [ { @@ -67,6 +67,11 @@ module.exports = { }, rules: { indent: 0, + '@babel/new-cap': 0, + '@babel/no-invalid-this': 0, + '@babel/no-unused-expressions': 2, + '@babel/object-curly-spacing': 0, + '@babel/semi': 2, 'default-case': 0, 'eol-last': 0, 'no-console': 0, diff --git a/package.json b/package.json index 8fa0920a51..b37a1d8411 100644 --- a/package.json +++ b/package.json @@ -160,6 +160,7 @@ "@ant-design/bisheng-plugin": "^3.3.0-alpha.4", "@ant-design/hitu": "^0.0.0-alpha.13", "@ant-design/tools": "^16.1.0-alpha.2", + "@babel/eslint-plugin": "^7.19.1", "@docsearch/css": "^3.0.0", "@emotion/babel-preset-css-prop": "^11.10.0", "@emotion/css": "^11.10.5", @@ -215,7 +216,6 @@ "eslint-config-airbnb": "^19.0.0", "eslint-config-prettier": "^8.0.0", "eslint-import-resolver-typescript": "^3.5.2", - "eslint-plugin-babel": "^5.3.0", "eslint-plugin-compat": "^4.0.0", "eslint-plugin-import": "^2.21.1", "eslint-plugin-jest": "^27.0.1",