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

feature: Support Flat configs in v8 #354

Merged
merged 4 commits into from
Oct 6, 2024

Conversation

lotmek
Copy link
Contributor

@lotmek lotmek commented Oct 4, 2024

Description

  • Handle flat config in rule-finder.js
  • Add a new --flatConfig flag
  • Load ESLint class using FlatESLint class
  • Add unit tests for basic flat config

@lotmek lotmek mentioned this pull request Oct 4, 2024
README.md Outdated Show resolved Hide resolved
src/bin/find.js Outdated Show resolved Hide resolved
src/lib/rule-finder.js Outdated Show resolved Hide resolved
src/lib/rule-finder.js Outdated Show resolved Hide resolved
test/lib/rule-finder.js Outdated Show resolved Hide resolved
test/lib/rule-finder.js Outdated Show resolved Hide resolved
test/lib/rule-finder.js Outdated Show resolved Hide resolved
test/lib/rule-finder.js Outdated Show resolved Hide resolved
@lotmek lotmek requested a review from ljharb October 4, 2024 23:50
src/lib/rule-finder.js Outdated Show resolved Hide resolved
src/lib/rule-finder.js Outdated Show resolved Hide resolved
src/lib/rule-finder.js Outdated Show resolved Hide resolved
src/lib/rule-finder.js Outdated Show resolved Hide resolved
src/lib/rule-finder.js Outdated Show resolved Hide resolved
@lotmek lotmek requested a review from ljharb October 5, 2024 14:46
Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

LGTM, this will be semver-minor

@ljharb ljharb force-pushed the feat/support-flat-config branch from e08a7e5 to dfd671e Compare October 6, 2024 01:09
@ljharb
Copy link
Collaborator

ljharb commented Oct 6, 2024

@lotmek it looks like the exception is always being thrown.

@lotmek
Copy link
Contributor Author

lotmek commented Oct 6, 2024

@lotmek it looks like the exception is always being thrown.

Hello @ljharb, tell me if I'm wrong, but I think flat configs are not supported in ESLint v7

I can add a condition to skip the flat config tests if ESLint version is lower than 8, what do you think of it ?

  if (semver.satisfies(eslintPkg.version, '>= 8')) {
    describe('flat config', () => {
        ...
    })
  }

@ljharb
Copy link
Collaborator

ljharb commented Oct 6, 2024

I have eslint 8.56 installed and it's still failing locally, fwiw.

Certainly the flat config tests should be ensuring it throws in eslint 7, good catch.

@lotmek
Copy link
Contributor Author

lotmek commented Oct 6, 2024

I have eslint 8.56 installed and it's still failing locally, fwiw.

Certainly the flat config tests should be ensuring it throws in eslint 7, good catch.

I did some changes, can you try again ?

@ljharb ljharb force-pushed the feat/support-flat-config branch from b690889 to de07149 Compare October 6, 2024 06:28
@ljharb
Copy link
Collaborator

ljharb commented Oct 6, 2024

LGTM, thanks

@ljharb ljharb merged commit de07149 into sarbbottam:master Oct 6, 2024
28 checks passed
@efoken efoken mentioned this pull request Oct 7, 2024
14 tasks
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