Skip to content
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
3 changes: 2 additions & 1 deletion packages/rspack-test-tools/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"types": ["./rstest.d.ts"]
"types": ["./rstest.d.ts"],
"noUnusedParameters": false
},
"include": ["src"],
"exclude": ["viewer"],
Expand Down
6 changes: 3 additions & 3 deletions packages/rspack/etc/core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ export class EntryOptionPlugin {
// (undocumented)
static applyEntryOption(compiler: Compiler, context: string, entry: EntryNormalized): void;
// (undocumented)
static entryDescriptionToOptions(compiler: Compiler, name: string, desc: EntryDescriptionNormalized): EntryOptions;
static entryDescriptionToOptions(_compiler: Compiler, name: string, desc: EntryDescriptionNormalized): EntryOptions;
}

// @public
Expand Down Expand Up @@ -6335,9 +6335,9 @@ type ResolveOptionsWithDependencyType = Resolve & {
class Resolver {
constructor(binding: binding.JsResolver);
// (undocumented)
resolve(context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
resolve(_context: object, path: string, request: string, resolveContext: ResolveContext, callback: ResolveCallback): void;
// (undocumented)
resolveSync(context: object, path: string, request: string): string | false;
resolveSync(_context: object, path: string, request: string): string | false;
}

// @public (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/Compilation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
options: liteTapable.Options,
fn: liteTapable.FnAsync<T, void>
) => {
processAssetsHook.tapAsync(getOptions(options), (assets, callback) =>
processAssetsHook.tapAsync(getOptions(options), (_assets, callback) =>
(fn as any)(...getArgs(), callback)
);
},
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/FileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS {
position,
length
},
(err, bytesRead, buffer) => {
(err, _bytesRead, buffer) => {
if (err) {
resolve(err);
} else {
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/src/Resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export class Resolver {
this.#binding = binding;
}

resolveSync(context: object, path: string, request: string): string | false {
resolveSync(_context: object, path: string, request: string): string | false {
return this.#binding.resolveSync(path, request) ?? false;
}

resolve(
context: object,
_context: object,
path: string,
request: string,
resolveContext: ResolveContext,
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/src/config/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ function getRawParserOptionsMap(
return Object.fromEntries(
Object.entries(parser)
.map(([k, v]) => [k, getRawParserOptions(v, k)])
.filter(([k, v]) => v !== undefined)
.filter(([_, v]) => v !== undefined)
);
}

Expand All @@ -482,7 +482,7 @@ function getRawGeneratorOptionsMap(
return Object.fromEntries(
Object.entries(generator)
.map(([k, v]) => [k, getRawGeneratorOptions(v, k)])
.filter(([k, v]) => v !== undefined)
.filter(([_, v]) => v !== undefined)
);
}

Expand Down
12 changes: 3 additions & 9 deletions packages/rspack/src/config/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ export const applyRspackOptionsDefaults = (
(Array.isArray(target) &&
target.some(target => target.startsWith("browserslist"))),
outputModule: options.experiments.outputModule,
development,
entry: options.entry,
futureDefaults: options.experiments.futureDefaults!
entry: options.entry
});
// bundlerInfo is affected by outputDefaults so must be executed after outputDefaults
applybundlerInfoDefaults(
Expand Down Expand Up @@ -587,17 +585,13 @@ const applyOutputDefaults = (
outputModule,
targetProperties: tp,
isAffectedByBrowserslist,
development,
entry,
futureDefaults
entry
}: {
context: Context;
outputModule?: boolean;
targetProperties: any;
isAffectedByBrowserslist: boolean;
development: boolean;
entry: EntryNormalized;
futureDefaults: boolean;
}
) => {
const getLibraryName = (library: Library): string => {
Expand All @@ -622,7 +616,7 @@ const applyOutputDefaults = (
F(output, "uniqueName", () => {
const libraryName = getLibraryName(output.library).replace(
/^\[(\\*[\w:]+\\*)\](\.)|(\.)\[(\\*[\w:]+\\*)\](?=\.|$)|\[(\\*[\w:]+\\*)\]/g,
(m, a, d1, d2, b, c) => {
(_, a, d1, d2, b, c) => {
const content = a || b || c;
return content.startsWith("\\") && content.endsWith("\\")
? `${d2 || ""}[${content.slice(1, -1)}]${d1 || ""}`
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/container/ModuleFederationPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function collectManifestExposes(
type ExposesConfigInput = { import: string | string[]; name?: string };
const parsed = parseOptions<ExposesConfigInput, NormalizedExpose>(
exposes,
(value, key) => ({
value => ({
import: Array.isArray(value) ? value : [value],
name: undefined
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/lib/EntryOptionPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class EntryOptionPlugin {
* @returns options for the entry
*/
static entryDescriptionToOptions(
compiler: Compiler,
_compiler: Compiler,
name: string,
desc: EntryDescriptionNormalized
): EntryOptions {
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack/src/stats/DefaultStatsFactoryPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ const SIMPLE_EXTRACTORS: SimpleExtractors = {
object,
compilation,
context: KnownStatsFactoryContext,
options: NormalizedStatsOptions,
_options: NormalizedStatsOptions,
factory
) => {
const { type, getStatsCompilation } = context;
Expand Down
4 changes: 2 additions & 2 deletions packages/rspack/src/stats/DefaultStatsPresetPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ const NORMALIZER = {
const array = !Array.isArray(value) ? (value ? [value] : []) : value;
return array.map(filter => {
if (typeof filter === "string") {
return (warning: StatsError, warningString: string) =>
return (_warning: StatsError, warningString: string) =>
warningString.includes(filter);
}
if (filter instanceof RegExp) {
return (warning: StatsError, warningString: string) =>
return (_warning: StatsError, warningString: string) =>
filter.test(warningString);
}
if (typeof filter === "function") {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"checkJs": true,
"strict": true,
"skipLibCheck": true,
"noUnusedLocals": true
"noUnusedLocals": true,
"noUnusedParameters": true
}
}
Loading