Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): upgrade eslint to v9 #1856

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing those old plugin recommendations so that the official msft vscode eslint plugin get picked up.

"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
Loading