Skip to content

Commit

Permalink
build(deps): upgrade eslint to v9 (#1856)
Browse files Browse the repository at this point in the history
  • Loading branch information
giamir authored Nov 26, 2024
1 parent 7a26544 commit 63f7062
Show file tree
Hide file tree
Showing 13 changed files with 342 additions and 365 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

27 changes: 0 additions & 27 deletions .eslintrc.js

This file was deleted.

4 changes: 1 addition & 3 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"stylelint.vscode-stylelint"
]
}
}
28 changes: 28 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import prettier from "eslint-config-prettier";
import js from "@eslint/js";
import ts from "typescript-eslint";
import nounsanitized from "eslint-plugin-no-unsanitized";

export default ts.config(
js.configs.recommended,
nounsanitized.configs.recommended,
...ts.configs.recommended,
prettier,
{
rules: {
"no-console": "error",
"no-alert": "error",
"no-process-env": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
destructuredArrayIgnorePattern: "^_",
},
],
"@typescript-eslint/no-unused-expressions": "off",
},
},
{
ignores: ["node_modules", "dist", "**/*.js"],
}
);
2 changes: 1 addition & 1 deletion lib/components/expandable/expandable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function globalChangeListener(e: UIEvent) {
let customEvent;
try {
customEvent = new Event(RADIO_OFF_EVENT);
} catch (ex) {
} catch {
// Internet Explorer
customEvent = document.createEvent("Event");
customEvent.initEvent(RADIO_OFF_EVENT, true, true);
Expand Down
1 change: 0 additions & 1 deletion lib/components/select/select.a11y.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ describe("select", () => {
default: child(state.attr),
},
template: ({ component, testid }) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
template({ component, testid, className: state.class }),
options: {
includeNullModifier: false,
Expand Down
1 change: 0 additions & 1 deletion lib/components/select/select.visual.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe("select", () => {
selected: child(state.attr),
},
template: ({ component, testid }) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
template({ component, testid, className: state.class }),
options: {
includeNullModifier: false,
Expand Down
2 changes: 1 addition & 1 deletion lib/components/uploader/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class UploaderController extends Stacks.StacksController {

if (file.type.match("image/*") && file.data) {
thumbElement = document.createElement("img");
// eslint-disable-next-line @typescript-eslint/no-base-to-string

thumbElement.src = file.data.toString();
thumbElement.alt = file.name;
} else {
Expand Down
6 changes: 3 additions & 3 deletions lib/stacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class StacksApplication extends Stimulus.Application {
schema?: Stimulus.Schema
): StacksApplication {
const application = new StacksApplication(element, schema);
// eslint-disable-next-line @typescript-eslint/no-floating-promises

application.start();
return application;
}
Expand Down Expand Up @@ -64,9 +64,9 @@ export class StacksController extends Stimulus.Controller {
cancelable: true,
detail: detail,
});
} catch (ex) {
} catch {
// Internet Explorer
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment

event = document.createEvent("CustomEvent");
event.initCustomEvent(namespacedName, true, true, detail);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/test/test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type Themes = ["light" | "dark" | "highcontrast" | ""];

const attrObjToString = (attrs: Record<string, string>): string => {
const attrString = Object.keys(attrs).map((key) => {
return `${key}="${attrs[key]}"` || "";
return `${key}="${attrs[key]}"`;
});
return attrString.join(" ") || "";
};
Expand Down
Loading

0 comments on commit 63f7062

Please sign in to comment.