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

ESLint should also be available for JSX #72

Open
muuvmuuv opened this issue Aug 4, 2018 · 3 comments
Open

ESLint should also be available for JSX #72

muuvmuuv opened this issue Aug 4, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@muuvmuuv
Copy link
Contributor

muuvmuuv commented Aug 4, 2018

ESLint has a plugin integration for React: https://github.com/yannickcr/eslint-plugin-react I would like to use this instead of the other beautifiers.

@stevenzeck
Copy link
Contributor

I'm not sure how plugins are going to work with Unibeautify yet, so will keep this on the back burner.

@stevenzeck stevenzeck added the enhancement New feature or request label Aug 5, 2018
@muuvmuuv
Copy link
Contributor Author

muuvmuuv commented Aug 5, 2018

We could add them via a plugins object in the beautifiers option. Beside that, they are added through the .eslintrc so it would not affect Unibeutify directly as they need to be installed via npm on top of the project.

Would it possible to install packages dynamically inside a plugin? Maybe a function could handle added plugins like the npm does; so it would simply add or remove them when they appear in the settings and vice versa.

Example conf:

JavaScript:
     ESLint:
          plugins:
               - eslint-plugin-react
      ....

Sent with GitHawk

@Glavin001
Copy link
Member

Plugins would be implemented in the beautifier's beautify method and added as a beautifier dependency.

See https://github.com/Unibeautify/beautifier-eslint/blob/master/src/index.ts#L64
It would check the language and if React then add the plugin eslint-plugin-react to the ESLint config used.

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

No branches or pull requests

3 participants