Skip to content

chore(eslint): migrate eslint configuration .eslintrc.js to eslint.config.mjs#205

Merged
bvaughn merged 8 commits intobvaughn:masterfrom
sukvvon:chore/update-eslint-to-9
Dec 21, 2024
Merged

chore(eslint): migrate eslint configuration .eslintrc.js to eslint.config.mjs#205
bvaughn merged 8 commits intobvaughn:masterfrom
sukvvon:chore/update-eslint-to-9

Conversation

@sukvvon
Copy link
Copy Markdown
Contributor

@sukvvon sukvvon commented Nov 2, 2024

What:

this pr converts the existing .eslintrc.js configuration file to the latest eslint format, eslint.config.mjs, and includes necessary updates to related libraries to support this change. a .nvmrc file specifying v20.9.0 has also been added to ensure compatibility with eslint’s minimum version requirements. the update ensures that the original eslint configuration is adapted to the flat config format while maintaining consistent functionality with typescript, react, and prettier plugins and recommended rules.

Why:

the main goal of this change is to adopt eslint’s latest configuration style, making maintenance easier and leveraging the flexibility of the flat config structure. this approach is expected to bring several benefits:

  • adoption of the latest module standard: the flat config format uses the latest ecmascript module (esm) standard, allowing for more flexible application of javascript features in configuration.
  • improved maintainability and extensibility: by updating plugins, we are now using versions optimized for flat config. this transition also prepares us to more easily adapt to future eslint version updates.
  • node version compatibility: a .nvmrc file specifying v20.9.0 has been added to ensure compatibility with eslint’s minimum version requirements, as the latest eslint requires node.js version 18.18.0, 20.9.0, or 21.1.0 and above. this change helps ensure that all environments using this repository align with the required node version.

How:

this pr implements the following changes:

  • configuration migration: all configurations from .eslintrc.js were transferred to eslint.config.mjs and adapted to the flat config format, ensuring functional parity with the previous setup.
  • library updates: major eslint-related plugins (typescript, react, prettier) were updated to their latest versions, supporting the new configuration style.
  • node version specification: a .nvmrc file was added with v20.9.0 to meet eslint’s minimum node version requirements, ensuring compatibility across environments.
  • environment and global variable consistency: the environment variables and global options (browser, es2021, node) from the previous configuration were applied consistently in the flat config, ensuring that the setup performs identically to the former .eslintrc.js configuration.

this transition modularizes the eslint configuration with the latest standards, improving maintainability and allowing for greater flexibility in accommodating future eslint and plugin updates.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@sukvvon sukvvon changed the title chore(eslint): migrate eslint configuration .eslintrc.js to eslint.config.mjs chore(eslint): migrate eslint configuration '.eslintrc.js' to 'eslint.config.mjs' Nov 10, 2024
@sukvvon sukvvon changed the title chore(eslint): migrate eslint configuration '.eslintrc.js' to 'eslint.config.mjs' chore(eslint): migrate eslint configuration .eslintrc.js to eslint.config.mjs Nov 10, 2024
@bvaughn bvaughn merged commit e1a6a0a into bvaughn:master Dec 21, 2024
@sukvvon sukvvon deleted the chore/update-eslint-to-9 branch December 23, 2024 10:21
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