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

Change eslint config to use new flat config format #1232

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

dank074
Copy link
Contributor

@dank074 dank074 commented Nov 13, 2024

While attempting to commit I got the following error message:

Oops! Something went wrong! :(
ESLint: 9.13.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.

husky - pre-commit script failed (code 1)

This PR updates the eslint config to use the new flat config format

@MaddyUnderStars
Copy link
Member

The CI failed eslint seemingly because the disabled rules are running? Could you have a look at that for me please?

@TheArcaneBrony
Copy link
Member

Is this just copy paste'd from #1231 ?

@dank074
Copy link
Contributor Author

dank074 commented Nov 13, 2024

Is this just copy paste'd from #1231 ?

No I ran the migration script myself. Cyber mentioned he had committed these changes but they were not in its own PR

@dank074
Copy link
Contributor Author

dank074 commented Nov 13, 2024

The CI failed eslint seemingly because the disabled rules are running? Could you have a look at that for me please?

The disabled rules aren't the ones throwing the errors. These are the currently disabled rules:

"no-mixed-spaces-and-tabs": "off",
"@typescript-eslint/no-inferrable-types": "off", // Required by typeorm
"@typescript-eslint/no-var-requires": "off", // Sometimes requred by typeorm to resolve circular deps

and the CI is erroring with the below ones:

  73:39  error  A `require()` style import is forbidden  @typescript-eslint/no-require-imports
Error:    74:18  error  A `require()` style import is forbidden  @typescript-eslint/no-require-imports
Error:   214:24  error  A `require()` style import is forbidden  @typescript-eslint/no-require-imports

/home/runner/work/server/server/src/api/util/utility/EmbedHandlers.ts
Error:   103:11  error  'e' is defined but never used  @typescript-eslint/no-unused-vars
Error:   136:11  error  'e' is defined but never used  @typescript-eslint/no-unused-vars

Going to try to see what's causing it.

@dank074
Copy link
Contributor Author

dank074 commented Nov 13, 2024

Would you prefer that I turn these two rules off, or that I add eslint disable directives to the lines causing problems?

Edit: I added the rules to the disabled list. Let me know if you want me to do the latter instead

@MaddyUnderStars
Copy link
Member

Sorry for the long wait and the incorrect reply lol yes this is fine. Thanks a lot

@MaddyUnderStars MaddyUnderStars merged commit 841b361 into spacebarchat:master Nov 14, 2024
1 of 3 checks passed
@dank074 dank074 deleted the patch/eslintConfig branch November 14, 2024 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants