Skip to content

Commit 8492452

Browse files
build(deps-dev): bump @typescript-eslint/eslint-plugin from 5.61.0 to 6.0.0 (#2609)
* build(deps-dev): bump @typescript-eslint/eslint-plugin Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.61.0 to 6.0.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.0.0/packages/eslint-plugin) --- updated-dependencies: - dependency-name: "@typescript-eslint/eslint-plugin" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Update linting config --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hugo van Rijswijk <git@hugovr.nl>
1 parent 5f016d9 commit 8492452

22 files changed

+217
-377
lines changed

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ module.exports = {
2020
extends: [
2121
'eslint:recommended',
2222
'plugin:@typescript-eslint/eslint-recommended',
23-
'plugin:@typescript-eslint/recommended',
24-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
23+
'plugin:@typescript-eslint/recommended-type-checked',
24+
'plugin:@typescript-eslint/stylistic-type-checked',
2525
'prettier',
2626
'plugin:tailwindcss/recommended',
2727
],

package-lock.json

Lines changed: 180 additions & 348 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
"@types/sinon": "^10.0.0",
5050
"@types/sinon-chai": "^3.2.2",
5151
"@types/webpack-env": "^1.13.9",
52-
"@typescript-eslint/eslint-plugin": "^5.3.0",
53-
"@typescript-eslint/parser": "^5.3.0",
52+
"@typescript-eslint/eslint-plugin": "^6.0.0",
53+
"@typescript-eslint/parser": "^6.0.0",
5454
"ajv": "^8.6.3",
5555
"autoprefixer": "^10.4.13",
5656
"canvas": "^2.11.0",

packages/elements/src/components/app/app.component.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
12
import { html, PropertyValues, unsafeCSS, nothing } from 'lit';
23
import { customElement, property } from 'lit/decorators.js';
34
import { MutantResult, MutationTestResult } from 'mutation-testing-report-schema/api';
@@ -59,7 +60,7 @@ export class MutationTestReportAppComponent extends RealtimeElement {
5960
public context: Context = { view: View.mutant, path: [] };
6061

6162
@property()
62-
public path: ReadonlyArray<string> = [];
63+
public path: readonly string[] = [];
6364

6465
@property({ attribute: 'title-postfix' })
6566
public titlePostfix: string | undefined;
@@ -124,8 +125,8 @@ export class MutationTestReportAppComponent extends RealtimeElement {
124125
}
125126
}
126127

127-
private mutants: Map<string, MutantModel> = new Map();
128-
private tests: Map<string, TestModel> = new Map();
128+
private mutants = new Map<string, MutantModel>();
129+
private tests = new Map<string, TestModel>();
129130

130131
public updated(changedProperties: PropertyValues) {
131132
if (changedProperties.has('theme') && this.theme) {
@@ -183,7 +184,7 @@ export class MutationTestReportAppComponent extends RealtimeElement {
183184
if (this.rootModel) {
184185
const findResult = <TFile, TResult>(root: MetricsResult<TFile, TResult>, path: string[]): MetricsResult<TFile, TResult> | undefined => {
185186
return path.reduce<MetricsResult<TFile, TResult> | undefined>(
186-
(model, currentPathPart) => model && model.childResults.find((child) => child.name === currentPathPart),
187+
(model, currentPathPart) => model?.childResults.find((child) => child.name === currentPathPart),
187188
root
188189
);
189190
};
@@ -225,7 +226,7 @@ export class MutationTestReportAppComponent extends RealtimeElement {
225226
}
226227

227228
private source: EventSource | undefined;
228-
private sseSubscriptions: Set<Subscription> = new Set();
229+
private sseSubscriptions = new Set<Subscription>();
229230
private theMutant?: MutantModel;
230231
private theTest?: TestModel;
231232

@@ -319,7 +320,7 @@ export class MutationTestReportAppComponent extends RealtimeElement {
319320
}
320321

321322
public render() {
322-
if (this.context.result || this.errorMessage) {
323+
if (this.context.result ?? this.errorMessage) {
323324
return html`
324325
<div class="container bg-white pb-4 font-sans text-gray-800 motion-safe:transition-max-width">
325326
<div class="space-y-4 transition-colors">

packages/elements/src/components/drawer-mutant/drawer-mutant.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export class MutationTestReportDrawerMutant extends RealtimeElement {
2323

2424
public render() {
2525
return renderDrawer(
26+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- we want to coalesce on length 0
2627
{ hasDetail: Boolean(this.mutant?.killedByTests?.length || this.mutant?.coveredByTests?.length), mode: this.mode },
2728
renderIfPresent(
2829
this.mutant,

packages/elements/src/components/drawer-mutant/util.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { html, nothing, TemplateResult } from 'lit';
33
export const renderDetailLine = (title: string, content: string | TemplateResult) =>
44
html`<li title=${title || nothing} class="my-3 rounded bg-white px-2 py-3 shadow">${content}</li>`;
55

6+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- we want to coalesce on empty string
67
export const renderSummaryLine = (content: string | TemplateResult, title?: string) => html`<p title=${title || nothing}>${content}</p>`;
78

89
export const renderSummaryContainer = (content: TemplateResult) => html`<div class="mb-6 mr-6 mt-2 flex flex-col gap-4">${content}</div>`;

packages/elements/src/components/drawer-test/drawer-test.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export class MutationTestReportDrawerTestComponent extends RealtimeElement {
2222

2323
public render() {
2424
return renderDrawer(
25+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- we want to coalesce on length 0
2526
{ hasDetail: Boolean(this.test?.killedMutants?.length || this.test?.coveredMutants?.length), mode: this.mode },
2627
renderIfPresent(
2728
this.test,

packages/elements/src/lib/code-helpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */
12
import { Position } from 'mutation-testing-report-schema/api';
23
import { highlight, languages } from 'prismjs/components/prism-core';
34

@@ -340,10 +341,10 @@ export function findDiffIndices(original: string, mutated: string) {
340341
// Make an exception for `true` and `false` (end in same character 🤷‍♀️)
341342
const mutatedPart = mutated.substring(focusFrom, focusTo);
342343
['true', 'false'].forEach((keyword) => {
343-
if (mutatedPart === keyword.substr(0, keyword.length - 1) && keyword[keyword.length - 1] === mutated[focusTo]) {
344+
if (mutatedPart === keyword.substr(0, keyword.length - 1) && keyword.endsWith(mutated[focusTo])) {
344345
focusTo++;
345346
}
346-
if (mutatedPart === keyword.substr(1, keyword.length) && keyword[0] === mutated[focusFrom - 1]) {
347+
if (mutatedPart === keyword.substr(1, keyword.length) && keyword.startsWith(mutated[focusFrom - 1])) {
347348
focusFrom--;
348349
}
349350
});

packages/elements/test/integration/lib/browser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import chrome from 'selenium-webdriver/chrome';
44
let browser: WebDriver | null = null;
55

66
export function isHeadless(): boolean {
7-
return !!(process.env.HEADLESS || process.env.CI);
7+
return !!(process.env.HEADLESS ?? process.env.CI);
88
}
99

1010
export async function init() {

packages/elements/test/integration/po/MutantElement.po.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export abstract class MutantElement extends PageObject {
1717

1818
public async getStatus(): Promise<MutantStatus | undefined> {
1919
return (await this.classes()).find((clazz) => {
20+
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
2021
const testState = allMutantStates.find((state) => state === clazz);
2122
if (testState) {
2223
return testState;

0 commit comments

Comments
 (0)