Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for plugins for eslint-7 channel #567

Open
1 task done
mileslane opened this issue Feb 2, 2022 · 6 comments
Open
1 task done

Add support for plugins for eslint-7 channel #567

mileslane opened this issue Feb 2, 2022 · 6 comments
Assignees

Comments

@mileslane
Copy link

mileslane commented Feb 2, 2022

Actual Behavior

It would be helpful to be able to get our GitHub Codeclimate checks to pass. Currently, we are getting errors like this:

Parsing error: Cannot find module 'babel-plugin-macros' Require stack: - /code/babel.config.js

Expected Behavior

Our babel.config.js file uses the following plugins that are not present in the list of Dependencies in the eslint-7 package.json file:

  • babel-plugin-macros
  • @babel/preset-typescript
  • @babel/plugin-proposal-optional-chaining
  • @babel/plugin-syntax-dynamic-import
  • @babel/plugin-transform-destructuring
  • @babel/plugin-proposal-class-properties
  • @babel/plugin-proposal-private-methods
  • @babel/plugin-proposal-private-property-in-object
  • @babel/plugin-proposal-object-rest-spread
  • @babel/plugin-transform-regenerator

NOTES

Running codeclimate analyze -e eslint:eslint-7 locally does not trigger these complaints about these plugins.


  • 4-6 word issue title
@mileslane
Copy link
Author

mileslane commented Feb 2, 2022

Here is my proposed patch (I don't have write access):

diff --git a/package.json b/package.json
index 39296eac..2e871ec3 100644
--- a/package.json
+++ b/package.json
@@ -15,11 +15,20 @@
     "@babel/plugin-transform-runtime": "^7.13.10",
     "@babel/preset-env": "^7.14.7",
     "@babel/preset-react": "^7.14.5",
+    "@babel/preset-typescript": "^7.16.7",
+    "@babel/plugin-proposal-object-rest-spread": "^7.16.7",
+    "@babel/plugin-proposal-optional-chaining": "^7.16.7",
+    "@babel/plugin-proposal-private-methods": "^7.16.11",
+    "@babel/plugin-proposal-private-property-in-object": "^7.16.7",
+    "@babel/plugin-syntax-dynamic-import": "^7.8.3",
+    "@babel/plugin-transform-destructuring": "^7.16.7",
+    "@babel/plugin-transform-regenerator": "^7.16.7",
     "@babel/runtime": "^7.14.8",
     "@hapi/eslint-plugin": "^5.0.0",
     "@typescript-eslint/eslint-plugin": "^4.33.0",
     "@typescript-eslint/parser": "^4.33.0",
     "babel-eslint": "^10.0.1",
+    "babel-plugin-macros": "^3.1.0",
     "babel-plugin-react-generate-property": "^1.0.5",
     "eslint": "7.8.1",
     "eslint-config-airbnb": "^17.1.0",

@mileslane
Copy link
Author

mileslane commented Feb 5, 2022

If you like, I could put up a separate PR for each of these plugins for your consideration.

@mileslane
Copy link
Author

mileslane commented Feb 5, 2022

Ah. I see the problem. Our lead developer is requiring individual plugins from @babel/preset-env in the process of specifying the babel configuration.
This appears to be the issues he is trying to resolve:
Though the "loose" option was set to "false" in your @babel/preset-env config, it will not be used for @babel/plugin-proposal-private-property-in-object since the "loose" mode option was set to "true" for @babel/plugin-proposal-private-methods.
Is it possible to make Codeclimate not choke when individual plugins are required that are included in @babel/preset-env?

@mileslane
Copy link
Author

So, it appears that there are two plugins that are definitely missing in your package.json file:

@chrisjimenez
Copy link

We're also seeing similar errors, but for the babel-plugin-module-resolver plugin.

@camillof
Copy link

@mileslane @chrisjimenez Would you mind testing your projects again please? Some updates were done on the engine that may fix your issue: #578 #579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants