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

Update to ESLint 9 #2326

Merged
merged 13 commits into from
Feb 26, 2025
Merged

Update to ESLint 9 #2326

merged 13 commits into from
Feb 26, 2025

Conversation

Zarel
Copy link
Member

@Zarel Zarel commented Feb 22, 2025

(See also smogon/pokemon-showdown#10926 )

This finally removes the tslint dependency and switches to eslint.

There are a lot of other changes here, too, to bring the codebase up to server standards. TSLint never had much in the way of indentation enforcement.

Not very happy about eslint splitting itself up over 6 dependencies, or its documentation over three websites, nor how poorly documented the new flat config is, but I mean, eslint's gonna eslint. Customizing would be even harder if we tried to use Biome or something. They mostly seem to go full Prettier.

This finally removes the tslint dependency and switches to eslint.

There are a lot of other changes here, too, to bring the codebase up to
server standards. TSLint never had much in the way of indentation
enforcement.

Not very happy about eslint splitting itself up over 6 dependencies,
or its documentation over three websites, nor how poorly documented the
new flat config is, but I mean, eslint's gonna eslint. Customizing
would be even harder if we tried to use Biome or something. They mostly
seem to go full Prettier.
@Zarel
Copy link
Member Author

Zarel commented Feb 22, 2025

TODO:

  • decide whether to move to Prettier style for curly braces (spaces around curlies but not around square brackets): { a: 1, b: 2 } but [1, 2]
  • decide whether we're going to support no-type linting

@urkerab
Copy link
Contributor

urkerab commented Feb 22, 2025

Removing the trailing object commas from .js files is to restore support for IE8?

@Zarel
Copy link
Member Author

Zarel commented Feb 22, 2025

Removing the trailing object commas from .js files is to restore support for IE8?

At the point we originally decided to go ES3, it was for Safari 5 (the last Safari version supported by the iPad 1).

Now? I don't even know. A while ago someone showed off PS running on their refrigerator. We've always tried to support ES3 and the broken eslint config was the only reason we hadn't already, so we might as well. New code should mostly be in the TS files, where ES3 support isn't actually difficult.

@Zarel
Copy link
Member Author

Zarel commented Feb 22, 2025

Being able to lint with npx eslint will be really nice in the future, though. No more need for complicated command-line invocations. I don't think we'll need the multiple config files on server, either.

Also rearrange the config a little.
This also fixes that we weren't extending recommendedTypeChecked, which
meant a lot of unnecessary type assertions getting cleaned up.
@Zarel Zarel marked this pull request as ready for review February 25, 2025 06:20
@Zarel Zarel requested a review from KrisXV as a code owner February 25, 2025 06:20
@Zarel
Copy link
Member Author

Zarel commented Feb 25, 2025

eslint-ps-standard.mjs is intended to be shared between client and server. It'd be nice to have some automated way to keep them in sync, but for now they'll just be duplicated.

@Zarel Zarel merged commit a10821a into master Feb 26, 2025
1 check passed
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.

2 participants