Skip to content

Commit 7f6d636

Browse files
authored
migrate to eslint 9 (#71)
1 parent fe61af6 commit 7f6d636

30 files changed

Lines changed: 4259 additions & 1316 deletions

.eslintrc.cjs

Lines changed: 0 additions & 56 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
runs-on: ubuntu-latest
7474
strategy:
7575
matrix:
76-
node-version: [16.x, 18.x]
76+
node-version: [18.x, 20.x, 22.x]
7777
steps:
7878
- uses: actions/checkout@v4
7979

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- migrated to eslint 9 with the neolution eslint config
13+
1014
## [5.0.0] - 2025-03-04
1115

1216
### dependabot: \#68 Bump the github-actions group with 5 updates

cypress/.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

cypress/.eslintrc.cjs

Lines changed: 0 additions & 75 deletions
This file was deleted.

cypress/cypress/component/Paging/Paging.cy.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable max-lines */
21
import { Paging } from "react-pattern-ui";
32
import { faker } from "@faker-js/faker";
43

@@ -31,10 +30,10 @@ describe("Paging.cy.tsx", () => {
3130
);
3231
cy.get("[data-cy-root] > .container-fluid > .row > .col-6:first-of-type > .btn-group > .dropdown-menu > .dropdown-item").then(
3332
(items: JQuery<HTMLElement>) => {
34-
expect(items.map((_, item) => item.innerText).toArray(), "possible items per page").to.deep.eq(
33+
expect(items.map((_, item) => item.textContent).toArray(), "possible items per page").to.deep.eq(
3534
[25, 50, 100, 200, itemsPerPage].sort((a, b) => a - b).map((itemNumber): string => itemNumber.toString()),
3635
);
37-
cy.wrap(items.filter((_, item) => item.innerText === "25")).click();
36+
cy.wrap(items.filter((_, item) => item.textContent === "25")).click();
3837
cy.get("@setItemsPerPage").should("be.calledOnceWith", 25);
3938
},
4039
);
@@ -52,15 +51,15 @@ describe("Paging.cy.tsx", () => {
5251
cy.get("[data-cy-root] > .container-fluid > .row > .col-6:nth-of-type(2) > .btn-group > button.btn").then(
5352
(items: JQuery<HTMLElement>) => {
5453
expect(items.length, "navigation buttons count").to.eq(Math.min(7, pages) + 4);
55-
cy.wrap(items.filter((_, item) => item.innerText === "<<")).click();
54+
cy.wrap(items.filter((_, item) => item.textContent === "<<")).click();
5655
cy.get("@setCurrentPage").should("be.calledOnceWith", 1);
57-
cy.wrap(items.filter((_, item) => item.innerText === "<")).click();
56+
cy.wrap(items.filter((_, item) => item.textContent === "<")).click();
5857
cy.get("@setCurrentPage").should("be.calledWith", currentPage - 1);
59-
cy.wrap(items.filter((_, item) => item.innerText === (currentPage - 1).toString())).click();
58+
cy.wrap(items.filter((_, item) => item.textContent === (currentPage - 1).toString())).click();
6059
cy.get("@setCurrentPage").should("be.calledWith", currentPage - 1);
61-
cy.wrap(items.filter((_, item) => item.innerText === ">")).click();
60+
cy.wrap(items.filter((_, item) => item.textContent === ">")).click();
6261
cy.get("@setCurrentPage").should("be.calledWith", currentPage + 1);
63-
cy.wrap(items.filter((_, item) => item.innerText === ">>")).click();
62+
cy.wrap(items.filter((_, item) => item.textContent === ">>")).click();
6463
cy.get("@setCurrentPage").should("be.calledWith", pages);
6564
},
6665
);

cypress/cypress/component/PanelSidebar/PanelSidebar.cy.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { PropsWithChildren } from "react";
1+
/* eslint-disable max-lines */
2+
import { PropsWithChildren } from "react";
23
import {
34
PanelSideBarProvider,
45
PanelSideBarLayout,
@@ -30,11 +31,11 @@ const getPanelSidebarInternal = (items: TSideBarMenuItem[], config?: PanelSideBa
3031
onClick={() => {
3132
const pageContent = document.getElementById("pageContent");
3233
if (pageContent) {
33-
pageContent.innerText = elem.item.id;
34+
pageContent.textContent = elem.item.id;
3435
}
3536
}}
3637
>
37-
<>{elem.children}</>
38+
{(elem as React.PropsWithChildren).children}
3839
</div>
3940
)}
4041
>
@@ -230,7 +231,11 @@ describe("PanelSidebar.cy.tsx", () => {
230231
);
231232
};
232233

233-
cy.mount(<PanelSideBarWithTiles expanded children={<Button />} />);
234+
cy.mount(
235+
<PanelSideBarWithTiles expanded>
236+
<Button />
237+
</PanelSideBarWithTiles>,
238+
);
234239
cy.get("button[title=Settings]").click();
235240
cy.get("li:has(.dropdown-toggle)").should("be.visible").should("have.class", "menu-open");
236241
cy.get("#test-toggle").click();
@@ -249,7 +254,11 @@ describe("PanelSidebar.cy.tsx", () => {
249254
);
250255
};
251256

252-
cy.mount(<PanelSideBarWithTiles expanded children={<Button />} />);
257+
cy.mount(
258+
<PanelSideBarWithTiles expanded>
259+
<Button />
260+
</PanelSideBarWithTiles>,
261+
);
253262
cy.get("button[title=Settings]").click();
254263
cy.get("#dropdown-test1").should("be.visible");
255264
cy.get("#dropdown-test2").should("be.visible");
@@ -273,7 +282,11 @@ describe("PanelSidebar.cy.tsx", () => {
273282
);
274283
};
275284

276-
cy.mount(<PanelSideBarWithTiles children={<Button />} />);
285+
cy.mount(
286+
<PanelSideBarWithTiles>
287+
<Button />
288+
</PanelSideBarWithTiles>,
289+
);
277290
cy.get("button[title=Settings]").click();
278291
cy.get("li:has(.dropdown-toggle)").should("be.visible").should("not.have.class", "menu-open");
279292
cy.get("#test-open-item").click();

cypress/cypress/support/commands.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
// }
3838

3939
declare global {
40+
// eslint-disable-next-line @typescript-eslint/no-namespace
4041
namespace Cypress {
42+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
4143
interface Chainable {}
4244
}
4345
}

cypress/cypress/support/component-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
33
<head>
44
<meta charset="utf-8" />

cypress/cypress/support/component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// ***********************************************************
1515

1616
import "bootstrap/dist/css/bootstrap.min.css";
17+
1718
import "react-pattern-ui/styles.css";
1819

1920
// Import commands.js using ES2015 syntax:
@@ -29,6 +30,7 @@ import { mount } from "cypress/react18";
2930
// Alternatively, can be defined in cypress/support/component.d.ts
3031
// with a <reference path="./component" /> at the top of your spec.
3132
declare global {
33+
// eslint-disable-next-line @typescript-eslint/no-namespace
3234
namespace Cypress {
3335
interface Chainable {
3436
mount: typeof mount;

0 commit comments

Comments
 (0)