Skip to content

Deprecate CommonJS Node.js API#7353

Merged
ybiquitous merged 14 commits intomainfrom
issue-7340
Nov 27, 2023
Merged

Deprecate CommonJS Node.js API#7353
ybiquitous merged 14 commits intomainfrom
issue-7340

Conversation

@ybiquitous
Copy link
Copy Markdown
Member

@ybiquitous ybiquitous commented Nov 21, 2023

Which issue, if any, is this issue related to?

Closes #7340

Is there anything in the PR that needs further explanation?

This change deprecates the use of CommonJS Node.js API and updates the migration guide to 16.0.0.

Stylelint will show the deprecation warning when using CommonJS API. This deprecation code is generated by a Rollup custom plugin.

Outdated description of STYLELINT_CJS_IGNORE_WARNING

Examples:

$ node -e 'import("stylelint")'
(no output)

$ node -e 'require("stylelint")'
The CJS build of Stylelint's Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16

$ STYLELINT_CJS_IGNORE_WARNING=true node -e 'require("stylelint")'
(no output)

Why not use quietDeprecationWarnings

It's difficult to write a Rollup plugin code using the quietDeprecationWarnings option in this case. But I'm open to feedback for a better solution.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate CommonJS plugins

3 participants