Open kamaslau opened 2 years ago
VSC settings.json contents are:
{ "standard.autoFixOnSave": true, "standard.enableGlobally": true, "standard.engine": "ts-standard", "standard.run": "onSave", "standard.treatErrorsAsWarnings": true, }
Hi, I have the same issue
Hey!
Thanks for your report but I can't reproduce the issue, the formatter works fine for me with the same .vscode/settings.json
.
Also it is strongly encouraged to install ts-standard
locally in your project inside your devDependencies
, basically follow the "How to use" section from the README
and everything should be fine.
same here
{
"standard.enable": true,
"standard.engine": "standard",
"standard.autoFixOnSave": true,
"standard.run": "onSave",
"standard.validate": [
"javascript"
],
"editor.defaultFormatter": "standard.vscode-standard",
"editor.formatOnSave": true
}
extension 'StandardJS - Javascript standard style' is configured as formatter but it cannot format 'JavaScript' files
also receiving this error in VS Code. Have tried remove all other formatters and resetting VS Code settings to defaults. Have tried uninstall and re-install in the latest plugin, as well as updating to latest standard
in dev dependencies
"standard": "^16.0.4",
options in package.json
"standard": {
"globals": [
"$",
"jQuery",
"can",
"mocha"
],
"ignore": [
"src/calculator/",
"models/fixtures/**",
"mobile/util/**",
"build.production.html.js",
"styles/documentjs-theme/**",
"models/tests/fixtures/**"
],
"env": [
"mocha"
]
},
If I run standard --fix
from the command line it will fix the file in question, but as soon as I save that file it fails again (standard is set as the default formatter in VS Code and set to format on save)
I'm hitting this same issue as well. it's a bit frustrating to that this extension deviates from the vscode convention in this way
I have the same problem. "Fix all auto-fixable-problems" works but using standardjs as formatter throws this error on the same file.
I know that going with "same here" does not really help, but this issue is 2 years old and I don't see any further feedback from members besides the initial "can't reproduce".
I'd like to understand if this is an issue afflicting only a few of us and won't be addressed or if it is something widespread.
Given that the main function of the formatter itself is hindered by this issue it does not make much sense to use the extension at all if the issue persists.
I've got to add a "me too" here. VS Code auto-completes this setting that looks like it would work
"[javascript]": {
"editor.defaultFormatter": "standard.vscode-standard"
},
but running it in a CJS file (.eslintrc.cjs) throws this error
happens to me too
same here
same here
following settings fixed the issue for me
"standard.enable": true,
"standard.enableGlobally": true,
"standard.run": "onType", // in my case "onType" fixes on save, "onSave" seems to fix only on auto save, doesn't do anything on ctrl+s
"standard.autoFixOnSave": true, // needs to be true with false both "onType" and "onSave" doesn't work
"standard.treatErrorsAsWarnings": true,
"standard.engine": "standard",
"standard.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "standard.vscode-standard"
},
What version of this package are you using? v2.0.1
What operating system, Node.js, and npm version? macos Monterey 12.0.1 with Node v17.1.0 and npm@8.1.4, ts-standard@11.0.0 is installed globaly.
What happened? Popup showed when trigger formatter via hotkey combo option+shift+f
What did you expect to happen? No popup should be showed and code should be formatted by standard.
Are you willing to submit a pull request to fix this bug? If I could, I would ^_^.