vscode-standard icon indicating copy to clipboard operation
vscode-standard copied to clipboard

VSC hint popped up saying: extension 'Standard- Javascript standard style' is configured as formatter but it cannot format javascript files.

Open kamaslau opened this issue 3 years ago • 13 comments

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 [email protected], [email protected] 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 ^_^.

kamaslau avatar Nov 24 '21 03:11 kamaslau

VSC settings.json contents are:

{ "standard.autoFixOnSave": true, "standard.enableGlobally": true, "standard.engine": "ts-standard", "standard.run": "onSave", "standard.treatErrorsAsWarnings": true, }

kamaslau avatar Nov 24 '21 05:11 kamaslau

Hi, I have the same issue

brunoprietog avatar Dec 30 '21 05:12 brunoprietog

Hey!

Thanks for your report but I can't reproduce the issue, the formatter works fine for me with the same .vscode/settings.json. image

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.

https://github.com/standard/vscode-standard#how-to-use

theoludwig avatar Jan 04 '22 13:01 theoludwig

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

loh-aivy avatar Jan 06 '22 14:01 loh-aivy

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)

mikemitchel avatar Mar 10 '22 17:03 mikemitchel

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

mpcsh avatar Mar 18 '22 23:03 mpcsh

I have the same problem. "Fix all auto-fixable-problems" works but using standardjs as formatter throws this error on the same file.

falco467 avatar Sep 15 '22 11:09 falco467

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.

Kiailandi avatar Oct 03 '23 15:10 Kiailandi

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

image

briandonahue avatar Oct 05 '23 16:10 briandonahue

happens to me too

zisis912 avatar Feb 12 '24 16:02 zisis912