Skip to content

chore: upgrade dependencies to the latest version #337

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

Merged
merged 2 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,352 changes: 3,018 additions & 2,334 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,46 +51,46 @@
},
"dependencies": {
"globby": "^11.1.0",
"jest-worker": "^29.5.0",
"jest-worker": "^29.6.2",
"micromatch": "^4.0.5",
"normalize-path": "^3.0.0",
"schema-utils": "^4.2.0"
},
"devDependencies": {
"@babel/cli": "^7.22.5",
"@babel/core": "^7.22.5",
"@babel/preset-env": "^7.22.5",
"@commitlint/cli": "^17.6.6",
"@commitlint/config-conventional": "^17.6.5",
"@babel/cli": "^7.22.10",
"@babel/core": "^7.22.10",
"@babel/preset-env": "^7.22.10",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@types/file-entry-cache": "^5.0.2",
"@types/fs-extra": "^9.0.13",
"@types/fs-extra": "^11.0.1",
"@types/micromatch": "^4.0.2",
"@types/node": "^18.16.3",
"@types/node": "^20.5.1",
"@types/normalize-path": "^3.0.0",
"@types/webpack": "^5.28.1",
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^29.5.0",
"babel-jest": "^29.6.2",
"chokidar": "^3.5.3",
"cross-env": "^7.0.3",
"cspell": "^6.31.1",
"cspell": "^7.0.0",
"del": "^6.1.1",
"del-cli": "^4.0.1",
"eslint": "^8.44.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"file-loader": "^6.2.0",
"fs-extra": "^10.1.0",
"fs-extra": "^11.1.1",
"husky": "^8.0.3",
"jest": "^29.5.0",
"lint-staged": "^13.2.3",
"jest": "^29.6.2",
"lint-staged": "^14.0.0",
"npm-run-all": "^4.1.5",
"postcss-scss": "^4.0.6",
"prettier": "^2.8.8",
"postcss-scss": "^4.0.7",
"prettier": "^3.0.2",
"standard-version": "^9.5.0",
"stylelint": "^15.9.0",
"stylelint": "^15.10.3",
"typescript": "^5.1.6",
"webpack": "^5.88.1"
"webpack": "^5.88.2"
},
"keywords": [
"stylelint",
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class StylelintWebpackPlugin {
// execute the linter on the build
if (!this.options.lintDirtyModulesOnly) {
compiler.hooks.run.tapPromise(this.key, (c) =>
this.run(c, options, wanted, exclude)
this.run(c, options, wanted, exclude),
);
}

Expand Down Expand Up @@ -109,7 +109,7 @@ class StylelintWebpackPlugin {
({ stylelint, lint, isPathIgnored, report, threads } = linter(
this.key,
options,
compilation
compilation,
));
} catch (e) {
compilation.errors.push(e);
Expand All @@ -125,7 +125,7 @@ class StylelintWebpackPlugin {
? Array.from(compiler.modifiedFiles).filter(
(file) =>
isMatch(file, wanted, { dot: true }) &&
!isMatch(file, exclude, { dot: true })
!isMatch(file, exclude, { dot: true }),
)
: globby.sync(wanted, { dot: true, ignore: exclude })
).map(async (file) => {
Expand All @@ -134,7 +134,7 @@ class StylelintWebpackPlugin {
} catch (e) {
return file;
}
})
}),
)
).filter((file) => file !== false);

Expand Down
12 changes: 6 additions & 6 deletions src/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function linter(key, options, compilation) {
try {
({ stylelint, isPathIgnored, lintFiles, cleanup, threads } = getStylelint(
key,
options
options,
));
} catch (e) {
throw new StylelintError(e.message);
Expand All @@ -78,15 +78,15 @@ function linter(key, options, compilation) {
// @ts-ignore
compilation.errors.push(new StylelintError(e.message));
return [];
})
}),
);
}

async function report() {
// Filter out ignored files.
let results = removeIgnoredWarnings(
// Get the current results, resetting the rawResults to empty
await flatten(rawResults.splice(0, rawResults.length))
await flatten(rawResults.splice(0, rawResults.length)),
);

await cleanup();
Expand Down Expand Up @@ -118,7 +118,7 @@ function linter(key, options, compilation) {
const { errors, warnings } = formatResults(
formatter,
parseResults(options, results),
returnValue
returnValue,
);

return {
Expand Down Expand Up @@ -211,7 +211,7 @@ function parseResults(options, results) {

results.forEach((file) => {
const fileErrors = file.warnings.filter(
(message) => options.emitError && message.severity === 'error'
(message) => options.emitError && message.severity === 'error',
);

if (fileErrors.length > 0) {
Expand All @@ -222,7 +222,7 @@ function parseResults(options, results) {
}

const fileWarnings = file.warnings.filter(
(message) => options.emitWarning && message.severity === 'warning'
(message) => options.emitWarning && message.severity === 'warning',
);

if (fileWarnings.length > 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function arrify(value) {
*/
function parseFiles(files, context) {
return arrify(files).map((/** @type {string} */ file) =>
normalizePath(resolve(context, file))
normalizePath(resolve(context, file)),
);
}

Expand All @@ -79,7 +79,7 @@ function parseFoldersToGlobs(patterns, extensions = []) {
/[/\\]*?$/u,
`/**${
extensionsGlob ? `/*.${prefix + extensionsGlob + postfix}` : ''
}`
}`,
);
}
} catch (_) {
Expand Down
6 changes: 3 additions & 3 deletions test/multiple-instances.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('multiple instances', () => {
new StylelintPlugin({ exclude: 'error.scss' }),
new StylelintPlugin({ exclude: 'error.scss' }),
],
}
},
);

compiler.run((err, stats) => {
Expand All @@ -32,7 +32,7 @@ describe('multiple instances', () => {
new StylelintPlugin({ exclude: 'good.scss' }),
new StylelintPlugin({ exclude: 'error.scss' }),
],
}
},
);

compiler.run((err, stats) => {
Expand All @@ -52,7 +52,7 @@ describe('multiple instances', () => {
new StylelintPlugin({ exclude: 'error.scss' }),
new StylelintPlugin({ exclude: 'good.scss' }),
],
}
},
);

compiler.run((err, stats) => {
Expand Down
4 changes: 2 additions & 2 deletions test/threads.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ describe('Threading', () => {
try {
const [good, bad] = await Promise.all([
threaded.lintFiles(
normalizePath(join(__dirname, 'fixtures/good/test.scss'))
normalizePath(join(__dirname, 'fixtures/good/test.scss')),
),
threaded.lintFiles(
normalizePath(join(__dirname, 'fixtures/error/test.scss'))
normalizePath(join(__dirname, 'fixtures/error/test.scss')),
),
]);
expect(good[0].errored).toBe(false);
Expand Down
10 changes: 5 additions & 5 deletions test/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ test('parseFiles should return relative files from context', () => {
expect(
parseFiles(
['**/*', '../package-a/src/**/', '../package-b/src/**/'],
'main/src'
)
'main/src',
),
).toEqual(
expect.arrayContaining([
expect.stringContaining('main/src/**/*'),
expect.stringContaining('main/package-a/src/**'),
expect.stringContaining('main/package-b/src/**'),
])
]),
);
});

Expand All @@ -45,8 +45,8 @@ test('parseFoldersToGlobs should return globs for folders', () => {
expect(
parseFoldersToGlobs(
[withoutSlash, withSlash, '/some/file.scss'],
['scss', 'css', 'sass']
)
['scss', 'css', 'sass'],
),
).toMatchInlineSnapshot(`
[
"/path/to/code/**/*.{scss,css,sass}",
Expand Down
4 changes: 2 additions & 2 deletions types/getStylelint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export = getStylelint;
*/
declare function getStylelint(
key: string | undefined,
{ threads, ...options }: Options
{ threads, ...options }: Options,
): Linter;
declare namespace getStylelint {
export {
Expand Down Expand Up @@ -45,7 +45,7 @@ type Formatter = import('stylelint').Formatter;
type FormatterType = import('stylelint').FormatterType;
type isPathIgnored = (
stylelint: Stylelint,
filePath: string
filePath: string,
) => Promise<boolean>;
type AsyncTask = () => Promise<void>;
type LintTask = (files: string | string[]) => Promise<LintResult[]>;
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ declare class StylelintWebpackPlugin {
compiler: Compiler,
options: Options,
wanted: string[],
exclude: string[]
exclude: string[],
): Promise<void>;
startTime: number;
prevTimestamps: Map<any, any>;
Expand Down
2 changes: 1 addition & 1 deletion types/linter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export = linter;
declare function linter(
key: string | undefined,
options: Options,
compilation: Compilation
compilation: Compilation,
): {
stylelint: Stylelint;
isPathIgnored: getStylelint.isPathIgnored;
Expand Down
2 changes: 1 addition & 1 deletion types/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ export function getOptions(pluginOptions: Options): Partial<PluginOptions>;
* @returns {Partial<StylelintOptions>}
*/
export function getStylelintOptions(
pluginOptions: Options
pluginOptions: Options,
): Partial<StylelintOptions>;
4 changes: 2 additions & 2 deletions types/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
*/
export function arrify<T>(
value: T
value: T,
): T extends null | undefined
? []
: T extends string
Expand All @@ -37,7 +37,7 @@ export function parseFiles(files: string | string[], context: string): string[];
*/
export function parseFoldersToGlobs(
patterns: string | string[],
extensions?: string | string[]
extensions?: string | string[],
): string[];
/**
*
Expand Down