Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Allow eslint to define the babylon plugins #523

Closed
wants to merge 1 commit into from

Conversation

kesne
Copy link
Contributor

@kesne kesne commented Sep 28, 2017

If you want to use babel-eslint, currently that means opting into every syntax feature that babylon offers. This allows you to provide your own array of babylon plugins in the eslint parserOptions. For us, this will allow us to enable stage-3 syntax features, but still make things like do-expressions a syntax error. If you don't define plugins, it'll default to enabling them all.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great start, but what I really need is to read my babelrc and use the plugins list from there

@kesne
Copy link
Contributor Author

kesne commented Sep 28, 2017

Yeah, I think there's a path forward there. If we land babel/babel#6332 and add a babel-core dependency, we should be able to run an empty transform when we start linting, then read the parserOptions.plugins and pass that to babylon. That way, babel-eslint will set itself up based on your .babelrc as expected.

@kaicataldo
Copy link
Member

kaicataldo commented Jan 8, 2018

I agree with @ljharb. Since parser plugins aren't configurable by the user, I don't think we should force users to keep track of this configuration for themselves. I'm going to try to find some time to look into this.

@kaicataldo
Copy link
Member

WIP PR is open here: #711

All feedback welcome :)

@kaicataldo
Copy link
Member

#711 has now landed

@hzoo
Copy link
Member

hzoo commented Jan 10, 2019

Going to close since ^ landed!

@hzoo hzoo closed this Jan 10, 2019
Graham42 added a commit to Graham42/eslint-plugin-babel that referenced this pull request Jan 29, 2019
Fixes: eslint/eslint#7534

Stage 3 Proposal: https://github.com/tc39/proposal-class-fields
Babel plugin: https://babeljs.io/docs/en/babel-plugin-proposal-class-properties

This does not yet support private class properties yet as that would require
upgrading to babel-eslint@^11 which would require a bunch of other
changes. See: babel/babel-eslint#523
brneto added a commit to brneto/todos-app that referenced this pull request Apr 5, 2019
Turbo87 pushed a commit to Turbo87/eslint-plugin-babel that referenced this pull request Mar 30, 2020
Fixes: eslint/eslint#7534

Stage 3 Proposal: https://github.com/tc39/proposal-class-fields
Babel plugin: https://babeljs.io/docs/en/babel-plugin-proposal-class-properties

This does not yet support private class properties yet as that would require
upgrading to babel-eslint@^11 which would require a bunch of other
changes. See: babel/babel-eslint#523
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants