Skip to content

Commit 34a4f93

Browse files
committed
chore: upgrade to eslint 9 🎉
1 parent 129a55e commit 34a4f93

File tree

248 files changed

+2174
-1049
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+2174
-1049
lines changed

automation/run-e2e/.eslintrc.cjs

-12
This file was deleted.

automation/run-e2e/eslint.config.mjs

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { defineConfig } from "eslint/config";
2+
import globals from "globals";
3+
import js from "@eslint/js";
4+
5+
export default defineConfig([
6+
{
7+
files: ["**/*.js"],
8+
languageOptions: {
9+
globals: {
10+
...globals.node,
11+
...globals.es2021
12+
},
13+
ecmaVersion: 2021,
14+
sourceType: "module"
15+
}
16+
},
17+
{
18+
files: ["**/*.js"],
19+
plugins: { js },
20+
extends: ["js/recommended"],
21+
rules: {
22+
"no-unused-vars": "warn"
23+
}
24+
}
25+
]);

automation/run-e2e/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"url": "https://github.com/mendix/web-widgets.git"
1717
},
1818
"scripts": {
19-
"lint": "eslint --ext .mjs .",
19+
"lint": "eslint .",
2020
"format": "prettier --write .",
2121
"report:merge": "pnpm dlx ctrf merge ctrf --output merged-report.json --keep-reports"
2222
},
@@ -32,9 +32,11 @@
3232
"yargs-parser": "^21.1.1"
3333
},
3434
"devDependencies": {
35+
"globals": "^16.0.0",
36+
"@eslint/js": "^9.24.0",
3537
"@axe-core/playwright": "^4.10.1",
3638
"@playwright/test": "^1.51.1",
37-
"@types/node": "^20.12.7",
39+
"@types/node": "*",
3840
"eslint-plugin-playwright": "^2.2.0",
3941
"playwright-ctrf-json-reporter": "^0.0.20"
4042
}

automation/run-e2e/utils/read-excel.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable no-console */
1+
22
const readXlsxFile = require("read-excel-file/node");
33

44
const readExcelFile = filename => {

automation/snapshot-generator/.eslintrc.json

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { defineConfig } from "eslint/config";
2+
import globals from "globals";
3+
import js from "@eslint/js";
4+
5+
export default defineConfig([
6+
{
7+
files: ["**/*.js"],
8+
languageOptions: {
9+
globals: {
10+
...globals.node,
11+
...globals.es2021
12+
},
13+
ecmaVersion: 2021,
14+
sourceType: "module"
15+
}
16+
},
17+
{
18+
files: ["**/*.js"],
19+
plugins: { js },
20+
extends: ["js/recommended"]
21+
}
22+
]);

automation/snapshot-generator/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
"license": "MIT",
1414
"scripts": {
1515
"format": "prettier --write .",
16-
"lint": "eslint --ext .js lib/ bin/"
16+
"lint": "eslint lib/ bin/"
1717
},
1818
"dependencies": {
1919
"chance": "^1.1.12"
2020
},
2121
"devDependencies": {
22+
"globals": "^16.0.0",
23+
"@eslint/js": "^9.24.0",
2224
"@mendix/prettier-config-web-widgets": "workspace:*"
2325
}
2426
}

automation/utils/.eslintignore

-2
This file was deleted.

automation/utils/.eslintrc.json

-4
This file was deleted.

automation/utils/eslint.config.mjs

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default [
4+
...config,
5+
{
6+
ignores: ["src/changelog-parser/parser/module/module.js", "src/changelog-parser/parser/widget/widget.js"]
7+
}
8+
];

automation/utils/src/changelog-parser/index.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ function mergeUnreleased<T extends UnreleasedVersionEntry>(unreleased: T, sectio
105105
export class WidgetChangelogFileWrapper {
106106
changelog: WidgetChangelogFile;
107107

108-
private constructor(changelog: WidgetChangelogFile, public changelogPath: string) {
108+
private constructor(
109+
changelog: WidgetChangelogFile,
110+
public changelogPath: string
111+
) {
109112
this.changelog = Object.freeze(changelog);
110113
}
111114

@@ -185,7 +188,10 @@ export class ModuleChangelogFileWrapper {
185188
changelog: ModuleChangelogFile;
186189
moduleName: string;
187190

188-
private constructor(changelog: ModuleChangelogFile, public changelogPath: string) {
191+
private constructor(
192+
changelog: ModuleChangelogFile,
193+
public changelogPath: string
194+
) {
189195
this.changelog = Object.freeze(changelog);
190196
this.moduleName = changelog.moduleName;
191197
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@mendix/pluggable-widgets-tools": "10.18.2",
4242
"react": "^18.0.0",
4343
"react-dom": "^18.0.0",
44-
"prettier": "~2.8.8",
44+
"prettier": "3.5.3",
4545
"@types/node": "~22.14.0",
4646
"@types/react": ">=18.2.36",
4747
"@types/big.js": "^6.2.2",

packages/customWidgets/calendar-web/.eslintrc.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default config;

packages/customWidgets/calendar-web/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"build": "echo 'TODO: Fix calendar-web build script'",
3030
"create-gh-release": "rui-create-gh-release",
3131
"format": "prettier --write .",
32-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
32+
"lint": "eslint src",
3333
"publish-marketplace": "rui-publish-marketplace",
3434
"fixme_release": "ts-node --project scripts/tsconfig.json scripts/build.ts production",
3535
"release": "echo 'TODO: Fix calendar-web release script'",
@@ -48,6 +48,7 @@
4848
"babel-loader": "^8.3.0",
4949
"copy-webpack-plugin": "^11.0.0",
5050
"css-loader": "^6.7.3",
51+
"eslint": "^9.24.0",
5152
"fork-ts-checker-webpack-plugin": "^7.3.0",
5253
"mendix-client": "^7.15.8",
5354
"sass": "^1.58.3",

packages/customWidgets/signature-web/.eslintrc.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default config;

packages/customWidgets/signature-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"build": "ts-node --project scripts/tsconfig.json scripts/build.ts development",
2929
"release": "ts-node --project scripts/tsconfig.json scripts/build.ts production",
3030
"format": "prettier --write .",
31-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
31+
"lint": "eslint src/",
3232
"test": "pluggable-widgets-tools test:unit:web",
3333
"create-gh-release": "rui-create-gh-release",
3434
"publish-marketplace": "rui-publish-marketplace",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { defineConfig } from "eslint/config";
2+
import globals from "globals";
3+
import js from "@eslint/js";
4+
5+
export default defineConfig([
6+
{
7+
files: ["**/*.js"],
8+
languageOptions: {
9+
globals: {
10+
...globals.browser,
11+
mx: "readonly",
12+
},
13+
ecmaVersion: 2021,
14+
sourceType: "module"
15+
}
16+
},
17+
{
18+
files: ["**/*.js"],
19+
plugins: { js },
20+
extends: ["js/recommended"],
21+
rules: {
22+
"no-unused-vars": ["error", {
23+
vars: "all",
24+
args: "after-used",
25+
ignoreRestSiblings: false,
26+
varsIgnorePattern: "Big",
27+
caughtErrorsIgnorePattern: ".*",
28+
}],
29+
},
30+
}
31+
]);

packages/modules/web-actions/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
"publish-marketplace": "rui-publish-marketplace"
3636
},
3737
"devDependencies": {
38+
"globals": "^16.0.0",
39+
"@eslint/js": "^9.24.0",
3840
"@mendix/automation-utils": "workspace:*",
3941
"@mendix/prettier-config-web-widgets": "workspace:^"
4042
}

packages/pluggableWidgets/accessibility-helper-web/.eslintrc.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default config;

packages/pluggableWidgets/accessibility-helper-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dev": "pluggable-widgets-tools start:ts",
3131
"build": "pluggable-widgets-tools build:ts",
3232
"format": "prettier --write .",
33-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
33+
"lint": "eslint src/",
3434
"release": "pluggable-widgets-tools release:web",
3535
"create-gh-release": "rui-create-gh-release",
3636
"create-translation": "rui-create-translation",

packages/pluggableWidgets/accordion-web/.eslintrc.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default config;

packages/pluggableWidgets/accordion-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"dev": "pluggable-widgets-tools start:web",
3232
"build": "pluggable-widgets-tools build:web",
3333
"format": "prettier --write .",
34-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
34+
"lint": "eslint src/",
3535
"test": "pluggable-widgets-tools test:unit:web",
3636
"release": "pluggable-widgets-tools release:web",
3737
"create-gh-release": "rui-create-gh-release",

packages/pluggableWidgets/area-chart-web/.eslintrc.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default config;

packages/pluggableWidgets/area-chart-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dev": "pluggable-widgets-tools start:web",
3131
"build": "pluggable-widgets-tools build:ts",
3232
"format": "prettier --write .",
33-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
33+
"lint": "eslint src/",
3434
"test": "pluggable-widgets-tools test:unit:web",
3535
"release": "pluggable-widgets-tools release:web",
3636
"verify": "rui-verify-package-format",

packages/pluggableWidgets/area-chart-web/src/AreaChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const areaChartConfigOptions: ChartWidgetProps["configOptions"] = {
3131
const areaChartSeriesOptions: ChartWidgetProps["seriesOptions"] = {};
3232

3333
// disable eslint rule to have nice component name in component tree at devtools
34-
// eslint-disable-next-line prefer-arrow-callback
34+
3535
export const AreaChart = memo(function AreaChart(props: AreaChartContainerProps): ReactElement {
3636
const mapSeries = useCallback<SeriesMapper<SeriesType>>((line, dataPoints, { getExpressionValue }) => {
3737
const lineColorExpression = line.dataSet === "static" ? line.staticLineColor : line.dynamicLineColor;

packages/pluggableWidgets/badge-button-web/.eslintrc.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default config;

packages/pluggableWidgets/badge-button-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dev": "cross-env MPKOUTPUT=BadgeButton.mpk pluggable-widgets-tools start:ts",
3131
"build": "cross-env MPKOUTPUT=BadgeButton.mpk pluggable-widgets-tools build:ts",
3232
"format": "prettier --write .",
33-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
33+
"lint": "eslint src/",
3434
"test": "pluggable-widgets-tools test:unit:web",
3535
"release": "cross-env MPKOUTPUT=BadgeButton.mpk pluggable-widgets-tools release:web",
3636
"create-gh-release": "rui-create-gh-release",

packages/pluggableWidgets/badge-web/.eslintrc.json

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default [
4+
...config,
5+
{
6+
ignores: ["playwright.config.js", "e2e/*.js"]
7+
}
8+
];

packages/pluggableWidgets/badge-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dev": "cross-env MPKOUTPUT=Badge.mpk pluggable-widgets-tools start:web",
3131
"build": "cross-env MPKOUTPUT=Badge.mpk pluggable-widgets-tools build:web",
3232
"format": "prettier --write .",
33-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
33+
"lint": "eslint src/",
3434
"test": "pluggable-widgets-tools test:unit:web",
3535
"e2e": "run-e2e ci",
3636
"e2edev": "run-e2e dev --with-preps",

packages/pluggableWidgets/badge-web/src/Badge.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default function Badge(props: BadgeContainerProps): ReactNode {
2626
onKeyDown={clickable ? onKeyDown : undefined}
2727
className={props.class}
2828
style={props.style}
29-
tabIndex={clickable ? props.tabIndex ?? 0 : undefined}
29+
tabIndex={clickable ? (props.tabIndex ?? 0) : undefined}
3030
/>
3131
);
3232
}

packages/pluggableWidgets/bar-chart-web/.eslintrc.json

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import config from "@mendix/eslint-config-web-widgets/widget-ts.mjs";
2+
3+
export default config;

packages/pluggableWidgets/bar-chart-web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dev": "pluggable-widgets-tools start:web",
3131
"build": "pluggable-widgets-tools build:ts",
3232
"format": "prettier --write .",
33-
"lint": "eslint --ext .jsx,.js,.ts,.tsx src/",
33+
"lint": "eslint src/",
3434
"test": "pluggable-widgets-tools test:unit:web",
3535
"release": "pluggable-widgets-tools release:web",
3636
"verify": "rui-verify-package-format",

packages/pluggableWidgets/bar-chart-web/src/BarChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const barChartSeriesOptions: ChartWidgetProps["seriesOptions"] = {
3636
};
3737

3838
// disable eslint rule to have nice component name in component tree at devtools
39-
// eslint-disable-next-line prefer-arrow-callback
39+
4040
export const BarChart = memo(function BarChart(props: BarChartContainerProps): ReactElement | null {
4141
const layoutOptions = useMemo(
4242
() => ({

0 commit comments

Comments
 (0)