Skip to content

Commit 789846e

Browse files
build(deps-dev): bump @eslint/js from 9.39.2 to 10.0.1 (#5709)
* build(deps-dev): bump @eslint/js from 9.39.2 to 10.0.1 Bumps [@eslint/js](https://github.com/eslint/eslint/tree/HEAD/packages/js) from 9.39.2 to 10.0.1. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](https://github.com/eslint/eslint/commits/HEAD/packages/js) --- updated-dependencies: - dependency-name: "@eslint/js" dependency-version: 10.0.1 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * chore(lint): fix new errors from eslint 10 * fix(test-utils): repair overzealous optimization --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Will Harney <wharney@salesforce.com>
1 parent af40c77 commit 789846e

File tree

11 files changed

+24
-25
lines changed

11 files changed

+24
-25
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"devDependencies": {
3939
"@commitlint/cli": "^20.4.2",
40-
"@eslint/js": "9.39.2",
40+
"@eslint/js": "10.0.1",
4141
"@lwc/eslint-plugin-lwc-internal": "link:./scripts/eslint-plugin",
4242
"@lwc/test-utils-lwc-internals": "link:./scripts/test-utils",
4343
"@nx/js": "22.5.3",

packages/@lwc/engine-core/src/framework/api.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -379,21 +379,20 @@ function c(
379379
}
380380

381381
const { key, slotAssignment } = data;
382-
let elm, aChildren, vm;
383382
const vnode: VCustomElement = {
384383
type: VNodeType.CustomElement,
385384
sel,
386385
data,
387386
children,
388-
elm,
387+
elm: undefined,
389388
key,
390389
slotAssignment,
391390

392391
ctor: Ctor,
393392
owner: vmBeingRendered,
394393
mode: 'open', // TODO [#1294]: this should be defined in Ctor
395-
aChildren,
396-
vm,
394+
aChildren: undefined,
395+
vm: undefined,
397396
};
398397
addVNodeToChildLWC(vnode);
399398

@@ -519,26 +518,24 @@ function f(items: ReadonlyArray<VNodes> | VNodes): VNodes {
519518

520519
// [t]ext node
521520
function t(text: string): VText {
522-
let key, elm;
523521
return {
524522
type: VNodeType.Text,
525523
sel: '__text__',
526524
text,
527-
elm,
528-
key,
525+
elm: undefined,
526+
key: undefined,
529527
owner: getVMBeingRendered()!,
530528
};
531529
}
532530

533531
// [co]mment node
534532
function co(text: string): VComment {
535-
let elm, key;
536533
return {
537534
type: VNodeType.Comment,
538535
sel: '__comment__',
539536
text,
540-
elm,
541-
key,
537+
elm: undefined,
538+
key: undefined,
542539
owner: getVMBeingRendered()!,
543540
};
544541
}

packages/@lwc/ssr-compiler/src/compile-js/generate-markup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,13 @@ export function addGenerateMarkupFunction(
137137
const defaultTagName = b.literal(tagName);
138138
const classIdentifier = b.identifier(state.lwcClassName!);
139139

140-
let exposeTemplateBlock: IfStatement | null = null;
141140
const defaultTmplPath = `./${pathParse(filename).name}.html`;
142141
const tmplVar = b.identifier('__lwcTmpl');
143142
program.body.unshift(bImportDeclaration({ default: tmplVar.name }, defaultTmplPath));
144143
program.body.unshift(
145144
bImportDeclaration({ SYMBOL__DEFAULT_TEMPLATE: '__SYMBOL__DEFAULT_TEMPLATE' })
146145
);
147-
exposeTemplateBlock = bExposeTemplate(tmplVar, classIdentifier);
146+
const exposeTemplateBlock = bExposeTemplate(tmplVar, classIdentifier);
148147

149148
// If no wire adapters are detected on the component, we don't bother injecting the wire-related code.
150149
let connectWireAdapterCode: Statement[] = [];

packages/@lwc/ssr-runtime/src/context.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export function connectContext(le: LightningElement) {
8080
}
8181
} catch (err: any) {
8282
if (process.env.NODE_ENV !== 'production') {
83+
// eslint-disable-next-line preserve-caught-error
8384
throw new Error(
8485
`Attempted to connect to trusted context but received the following error: ${
8586
err.message

packages/@lwc/style-compiler/src/transform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export function transform(
8282
} catch (error) {
8383
if (errorRecoveryMode && error instanceof postcss.CssSyntaxError) {
8484
ctx.errors.push(error);
85+
// eslint-disable-next-line preserve-caught-error
8586
throw AggregateError(ctx.errors);
8687
} else {
8788
throw error;

packages/@lwc/template-compiler/src/codegen/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ export default class CodeGen {
782782
this.isSyntheticShadow && (isIdOrIdRef || isScopedFragmentRef);
783783

784784
if (isExpression(value) || isSvgHref || needsScoping) {
785-
let partToken = '';
785+
let partToken: string;
786786
if (name === 'style') {
787787
partToken = `${STATIC_PART_TOKEN_ID.STYLE}${partId}`;
788788
databag.push(

packages/@lwc/template-compiler/src/parser/expression.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ export function parseIdentifier(
170170
source: string,
171171
location: SourceLocation
172172
): Identifier {
173-
let isValid = true;
174-
175-
isValid = isIdentifierStart(source.charCodeAt(0));
173+
let isValid = isIdentifierStart(source.charCodeAt(0));
176174
for (let i = 1; i < source.length && isValid; i++) {
177175
isValid = isIdentifierChar(source.charCodeAt(i));
178176
}

packages/@lwc/template-compiler/src/shared/renderer-hooks.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ function shouldAddCustomRenderer(element: BaseElement, state: State): boolean {
6262

6363
const { attributes, directives } = element;
6464
if (directives.length) {
65-
let directiveMatched = false;
6665
// If any directives require custom renderer
67-
directiveMatched = directives.some((dir) => {
66+
const directiveMatched = directives.some((dir) => {
6867
return state.crDirectives.has(ElementDirectiveName[dir.name]);
6968
});
7069
if (directiveMatched) {

scripts/test-utils/format-html.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { HTML_NAMESPACE, isVoidElement } from '@lwc/shared';
1919
export function formatHTML(src: string): string {
2020
let res = '';
2121
let pos = 0;
22-
let start = pos;
2322

2423
let depth = 0;
2524

@@ -46,7 +45,7 @@ export function formatHTML(src: string): string {
4645
res += getPadding() + textContent + '\n';
4746
depth--;
4847
res += getPadding() + '</style>' + '\n';
49-
start = pos = pos + wholeMatch.length;
48+
pos = pos + wholeMatch.length;
5049
continue;
5150
}
5251
}
@@ -58,7 +57,7 @@ export function formatHTML(src: string): string {
5857
src.charAt(pos + 2) === '-' &&
5958
src.charAt(pos + 3) === '-';
6059

61-
start = pos;
60+
const start = pos;
6261
while (src.charAt(pos++) !== '>') {
6362
// Keep advancing until consuming the closing tag.
6463
}
@@ -88,7 +87,7 @@ export function formatHTML(src: string): string {
8887
}
8988

9089
// Consume text content.
91-
start = pos;
90+
const start = pos;
9291
while (src.charAt(pos) !== '<' && pos < src.length) {
9392
pos++;
9493
}

scripts/test-utils/swap-lwc-style-for-style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function swapLwcStyleForStyleTag(src: string): string {
2525
// ([leading whitespace])(<style (id="(text)")...>...</style>)
2626
const styleCapture = /(\s*)(<style [^>]*(id="([^"]+)" ?)[^>]*>.*?<\/style>)/s;
2727
const capturedStyleTags: StyleTagInfo[] = [];
28-
let styleTagMatch: RegExpExecArray | null = null;
28+
let styleTagMatch: RegExpExecArray | null;
2929

3030
// Find all <style> tags with an id, remove id attrs, capture information for later
3131
// replacement of <lwc-style> tags. The length of the `modifiedSrc` string will be
@@ -55,7 +55,7 @@ export function swapLwcStyleForStyleTag(src: string): string {
5555
const idToStyleTag = Object.fromEntries(
5656
capturedStyleTags.map((styleTagInfo) => [styleTagInfo.styleId, styleTagInfo])
5757
);
58-
let lwcStyleTagMatch: RegExpExecArray | null = null;
58+
let lwcStyleTagMatch: RegExpExecArray | null;
5959

6060
// Find all <lwc-style> tags and replace them with corresponding <style> tags captured earlier.
6161
// The length of the `modifiedSrc` string will be changing as <style> tags are modified, so we

0 commit comments

Comments
 (0)