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

feat: support flat config #238

Merged
merged 4 commits into from
Jan 2, 2024
Merged

feat: support flat config #238

merged 4 commits into from
Jan 2, 2024

Conversation

onigoetz
Copy link
Contributor

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

As explained in #190, ESLint has a new config system.
This is meant to be the future default but it does not work out of the box.

This PR aims to allow the usage of flat configuration for pioneers while being future proof at the same time.

Breaking Changes

None

Additional Info

The new API is documented here: https://eslint.org/blog/2022/08/new-config-system-part-3/

Changes introduced by this PR:

  • new configType option to allow to switch between the legacy and future way of loading configuration
  • moved all code to load eslint to worker.js (was duplicated in getESLint.js as well)

Each change is in its own commit, you can review them separately.

This replaces #237.
Once this one is merged I'd happily make another PR for the changes I proposed in tests, but let's not pile everything together.

@onigoetz onigoetz mentioned this pull request Dec 23, 2023
6 tasks
Copy link

codecov bot commented Dec 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (445389c) 100.00% compared to head (8fc1d2d) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #238   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          283       291    +8     
  Branches        78        81    +3     
=========================================
+ Hits           283       291    +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ricardogobbosouza
Copy link
Collaborator

@onigoetz Very good

@ricardogobbosouza ricardogobbosouza changed the title Support flat config feat: support flat config Dec 23, 2023
Copy link
Collaborator

@ricardogobbosouza ricardogobbosouza left a comment

Choose a reason for hiding this comment

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

a note in the readme would be nice

@onigoetz
Copy link
Contributor Author

a note in the readme would be nice

Sure, done :)

However, I'm not sure why Node 16 is failing :/

@ricardogobbosouza
Copy link
Collaborator

ricardogobbosouza commented Dec 28, 2023

@onigoetz the message of your commits must be in lowercase letters

@onigoetz
Copy link
Contributor Author

@ricardogobbosouza sure, done

@ricardogobbosouza
Copy link
Collaborator

ricardogobbosouza commented Dec 29, 2023

Using node 18 have the error Segmentation fault
Only in test flat-config.test.js
Any ideas @alexander-akait?

@alexander-akait
Copy link
Member

It is the problem of jest, it is sad, yeah, just skip it for old nodes

@ricardogobbosouza ricardogobbosouza merged commit 19cadbe into webpack-contrib:master Jan 2, 2024
17 checks 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.

3 participants