Glavin001/atom-beautify

Add importer linter-jscs

Botv0091 opened this issue · 7 comments

I can`t understand how to beautify works with linter-jscs presets.
Atom - 0.188.0
atom-beautify options:
Beautify On Save - on.
Beautify Entire File On Save - on.
linter-jscs options:
Preset: yandex

Now animations what happens:
output_2b3e4o

All that means that beautify dismiss all changes that I do with linter-jscs hints. Please help to fix a problem. Thank you.

I can`t understand how to beautify works with linter-jscs presets.

It doesn't.

Atom Beautify uses .jsbeautifyrc file, Atom Editor settings, Atom Beautify package for GUI for configuring settings and a couple other sources. See https://github.com/Glavin001/atom-beautify/blob/master/lib/language-options.coffee
It does not currently consider anything related to linter-jscs, so far as I know (not sure how/where linter-jscs gets it's settings from or how it works at all).

If you could please explain your desired functionality, for those like myself not familiar with linter-jscs, and maybe this is a feature that could be added.

Sorry that i disappeared,
As i understand beatify uses some rules to make code more structural. And linter is module that controls that programmer follows some code-write standards and gives him hints to check code. So, i started use Atom few weeks ago and install immediately linter and beautefy. Every thing looked fine. I opens old files use beautify on it, than i write some code and linter give me some hints. If i miss up some things beautify on save corrected them - and that was great! I follow code standards and linter and beautify helps me in it. But after last update (linter and beautify) began mismatch between linter rules and beautify rules. Now i understand that i must to correct .jsbeautifyrc file to follow rules like rules in linter. But it was so wonderful when u can chose in linter (ex.linter-jscs) some code standard and beatify made some corrects when you save file. Thank you.

But it was so wonderful when u can chose in linter (ex.linter-jscs) some code standard and beatify made some corrects when you save file.

Atom Beautify was never looking for linter-jscs style settings, however this is a great idea!

I will be rewriting the internal beautifying architecture and I will keep this feature in mind (see #282).

Thanks for the good idea!

After #299 we will be able to add Importers which can transform from one source's format to Atom Beautify's format used internally for options.

@Botv0091, @Cortys has implemented JSCS Fixer beautifier in #412. I just published it to v0.28.7
In the mean time, I hope that helps!

I am reopening this issue as I want this to represent adding an importer such that linter-jscs presets are imported into Atom Beautify and used as options for other beautifiers in the appropriate language.

Moved to Unibeautify/options-importer#2

Atom-Beautify will be migrating to using Unibeautify: #1174