Skip to content
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

[Bug]: Unsure if extension works with stylelint v16 #523

Closed
1 task done
jorisw opened this issue Mar 20, 2024 · 6 comments
Closed
1 task done

[Bug]: Unsure if extension works with stylelint v16 #523

jorisw opened this issue Mar 20, 2024 · 6 comments

Comments

@jorisw
Copy link

jorisw commented Mar 20, 2024

How did you encounter this bug?

After upgrading stylelint to v16, the Stylelint output in VSCode shows:

The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16
`output` is deprecated. Use `report` or `code` instead.

Link to Minimal Reproducible Example

https://github.com/jorisw/stylelint-repo

Code Snippet

No response

Stylelint Configuration

{
  "ignoreFiles": ["**/*"],
  "overrides": [
    {
      "files": ["**/*.css"],
      "extends": ["stylelint-config-standard", "stylelint-config-prettier"],
      "rules": {}
    }
  ],
  "rules": {
    "selector-class-pattern": null,
    "no-descending-specificity": null
  }
}

Extension Configuration

{
  "stylelint.packageManager": "yarn",
  "stylelint.reportInvalidScopeDisables": true,
  "stylelint.reportNeedlessDisables": true,
  "stylelint.stylelintPath": "node_modules/stylelint/lib/index.cjs",
  "stylelint.validate": ["css", "scss", "postcss"]
}

Actual Behaviour

No file contents are altered if I make a css or css file messy and save the file.

The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16
`output` is deprecated. Use `report` or `code` instead.

Expected Behaviour

Expect saving the file to reformat the file

Logs

[Debug - 9:34:12 a.m.] [language-server:code-action] Received onCodeAction | uri: "file.scss" context: {"diagnostics":[],"only":["source.fixAll.stylelint"]}
[Debug - 9:34:12 a.m.] [language-server] Returning cached options | resource: "file.scss"
[Debug - 9:34:12 a.m.] [language-server:code-action] Creating code actions | only: ["source.fixAll.stylelint"]
[Debug - 9:34:12 a.m.] [language-server:code-action] Creating "source-fix-all" code action
[Debug - 9:34:12 a.m.] [language-server] Returning cached options | resource: "file.scss"
The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16
The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16
[Debug - 9:34:12 a.m.] [language-server] Running Stylelint | options: {"fix":true,"config":{},"ignoreDisables":false,"reportDescriptionlessDisables":false,"reportNeedlessDisables":true,"reportInvalidScopeDisables":true,"ignorePath":".stylelintignore","code":"...","codeFilename":"file.scss"}
output is deprecated. Use report or code instead.
[Debug - 9:34:12 a.m.] [language-server] Fixes retrieved | uri: "file.scss" edits: []
[Debug - 9:34:12 a.m.] [language-server:code-action] Returning code actions | actions: []
[Debug - 9:34:12 a.m.] [language-server:formatter] Received onDocumentFormatting | textDocument: {"uri":"file.scss"} options: {"tabSize":2,"insertSpaces":true}
[Debug - 9:34:12 a.m.] [language-server] Returning cached options | resource: "file.scss"
[Debug - 9:34:12 a.m.] [language-server:formatter] Formatting document | uri: "file.scss" linterOptions: {"config":{"rules":{"indentation":[2]}}}
[Debug - 9:34:12 a.m.] [language-server] Returning cached options | resource: "file.scss"
[Debug - 9:34:12 a.m.] [language-server:formatter] Returning fixes | uri: "file.scss" fixes: {}
The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16
The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16
output is deprecated. Use report or code instead.
[Debug - 9:34:12 a.m.] [language-server] Running Stylelint | options: {"config":{},"fix":true,"ignoreDisables":false,"reportDescriptionlessDisables":false,"reportNeedlessDisables":true,"reportInvalidScopeDisables":true,"ignorePath":".stylelintignore","code":"...","codeFilename":"file.scss"}
[Debug - 9:34:12 a.m.] [language-server] Fixes retrieved | uri: "file.scss" edits: []

Stylelint Version

v16.0.0

vscode-stylelint Version

v1.3.0

Node.js Version

v18.7.1

Operating System

macOS 14.3.1

Windows Subsystem for Linux

No response

Code of Conduct

  • I agree to follow vscode-stylelint's Code of Conduct
@jorisw jorisw closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2024
@shooftie
Copy link

shooftie commented Apr 19, 2024

I am getting this error having upgraded to v16. I am right in thinking that this is not an issue with my config but is originating from the extension itself?

Logs here
[Info  - 14:00:24] [language-server] Registering module | module: "auto-fix"
[Info  - 14:00:24] [language-server] Module registered | module: "auto-fix"
[Info  - 14:00:24] [language-server] Registering module | module: "code-action"
[Info  - 14:00:24] [language-server] Module registered | module: "code-action"
[Info  - 14:00:24] [language-server] Registering module | module: "completion"
[Info  - 14:00:24] [language-server] Module registered | module: "completion"
[Info  - 14:00:24] [language-server] Registering module | module: "formatter"
[Info  - 14:00:24] [language-server] Module registered | module: "formatter"
[Info  - 14:00:24] [language-server] Registering module | module: "old-stylelint-warning"
[Info  - 14:00:24] [language-server] Module registered | module: "old-stylelint-warning"
[Info  - 14:00:24] [language-server] Registering module | module: "validator"
[Info  - 14:00:24] [language-server] Module registered | module: "validator"
[Info  - 14:00:24] [language-server] Starting language server
[Info  - 14:00:24] [language-server] Registering handlers
[Info  - 14:00:24] [language-server] Handlers registered
[Info  - 14:00:24] [language-server] Language server started
[Error - 14:00:27] (node:86146) [stylelint:002] DeprecationWarning: The CommonJS Node.js API is deprecated.
See https://stylelint.io/migration-guide/to-16
(Use `Code Helper (Plugin) --trace-deprecation ...` to show where the warning was created)
[Error - 14:00:27] (node:86146) [stylelint:002] DeprecationWarning: The CommonJS Node.js API is deprecated.
See https://stylelint.io/migration-guide/to-16
[Error - 14:00:29] (node:86146) [stylelint:003] DeprecationWarning: `output` is deprecated.
Use `report` or `code` instead.
[Error - 14:00:29] (node:86146) [stylelint:003] DeprecationWarning: `output` is deprecated.
Use `report` or `code` instead.

@Mouvedia
Copy link
Member

I don't know if that helps but Node v21.3.0 supports --disable-warning=DeprecationWarning.
see https://nodejs.org/api/cli.html#--disable-warningcode-or-type

@zqq-nuli
Copy link

I am very curious, why can't the log point out which line the error occurred, and in which configuration file, if this is possible, it will reduce the difficulty of troubleshooting. I have another project that solved this problem by accident. Although it still reports this exception, it can at least help me format my less file when I save the project.

@paoloricciuti
Copy link

Does this issue being closed means there's no plan to support v16 with the extension?

@shangxinbo
Copy link

Why was this issue closed?

@Mouvedia
Copy link
Member

why can't the log point out which line the error occurred, and in which configuration file, if this is possible, it will reduce the difficulty of troubleshooting.

stylelint/stylelint#7854 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants