stylelint / vscode-stylelint

The official Visual Studio Code extension for Stylelint
https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
MIT License
319 stars 31 forks source link

[Bug]: Formatting is impossible with stylelint #519

Open zxj176381 opened 8 months ago

zxj176381 commented 8 months ago

How did you encounter this bug?

The css\less file is formatted incorrectly: 'output' is deprecated. Use 'report' or 'code' instead.

Link to Minimal Reproducible Example

no

Code Snippet

#root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;

  // format
  text-align: center;
}

.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}

.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}

.logo.react:hover {
  filter: drop-shadow(0 0 2em #61dafbaa);
}

@keyframes logo-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  a:nth-of-type(2) .logo {
    animation: logo-spin infinite 20s linear;
  }
}

.card {
  padding: 2em;
}

.read-the-docs {
  color: #888;
}

Stylelint Configuration

{ "extends": ["stylelint-config-standard"] }

Extension Configuration

"[css]": {
    "editor.defaultFormatter": "stylelint.vscode-stylelint",
    "editor.codeActionsOnSave": {
      "source.fixAll.stylelint": "explicit"
    }
  },

Actual Behaviour

Console error when formatting with vscode: output is deprecated. Use report or code instead. The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16

Expected Behaviour

Successful formatting

Logs

[Info - 08:52:48] [language-server] Registering module | module: "auto-fix" [Info - 08:52:48] [language-server] Module registered | module: "auto-fix" [Info - 08:52:48] [language-server] Registering module | module: "code-action" [Info - 08:52:48] [language-server] Module registered | module: "code-action" [Info - 08:52:48] [language-server] Registering module | module: "completion" [Info - 08:52:48] [language-server] Module registered | module: "completion" [Info - 08:52:48] [language-server] Registering module | module: "formatter" [Info - 08:52:48] [language-server] Module registered | module: "formatter" [Info - 08:52:48] [language-server] Registering module | module: "old-stylelint-warning" [Info - 08:52:48] [language-server] Module registered | module: "old-stylelint-warning" [Info - 08:52:48] [language-server] Registering module | module: "validator" [Info - 08:52:48] [language-server] Module registered | module: "validator" [Info - 08:52:48] [language-server] Starting language server [Info - 08:52:48] [language-server] Registering handlers [Info - 08:52:48] [language-server] Handlers registered [Info - 08:52:48] [language-server] Language server started The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16 output is deprecated. Use report or code instead.

Stylelint Version

16.2.1

vscode-stylelint Version

1.3.0

Node.js Version

20.2.0

Operating System

windows 10

Windows Subsystem for Linux

No response

Code of Conduct

StfBauer commented 7 months ago

Same issue like I still had in this issue: #498

At least NPX stylelint works perfectly for me.

npx stylelint *.scss --fix
Mouvedia commented 6 months ago

related: #523

shangxinbo commented 3 months ago

vscode-stylelint Version 1.4.0 still