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

Support both flat and legacy ESLint configuration styles 🥙 #19

Merged
merged 9 commits into from
Aug 2, 2024

Conversation

01taylop
Copy link
Owner

@01taylop 01taylop commented Aug 2, 2024

Details

What have you changed?

  • 🔩 Added support for both flat and legacy ESLint configuration styles.
  • 📟 Added a new CLI option, --eslint-use-legacy-config.
  • ⚙️ Created an .eslintrc config file (in addition to the eslint.config.js file).
  • 🧪 Run yarn lint in the test.yml GitHub action.

Why are you making these changes?

  • 🔩 Using flat config is recommended, but some teams may not be ready or have capacity to upgrade so config is also available in the legacy format.
  • 📟 The default configuration style is flat. The CLI option --eslint-use-legacy-config can be enabled to use the legacy configuration style.
  • ⚙️ The .eslintrc file can be used to test the legacy config, whereas eslint.config.js is used for the flat config style.
  • 🧪 To ensure we have no lint errors in our own lint library! For now, .ts files are ignored as Lint Pilot does not support TypeScript.

Why support flat and legacy config?

Although Lint Pilot is new - so only supporting flat config might be expected - it could be used to replace existing Lint programs which may need to continue supporting legacy config.

For example, some companies may have their own Lint programs which they would need to upgrade to support flat config, and part of that process may be to migrate to Lint Pilot which supports both. This would allow teams to migrate to flat config in their own time and the company wouldn't need to invest time in supporting a complex linting program.

@01taylop 01taylop changed the title Flat legacy Support both flat and legacy ESLint configuration styles 🥙 Aug 2, 2024
@01taylop 01taylop marked this pull request as ready for review August 2, 2024 14:18
@01taylop 01taylop merged commit 5eed9f4 into main Aug 2, 2024
5 checks passed
@01taylop 01taylop deleted the flat-legacy branch August 2, 2024 14:24
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.

1 participant