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

chore: migrate internal linting to flat config #202

Merged

Conversation

MikeMcC399
Copy link
Collaborator

Issue

  • ESLint v9 was released on Apr 5, 2024 and the announcement stated that "Flat config" is now the default.
  • The configuration for internal linting is however still set up using .eslintrc.json which is considered legacy format moving into ESLint v9 where the standard configuration filename is in the form eslint.config.*js and the contents are in flat config form.
  • Internal linting needs to use flat config as preparation to migrate to ESLint v9

This repo uses the following plugins for internal linting:

Plugin version recommended flat config option
eslint 8.57.0 pluginJs.configs.recommended
eslint-plugin-eslint-plugin 6.0.0 flat/recommended
eslint-plugin-mocha 10.4.3 mochaPlugin.configs.flat.recommended
eslint-plugin-n 17.2.1 flat/recommended-script

Related resolutions

Change

  1. Install latest plugin versions
  2. Install @eslint/js and @eslint/eslintrc
  3. Replace the config file .eslintrc.js using eslint.config.mjs according to the documentation ESLint 8.x configuration files (new) and the documentation of each plugin.

References

Configuration Migration Guide

ESLint 8.x

ESLint 9.x

Verification

Ubuntu 22.04.4 LTS, Node.js v20.12.2 LTS

npm ci
npm run lint

update to
eslint-plugin-eslint-plugin@6.1.0
eslint-plugin-n@17.4.0
@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 6, 2024 10:27
@MikeMcC399 MikeMcC399 marked this pull request as draft May 6, 2024 12:59
@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 6, 2024 13:03
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

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

Great!

@jennifer-shehane jennifer-shehane merged commit f38cc04 into cypress-io:master May 6, 2024
6 checks passed
@MikeMcC399 MikeMcC399 deleted the migrate/internal-flat branch May 6, 2024 16:04
@cypress-app-bot
Copy link

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants