You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SublimeLinter does not support anything except linting and there is no easy way to add this formatting command separately to this plugin. I guess we should wait when such possiblity will land in SublimeLinter, probably create an issue, or create separate plugin, like https://github.com/TheSavior/SublimeJSCSFormatter/blob/master/JSCS-Formatter.py for jscs.
I'll open an issue in linter, to let them know about the need for the feature.
Probably a separate plugin would be the most reliable way of implementing it, but it'd be a pity to not use all the config management which is already implemented in linter and in this plugin.
For reference: what the --fix option currently (v1.10.3) offers (1, 2) is that:
When you run ESLint on the command line with the --fix flag, it will automatically fix any problems that it can (not all problems are fixable at once) and will not report the problems that were fixed.
and
This option instructs ESLint to try to fix as many issues as possible. The fixes are made to the actual files themselves and only the remaining unfixed issues are output.
i.e. running it like this: eslint --fix myscript.js
it will replace the file with one having as many issues as possible fixed (i.e. it wont create a 2nd file),
and it doesn't report in its output which errors it just fixed
but only which unfixed issues remain, like this:
$ eslint --fix myscript.js
C:\Users\Kostas\Desktop\New folder\myscript.user.js
26:18 error Multiline support is limited to browsers supporting ES5 only no-multi-str
48:1 error "GM_addStyle" is not defined no-undef
48:1 error A function with a name starting with an uppercase letter should only be used as a constructor new-cap
73:1 warning "time" was used before it was defined no-use-before-define
75:1 error String prototype is read only, properties should not be added no-extend-native
96:5 error Identifier 'base_url' is not in camel case camelcase
Also, Atom's `linter-eslint` plugin since [version 5.2.0](https://github.com/AtomLinter/linter-eslint/releases)
offers "`linter-eslint: Fix file`" command _(via Command Palette)_.
It works on the currently opened file, provided that you have just saved it (i.e. it has no unsaved changes).
Yet I haven't been able to get --fix or --globals to work. What is the point of the args in SublimeLinter if not to allow arguments to passed to the run time?
The example provided in the SublimeLinter documentation even implies cmd syntax:
If it is possible in SumblimeLinter to tell the difference between an as-you-type lint and a has-hit-save lint, a good approach might be to use the real file instead of --stdin when the file has been saved. And then --fix could be passed in that scenario.
Activity
roadhump commentedon Nov 22, 2015
SublimeLinter does not support anything except linting and there is no easy way to add this formatting command separately to this plugin. I guess we should wait when such possiblity will land in SublimeLinter, probably create an issue, or create separate plugin, like https://github.com/TheSavior/SublimeJSCSFormatter/blob/master/JSCS-Formatter.py for jscs.
hyperknot commentedon Nov 24, 2015
I'll open an issue in linter, to let them know about the need for the feature.
Probably a separate plugin would be the most reliable way of implementing it, but it'd be a pity to not use all the config management which is already implemented in linter and in this plugin.
darkred commentedon Dec 5, 2015
For reference: what the
--fix
option currently (v1.10.3) offers (1, 2) is that:and
i.e. running it like this:
eslint --fix myscript.js
it will replace the file with one having as many issues as possible fixed (i.e. it wont create a 2nd file),
and it doesn't report in its output which errors it just fixed
but only which unfixed issues remain, like this:
Also, Atom's `linter-eslint` plugin since [version 5.2.0](https://github.com/AtomLinter/linter-eslint/releases) offers "`linter-eslint: Fix file`" command _(via Command Palette)_. It works on the currently opened file, provided that you have just saved it (i.e. it has no unsaved changes).
softwarespot commentedon Jan 5, 2016
I am going to create a small sublime text plugin (first one by the way). So watch this space! =)
joerideg commentedon Jan 12, 2016
I'll be watching you @softwarespot :D
mummybot commentedon Jan 22, 2016
How is the plugin going? :)
TBH I am surprised at this as the Sublime Linter documentation, at least in plain english, implies that it passes the argument to the binary:
Yet I haven't been able to get --fix or --globals to work. What is the point of the args in SublimeLinter if not to allow arguments to passed to the run time?
The example provided in the SublimeLinter documentation even implies cmd syntax:
The following does not lint on my Sublime 3.0, removing the "--fix" and it does.
And yet the following works fine
Does not compute!
bdefore commentedon Jan 26, 2016
Would also love to see
--fix
support! 👍joerideg commentedon Jan 28, 2016
Somebody who knows pyton (not me :( ) could fork https://github.com/TheSavior/SublimeJSCSFormatter/ and probably make an eslint version. The api of jscs and eslint are pretty much the same. @softwarespot
roadhump commentedon Jan 30, 2016
@mummybot Plugin uses stdin as input (
--stdin
option ofeslint
). It does not work with--fix
, as I know.karolyi commentedon Feb 18, 2016
+1
jorgenbs commentedon Mar 8, 2016
+1
gblazex commentedon Mar 17, 2016
+1
glenjamin commentedon Apr 23, 2016
If it is possible in SumblimeLinter to tell the difference between an as-you-type lint and a has-hit-save lint, a good approach might be to use the real file instead of
--stdin
when the file has been saved. And then--fix
could be passed in that scenario.softwarespot commentedon Apr 23, 2016
This was released 6 days ago >> https://github.com/TheSavior/ESLint-Formatter. It's JSCS Formatter renamed
20 remaining items