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

refactor: switch to eslint v9, eslint-config-eslint v10 #604

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Conversation

mdjermanovic
Copy link
Member

Switches to using eslint v9 and eslint-config-eslint v10 to lint this project.

Marked as refactor as it has changes in the production code.

Comment on lines -27 to -30
"n/no-unsupported-features/es-syntax": ["error", {
version: ">=16.0.0",
ignores: ["modules"]
}]
Copy link
Member Author

@mdjermanovic mdjermanovic Apr 30, 2024

Choose a reason for hiding this comment

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

This override is apparently no longer needed with the latest version of eslint-plugin-n.

@@ -160,7 +157,7 @@ export const Syntax = (function() {
}

for (key in VisitorKeys) {
if (Object.hasOwnProperty.call(VisitorKeys, key)) {
if (Object.hasOwn(VisitorKeys, key)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was reported by prefer-object-has-own.

@@ -27,7 +27,7 @@ const SUPPORTED_VERSIONS = [
* @returns {number} The latest ECMAScript version.
*/
export function getLatestEcmaVersion() {
return SUPPORTED_VERSIONS[SUPPORTED_VERSIONS.length - 1];
return SUPPORTED_VERSIONS.at(-1);
Copy link
Member Author

Choose a reason for hiding this comment

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

This was reported by unicorn/prefer-at.

"lint": "eslint . --report-unused-disable-directives",
"lint": "eslint .",
Copy link
Member Author

Choose a reason for hiding this comment

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

--report-unused-disable-directives CLI flag is no longer needed because it is set to "error" in the config.

Comment on lines -73 to 80
let result = tester.getExpectedResult(code, {
const result = tester.getExpectedResult(code, {
loc: true,
range: true,
tokens: true
});

JSON.stringify(result).to(testResultFilename);
result = null;
});
Copy link
Member Author

Choose a reason for hiding this comment

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

This was reported by no-useless-assignment.

@aladdin-add aladdin-add merged commit c8de71e into main Apr 30, 2024
11 checks passed
@aladdin-add aladdin-add deleted the eslint9 branch April 30, 2024 08:21
@github-actions github-actions bot mentioned this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants