Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
fpetrakov committed Mar 15, 2024
1 parent 80877ce commit 7e5c3cd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
10 changes: 6 additions & 4 deletions lib/augmentConfig.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const node_path = require('node:path');
const globjoin = require('globjoin');
const micromatch = require('micromatch');
const normalizePath = require('normalize-path');
const process = require('process');
const process = require('node:process');
const configurationError = require('./utils/configurationError.cjs');
const dynamicImport = require('./utils/dynamicImport.cjs');
const getModulePath = require('./utils/getModulePath.cjs');
Expand Down Expand Up @@ -325,9 +325,11 @@ async function addPluginFunctions(config, { quietDeprecationWarnings }) {

// NOTE: This '.cjs' check is limited. Some CommonJS plugins may have the '.js' extension.
if (!quietDeprecationWarnings && pluginLookup.endsWith('.cjs')) {
process.emitWarning(
`CommonJS plugins are deprecated ("${pluginLookup}"). See https://stylelint.io/migration-guide/to-16`,
);
process.emitWarning(`CommonJS plugins are deprecated ("${pluginLookup}").`, {
type: 'DeprecationWarning',
code: 'stylelint:001',
detail: 'See https://stylelint.io/migration-guide/to-16'
});
}
} else {
pluginImport = pluginLookup;
Expand Down
6 changes: 5 additions & 1 deletion lib/createStylelint.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ const STOP_DIR = IS_TEST ? process.cwd() : undefined;
function createStylelint(options = {}) {

if (!options.quietDeprecationWarnings) {
process.emitWarning('The CommonJS Node.js API is deprecated. See https://stylelint.io/migration-guide/to-16');
process.emitWarning('The CommonJS Node.js API is deprecated.', {
type: 'DeprecationWarning',
code: 'stylelint:002',
detail: 'See https://stylelint.io/migration-guide/to-16'
});
}

const cwd = options.cwd || process.cwd();
Expand Down
6 changes: 5 additions & 1 deletion lib/prepareReturnValue.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ function prepareReturnValue(stylelintResults, maxWarnings, formatter, cwd) {
// TODO: Deprecated. Remove in the next major version.
get output() {
if (!this._outputWarned) {
process.emitWarning('`output` is deprecated. Use `report` or `code` instead.');
process.emitWarning('`output` is deprecated.', {
type: 'DeprecationWarning',
code: 'stylelint:003',
detail: 'Use `report` or `code` instead.'
});
this._outputWarned = true;
}

Expand Down

0 comments on commit 7e5c3cd

Please sign in to comment.