Skip to content

Commit dc1fde3

Browse files
dbajpeyishakyShane
andauthored
support noUnusedParameters (#1579)
Co-authored-by: Shane Osbourne <[email protected]>
1 parent cd85139 commit dc1fde3

File tree

36 files changed

+80
-94
lines changed

36 files changed

+80
-94
lines changed

.github/scripts/diff-directories.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function upperCaseFirstLetter(string) {
2626
return string.charAt(0).toUpperCase() + string.slice(1);
2727
}
2828

29-
function displayDiffs(dir1Files, dir2Files, isOpen) {
29+
function displayDiffs(dir1Files, dir2Files) {
3030
const rollupGrouping = {};
3131
/**
3232
* Rolls up multiple files with the same diff into a single entry
@@ -79,13 +79,13 @@ function displayDiffs(dir1Files, dir2Files, isOpen) {
7979
}
8080
}
8181
outString += '\n\n' + rollup.string;
82-
return renderDetails(title, outString, isOpen);
82+
return renderDetails(title, outString);
8383
})
8484
.join('\n');
8585
return outString;
8686
}
8787

88-
function renderDetails(section, text, isOpen) {
88+
function renderDetails(section, text) {
8989
if (section === 'dist') {
9090
section = 'apple';
9191
}
@@ -120,5 +120,5 @@ sortFiles(readFilesRecursively(dir1 + sourcesOutput), 'dir1');
120120
sortFiles(readFilesRecursively(dir2 + sourcesOutput), 'dir2');
121121

122122
// console.log(Object.keys(files))
123-
const fileOut = displayDiffs(sections.dir1, sections.dir2, true);
123+
const fileOut = displayDiffs(sections.dir1, sections.dir2);
124124
console.log(fileOut);

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default tseslint.config(
1111
'**/build/',
1212
'**/docs/',
1313
'injected/lib',
14+
'injected/playwright-report/',
1415
'Sources/ContentScopeScripts/dist/',
1516
'injected/integration-test/extension/contentScope.js',
1617
'injected/integration-test/test-pages/duckplayer/scripts/dist',

injected/src/content-feature.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default class ContentFeature extends ConfigFeature {
137137
return processAttr(configSetting, defaultValue);
138138
}
139139

140-
init(args) {}
140+
init(_args) {}
141141

142142
callInit(args) {
143143
const mark = this.monitor.mark(this.name + 'CallInit');
@@ -153,7 +153,7 @@ export default class ContentFeature extends ConfigFeature {
153153
this.platform = args.platform;
154154
}
155155

156-
load(args) {}
156+
load(_args) {}
157157

158158
/**
159159
* This is a wrapper around `this.messaging.notify` that applies the
@@ -237,7 +237,7 @@ export default class ContentFeature extends ConfigFeature {
237237
if (typeof descriptorProp === 'function') {
238238
const addDebugFlag = this.addDebugFlag.bind(this);
239239
const wrapper = new Proxy(descriptorProp, {
240-
apply(target, thisArg, argumentsList) {
240+
apply(_, thisArg, argumentsList) {
241241
addDebugFlag();
242242
return Reflect.apply(descriptorProp, thisArg, argumentsList);
243243
},

injected/src/features/broker-protection/actions/build-url-transforms.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const optionalTransforms = new Map([
6161
['defaultIfEmpty', (value, argument) => value || argument || ''],
6262
[
6363
'ageRange',
64-
(value, argument, action) => {
64+
(value, _, action) => {
6565
if (!action.ageRange) return value;
6666
const ageNumber = Number(value);
6767
// find matching age range
@@ -142,7 +142,7 @@ export function processTemplateStringWithUserData(input, action, userData) {
142142
* Note: this regex covers both pathname + query params.
143143
* This is why we're handling both encoded and un-encoded.
144144
*/
145-
return String(input).replace(/\$%7B(.+?)%7D|\$\{(.+?)}/g, (match, encodedValue, plainValue) => {
145+
return String(input).replace(/\$%7B(.+?)%7D|\$\{(.+?)}/g, (_, encodedValue, plainValue) => {
146146
const comparison = encodedValue ?? plainValue;
147147
const [dataKey, ...transforms] = comparison.split(/\||%7C/);
148148
const data = userData[dataKey];

injected/src/features/broker-protection/actions/extract.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export function extractProfiles(action, userData, root = document) {
9191

9292
return {
9393
results: profilesElementList.map((element) => {
94-
const elementFactory = (key, value) => {
94+
const elementFactory = (_, value) => {
9595
return value?.findElements
9696
? cleanArray(getElements(element, value.selector))
9797
: cleanArray(getElement(element, value.selector) || getElementMatches(element, value.selector));

injected/src/features/broker-protection/types.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ export class ProfileResult {
7676
*/
7777
export class Extractor {
7878
/**
79-
* @param {string[]} noneEmptyStringArray
80-
* @param {import("./actions/extract").ExtractorParams} extractorParams
79+
* @param {string[]} _noneEmptyStringArray
80+
* @param {import("./actions/extract").ExtractorParams} _extractorParams
8181
* @return {JsonValue}
8282
*/
8383

84-
extract(noneEmptyStringArray, extractorParams) {
84+
extract(_noneEmptyStringArray, _extractorParams) {
8585
throw new Error('must implement extract');
8686
}
8787
}
@@ -91,12 +91,12 @@ export class Extractor {
9191
*/
9292
export class AsyncProfileTransform {
9393
/**
94-
* @param {Record<string, any>} profile - The current profile value
95-
* @param {Record<string, any>} profileParams - the original action params from `action.profile`
94+
* @param {Record<string, any>} _profile - The current profile value
95+
* @param {Record<string, any>} _profileParams - the original action params from `action.profile`
9696
* @return {Promise<Record<string, any>>}
9797
*/
9898

99-
transform(profile, profileParams) {
99+
transform(_profile, _profileParams) {
100100
throw new Error('must implement extract');
101101
}
102102
}

injected/src/features/message-bridge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export class MessageBridge extends ContentFeature {
221221
}
222222
}
223223

224-
load(args) {}
224+
load(_args) {}
225225
}
226226

227227
export default MessageBridge;

injected/src/features/web-compat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ export class WebCompat extends ContentFeature {
445445
});
446446
// @ts-expect-error https://app.asana.com/0/1201614831475344/1203979574128023/f
447447
this.defineProperty(window.safari.pushNotification, 'requestPermission', {
448-
value: (name, domain, options, callback) => {
448+
value: (_name, _domain, _options, callback) => {
449449
if (typeof callback === 'function') {
450450
callback(new SafariRemoteNotificationPermission());
451451
return;

injected/src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export function isFeatureBroken(args, feature) {
226226
}
227227

228228
export function camelcase(dashCaseText) {
229-
return dashCaseText.replace(/-(.)/g, (match, letter) => {
229+
return dashCaseText.replace(/-(.)/g, (_, letter) => {
230230
return letter.toUpperCase();
231231
});
232232
}

injected/src/wrapper-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function wrapFunction(functionValue, realTarget) {
104104
}
105105
return Reflect.get(target, prop, receiver);
106106
},
107-
apply(target, thisArg, argumentsList) {
107+
apply(_, thisArg, argumentsList) {
108108
// This is where we call our real function
109109
return Reflect.apply(functionValue, thisArg, argumentsList);
110110
},
@@ -228,7 +228,7 @@ export function shimInterface(interfaceName, ImplClass, options, definePropertyF
228228
// handle the case where the constructor is called without new
229229
if (fullOptions.allowConstructorCall) {
230230
// make the constructor function callable without new
231-
proxyHandler.apply = function (target, thisArg, argumentsList) {
231+
proxyHandler.apply = function (target, _thisArg, argumentsList) {
232232
return Reflect.construct(target, argumentsList, target);
233233
};
234234
}

0 commit comments

Comments
 (0)