Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogobbosouza committed Aug 19, 2023
1 parent ad95ed7 commit 56b59bd
Show file tree
Hide file tree
Showing 23 changed files with 2,860 additions and 2,431 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ type outputReport =
| string
| ((
results: Array<import('eslint').ESLint.LintResult>,
data?: import('eslint').ESLint.LintResultData | undefined
data?: import('eslint').ESLint.LintResultData | undefined,
) => string)
)
| undefined;
Expand Down
5,167 changes: 2,798 additions & 2,369 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,43 +50,43 @@
"webpack": "^5.0.0"
},
"dependencies": {
"@types/eslint": "^8.40.0",
"jest-worker": "^29.5.0",
"@types/eslint": "^8.44.2",
"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.6",
"@types/fs-extra": "^9.0.13",
"@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/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",
"fs-extra": "^10.1.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import": "^2.28.1",
"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",
"prettier": "^2.8.8",
"prettier": "^3.0.2",
"standard-version": "^9.5.0",
"typescript": "^5.1.6",
"webpack": "^5.88.1"
"webpack": "^5.88.2"
},
"keywords": [
"eslint",
Expand Down
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class ESLintWebpackPlugin {

const excludedFiles = parseFiles(
this.options.exclude || [],
this.getContext(compiler)
this.getContext(compiler),
);
const resourceQueries = arrify(this.options.resourceQueryExclude || []);
const excludedResourceQueries = resourceQueries.map((item) =>
item instanceof RegExp ? item : new RegExp(item)
item instanceof RegExp ? item : new RegExp(item),
);

const options = {
Expand All @@ -62,7 +62,7 @@ class ESLintWebpackPlugin {
// 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 All @@ -87,7 +87,7 @@ class ESLintWebpackPlugin {
async run(compiler, options, wanted, exclude) {
// @ts-ignore
const isCompilerHooked = compiler.hooks.compilation.taps.find(
({ name }) => name === this.key
({ name }) => name === this.key,
);

if (isCompilerHooked) return;
Expand Down Expand Up @@ -128,7 +128,7 @@ class ESLintWebpackPlugin {
isMatch(file, wanted, { dot: true }) &&
!isMatch(file, exclude, { dot: true });
const isQueryNotExclude = options.resourceQueryExclude.every(
(reg) => !reg.test(query)
(reg) => !reg.test(query),
);

if (isFileNotListed && isFileWanted && isQueryNotExclude) {
Expand Down
10 changes: 5 additions & 5 deletions src/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function linter(key, options, compilation) {
// @ts-ignore
compilation.errors.push(new ESLintError(e.message));
return [];
})
}),
);
}

Expand All @@ -77,7 +77,7 @@ function linter(key, options, compilation) {
let results = await removeIgnoredWarnings(
eslint,
// 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 All @@ -96,7 +96,7 @@ function linter(key, options, compilation) {
const formatter = await loadFormatter(eslint, options.formatter);
const { errors, warnings } = await formatResults(
formatter,
parseResults(options, results)
parseResults(options, results),
);

return {
Expand Down Expand Up @@ -189,7 +189,7 @@ function parseResults(options, results) {
results.forEach((file) => {
if (fileHasErrors(file)) {
const messages = file.messages.filter(
(message) => options.emitError && message.severity === 2
(message) => options.emitError && message.severity === 2,
);

if (messages.length > 0) {
Expand All @@ -199,7 +199,7 @@ function parseResults(options, results) {

if (fileHasWarnings(file)) {
const messages = file.messages.filter(
(message) => options.emitWarning && message.severity === 1
(message) => options.emitWarning && message.severity === 1,
);

if (messages.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
2 changes: 1 addition & 1 deletion test/autofix.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ describe('autofix stop', () => {
`);
done();
});
}
},
);
});
4 changes: 2 additions & 2 deletions test/child-compiler.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ChildPlugin {
webpack.EntryOptionPlugin.applyEntryOption(
childCompiler,
compilation.compiler.context,
this.options.entry
this.options.entry,
);
childCompiler.runAsChild(() => {
callback();
Expand All @@ -31,7 +31,7 @@ describe('child compiler', () => {
entry: {
child: './child-entry',
},
})
}),
);
webpack(config).run((err, stats) => {
expect(err).toBeNull();
Expand Down
2 changes: 1 addition & 1 deletion test/eslintignore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('eslintignore', () => {
expect(err).toBeNull();
expect(stats.hasWarnings()).toBe(false);
expect(
stats.compilation.errors.filter((x) => x instanceof ESLintError)
stats.compilation.errors.filter((x) => x instanceof ESLintError),
).toEqual([]);

done();
Expand Down
2 changes: 1 addition & 1 deletion test/fail-on-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('fail on config', () => {
expect(stats.hasErrors()).toBe(true);
expect(errors).toHaveLength(1);
expect(errors[0].message).toMatch(
/ESLint configuration in --config is invalid/i
/ESLint configuration in --config is invalid/i,
);
done();
});
Expand Down
4 changes: 2 additions & 2 deletions test/formatter-custom.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('formatter eslint', () => {
expect(stats.hasErrors()).toBe(true);
expect(stats.compilation.errors[0].message).toBeTruthy();
const message = JSON.parse(
stats.compilation.errors[0].message.replace('[eslint] ', '')
stats.compilation.errors[0].message.replace('[eslint] ', ''),
);
expect(message.formatter).toEqual('mock');
expect(message.results).toBeTruthy();
Expand All @@ -29,7 +29,7 @@ describe('formatter eslint', () => {
expect(stats.hasErrors()).toBe(true);
expect(stats.compilation.errors[0].message).toBeTruthy();
const message = JSON.parse(
stats.compilation.errors[0].message.replace('[eslint] ', '')
stats.compilation.errors[0].message.replace('[eslint] ', ''),
);
expect(message.formatter).toEqual('mock');
expect(message.results).toBeTruthy();
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 ESLintPlugin({ ignore: false, exclude: 'error.js' }),
new ESLintPlugin({ ignore: false, exclude: 'error.js' }),
],
}
},
);

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

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

compiler.run((err, stats) => {
Expand Down
2 changes: 1 addition & 1 deletion test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('query', () => {
'alias-ignore': false,
},
},
}
},
);

compiler.run((err, stats) => {
Expand Down
2 changes: 1 addition & 1 deletion test/resource-query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('resource-query', () => {
},
{
module: { rules: [{ resourceQuery: /media/, type: 'asset/source' }] },
}
},
);

compiler.run((err, stats) => {
Expand Down
2 changes: 1 addition & 1 deletion test/symbols.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('symbols', () => {
const compiler = pack(
'symbols',
{},
{ context: join(__dirname, 'fixtures/[symbols]') }
{ context: join(__dirname, 'fixtures/[symbols]') },
);

compiler.run((err, stats) => {
Expand Down
2 changes: 1 addition & 1 deletion test/threads.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Threading', () => {
},
{
outputFixes: jest.fn(),
}
},
),
};
});
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.js'],
['js', 'cjs', 'mjs']
)
['js', 'cjs', 'mjs'],
),
).toMatchInlineSnapshot(`
[
"/path/to/code/**/*.{js,cjs,mjs}",
Expand Down
8 changes: 4 additions & 4 deletions test/watch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import pack from './utils/pack';
const target = join(__dirname, 'fixtures', 'watch-entry.js');
const target2 = join(__dirname, 'fixtures', 'watch-leaf.js');
const targetExpectedPattern = expect.stringMatching(
target.replace(/\\/g, '\\\\')
target.replace(/\\/g, '\\\\'),
);

describe('watch', () => {
Expand Down Expand Up @@ -54,7 +54,7 @@ describe('watch', () => {
writeFileSync(target2, 'let bar = false;\n');
writeFileSync(
target,
"const x = require('./watch-leaf')\n\nconst foo = false;\n"
"const x = require('./watch-leaf')\n\nconst foo = false;\n",
);
}

Expand All @@ -75,7 +75,7 @@ describe('watch', () => {

writeFileSync(
target,
"const x = require('./watch-leaf')\nconst foo = 0\n"
"const x = require('./watch-leaf')\nconst foo = 0\n",
);
}

Expand All @@ -96,7 +96,7 @@ describe('watch', () => {

writeFileSync(
target,
'/* eslint-disable no-unused-vars */\nconst foo = false;\n'
'/* eslint-disable no-unused-vars */\nconst foo = false;\n',
);
}

Expand Down
4 changes: 2 additions & 2 deletions types/getESLint.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function loadESLint(options: Options): Linter;
export function loadESLintThreaded(
key: string | undefined,
poolSize: number,
options: Options
options: Options,
): Linter;
/**
* @param {string|undefined} key
Expand All @@ -43,6 +43,6 @@ export function loadESLintThreaded(
*/
export function getESLint(
key: string | undefined,
{ threads, ...options }: Options
{ threads, ...options }: Options,
): Linter;
import { Worker as JestWorker } from 'jest-worker';
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare class ESLintWebpackPlugin {
resourceQueryExclude: RegExp[];
},
wanted: string[],
exclude: string[]
exclude: string[],
): Promise<void>;
/**
* @param {Compiler} compiler
Expand Down
Loading

0 comments on commit 56b59bd

Please sign in to comment.