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

Idea: auto-create .eslintrc #76

Closed
silverwind opened this issue Jan 30, 2016 · 11 comments
Closed

Idea: auto-create .eslintrc #76

silverwind opened this issue Jan 30, 2016 · 11 comments

Comments

@silverwind
Copy link

In-Editor linter plugins like SublimeLinter-contrib-eslint_d require a .eslintrc to be present in the project directory to work. Would it be possible for xo to create one, maybe through a postinstall npm script?

@sindresorhus
Copy link
Member

Anything stopping you from using https://github.com/sindresorhus/atom-linter-xo?

@silverwind
Copy link
Author

Yes, primarily the fact that it's on Atom (not sold on its performance yet). Also, eslint_d is a big improvment in linting performance for big files, but I guess there might be a Atom plugin around for it.

@sindresorhus
Copy link
Member

@silverwind
Copy link
Author

Oh, I wasn't aware of its existance, thanks! If you're not using eslint_d in there yet, you should have a look ;)

@sindresorhus
Copy link
Member

SublimeLinter-contrib-xo feels fast to me. I use it continuously. Could probably be a tiny bit faster, but I don't think it's worth the complexity and fragileness it adds.

@silverwind
Copy link
Author

Gave it a try. It works on project using xo's rules, but it also started linting my non-xo projects for some reason. Could it be that plugin doesn't actually check package.json if xo is enabled?

@sindresorhus
Copy link
Member

@silverwind Yes, I hadn't really considered that until today. Just added it to the Atom plugin. Should add it to the Sublime plugin too. Opened an issue: xojs/SublimeLinter-contrib-xo#2

@silverwind
Copy link
Author

Awesome, thanks!

@abhisekp
Copy link
Contributor

abhisekp commented Jun 27, 2016

@sindresorhus And what about webstorm? 😢

@sindresorhus
Copy link
Member

@abhisekp #67

@teehemkay
Copy link

teehemkay commented Aug 19, 2016

re: WebStorm.

I think adding a command to XO to emit a .eslintrc* config would greatly improve XO's WebStorm integration story.

Why? Because currently WS can only use ESLint directly. So using XO with WebStorm essentially boils down to having to manually configure ESLint to run like XO. Which in turns means installing various modules, eslint plugins and configs, and creating an appropriate .eslintrc* config.

(#67 doesn't do much to automate that integration with WS: it simply provide an outline of all the steps involved in setting up ESLint to work with WebStorm)

The command would work sort of like the eject option in the create-react-app tool.

It seems to me that most of the work to generate the eslint config is already done in option-manager.js. And installing XO properly installs everything that's needed by an external ˋeslintˋ (caveat: this probably implies ˋnpmˋ 3+)

With such an ˋejectˋ command available, I think that integrating XO with WS would as simple as:

$ npm install --save-dev xo eslint
$ xo --init --eject ...

The ejected config would not be used by XO only by the external eslint

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