-
Notifications
You must be signed in to change notification settings - Fork 4
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
"About to lint" but nothing happens #11
Comments
There's a bug in latest stylelint releases (see stylelint/stylelint#5122) |
Sorry. You'r using eslint. After the "About to lint by" message what do you get in debug windows? |
Just uploaded a bugfix. Please upgrade to 1.0.44 release and check if it works. It's a bugfix per "Error: no files matching the pattern ...." bug of stylelint. |
There was no further output. I tried to add eslint as formatted as well but this also didn't work. I have to retest |
So linting seems to work now. It correctly underlines the errors in the code. However, formating goes horribly wrong. It replaces the whole content of the file with the output of eslint. However, the output is json and only contains the linted file (beside info about errors and stuff). So eslint needs special handling for this I guess? This is the config I used: {
"eslintfix": {
"enabled": true,
"additionalArguments": "--fix-dry-run",
"fileExtensions": "js",
"executable": "eslint.cmd",
"arguments": "\"{filePath}\" -f json",
"stdInArguments": "--stdin --stdin-filename=\"{filePath}\" -f json",
"installationType": "local",
"toolType": "formatter",
"ruleHelpUrl": "https://eslint.org/docs/rules/{ruleId}",
"resultsSelector": "$[0].messages",
"sourceSelector": "source",
"lineSelector": "line",
"columnSelector": "column",
"endLineSelector": "endLine",
"endColumnSelector": "endColumn",
"isFatalSelector": "isFatal",
"messageSelector": "message",
"ruleIdSelector": "ruleId",
"ruleHelpUrlSelector": "",
"severitySelector": "severity"
},
"eslint": {
"enabled": true,
"fileExtensions": "js"
}
} |
As I wrote in other issue fix is not supported. Multilinter takes only care to get warnings and errors. So, remove the additionalArguments. Furthermore you've no changes about the base sconfig (which is inherited), so you need only the standard config which is: { If you fill in two linters (eslintfix AND eslint), that it's called twice if you've multiple linters enabled in VS options. So it slows down the editor. |
I added eslintfix as formatter and not as linter. Why are you able to define formatters in the config if you cant use them? or is this specific to eslint? Btw: I was able to make eslintfix work through a macro on my end. So if you need help hit me up |
Ah! You're right, but about formatters see readme: v1.0.42: Implemented formatters. Preconfigured are Prettier and Beautify. Can be present some bugs. I never tested eslint as a formatter. I'll add into to do list. |
Its pretty easy. You get the json output from eslint and you just take the "output" property of the json and replace the whole file with it. And yeah, you have to use "--fix-dry-run" instead of "--fix" when using stdin |
I am saving the file I want to format and the debug logs reacts with:
But nothing happens.
--fix
flag for formatting?The text was updated successfully, but these errors were encountered: