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

fix: eslint v9 pre-commit hook #13886

Open
wants to merge 1 commit into
base: 2.4
Choose a base branch
from

Conversation

Swiftb0y
Copy link
Member

@Swiftb0y Swiftb0y commented Nov 14, 2024

Fix pre-commit eslint hook broken by #13843

Currently running the eslint hook on JS files results in this lengthy error message:

Error

**(node:13057) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use `node --trace-warnings ...` to show where the warning was created)

Oops! Something went wrong! :(

ESLint: 9.14.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.
**

This PR fixes this by migrating to the new config format.

using the recommended `@eslint/migrate-config` tool.

This explicitly uses the commonJS format as the default format
as the ecmascript module format doesn't work with pre-commit.
pre-commit/pre-commit#3321
@Swiftb0y Swiftb0y changed the title chore: migrate to eslint v9 "flat" config format fix: eslint v9 pre-commit hook Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant