Skip to content

Add specific .editorconfig file for each specific style linting #905

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

Closed
DrSensor opened this issue Feb 28, 2018 · 14 comments · Fixed by #2097
Closed

Add specific .editorconfig file for each specific style linting #905

DrSensor opened this issue Feb 28, 2018 · 14 comments · Fixed by #2097

Comments

@DrSensor
Copy link

What problem does this feature solve?

This feature will configure autocomplete to a specific style in any IDE that support .editorconfig file. For example when choosing linter to use AirBnB or StandardJS style, it will generate editorconfig with that specific style.

Just info : content in editorconfig file is universal and can be applied to any IDE.

What does the proposed API look like?

Prompt

Create editorconfig? Y/n

Or just create it without prompting.

@psg2
Copy link

psg2 commented Mar 3, 2018

Could I start working on this feature?

@kazupon
Copy link
Member

kazupon commented Mar 4, 2018

Sure! 🙂

@psg2
Copy link

psg2 commented Mar 4, 2018

Just to be clear about the proposal.

During the prompt both on the create command and on the invoke with cli-plugin-eslint, it should ask if the user wants to create an editorconfig file if the Airbnb or the Standard option was chosen?

And the config files should be the ones contained in the repositories:

Or is it best to create the editorconfig file without prompting?

I'm thrilled to work on this feature, both because I'm enjoying Vue so much and because it will be my first real open source contribution.

@hsxfjames
Copy link
Contributor

I vote for create without prompting, so that peoples do not have to worry about too much options.

@psg2
Copy link

psg2 commented Mar 7, 2018

What should happen during invoke if the user already has an editorconfig file?

@elevatebart
Copy link
Contributor

I would love to keep consistency with the choosen linters.
For instance, if I choose eslint preset AirBnB, I keep AirBnB for the .editorconfig.
And since @vue/cli supports prettier preset for eslint we should try to implement it as well.

Regarding the prompt, @psg2 I would use the linter if there is one and ask for a preset if not.

What do you think ?

@defnorep
Copy link

defnorep commented Mar 7, 2018

Also might be prudent to think about what happens when TypeScript is enabled. You can use either ESLint or TSLint on TypeScript projects. There are AirBnb presets for both TSLint and ESLint too. Do we require some kind of abstraction above ESLint and TSLint with a negotiator behind the scenes?

@psg2
Copy link

psg2 commented Mar 8, 2018

@elevatebart I'm sorry, but I didn't understand what you meant by "And since supports prettier preset for eslint we should try to implement it as well.".

Could you explain one more time?

@Daekano I think there's no adjustment considering Typescript. Because the editorconfig from Airbnb and standard would remain the same. And the other linting options doesn't have default editorconfig files.
But as for the cli, maybe there should be options for TSLint + Airbnb, TSLint + Standard, etc... Instead of just default TSLint and various ESLint options when Typescript is chosen.

@elevatebart
Copy link
Contributor

@psg2 the Prettier preset for eslint is a little different from AirBnB and Standard, for instance using prettier uses double quotes instead of single quotes.
If you choose one of the 2 presets that you quote, it will conflict with prettier.

Have a look at this repo and I hope you will understand better.
https://github.com/prettier/eslint-config-prettier

If not, please pm me on twitter @bartledoux.
I am interrested in helping you with this task.

@psg2
Copy link

psg2 commented Mar 8, 2018

@elevatebart I understand that. But eslint-config-prettier doesn't provide an editorconfig file. So if the users choose eslint + prettier as the linter option, it should not generate an editorconfig file and would stay as it is today.
Or should we declare an editorconfig file for that option?

@elevatebart
Copy link
Contributor

Indeed, my bad, the whole purpose of prettier is specifically to avoid the need of a config file.

@DrSensor DrSensor closed this as completed Mar 8, 2018
@DrSensor DrSensor reopened this Mar 8, 2018
@DrSensor
Copy link
Author

I hope this can be helpfull

@psg2
Copy link

psg2 commented May 31, 2018

I'm sorry that after so long I haven't made any progress on this issue.
I didn't manage my time properly and got caught up on work.
Can I still work on this or is anyone else interested?

@LinusBorg
Copy link
Member

Feel free to go ahead :)

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

Successfully merging a pull request may close this issue.

9 participants