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

New: extends in glob-based config (fixes #8813) #11554

Merged
merged 4 commits into from May 24, 2019
Merged

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented Mar 26, 2019

What is the purpose of this pull request? (put an "X" next to item)

[X] Add something to the core: fixes #8813

What changes did you make? (Give an overview)

This PR adds support for extends and nested overrides in overrides setting.

Both nested overrides settings and the overrides settings in extended configs in a overrides item work similarly. Those settings will be applied only when both glob patterns of the parent overrides and the child overrides were matched.

Is there anything you'd like reviewers to focus on?

Nothing in particular.

@mysticatea mysticatea added core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion feature This change adds a new feature to ESLint do not merge This pull request should not be merged yet labels Mar 26, 2019
@mysticatea
Copy link
Member Author

I'm not sure why "commit-message" check failed 🤔

@platinumazure platinumazure changed the title New: extends in glob-based config (fixes #8813) New: extends in glob-based config (fixes #8813) Mar 27, 2019
@platinumazure platinumazure changed the title New: extends in glob-based config (fixes #8813) New: extends in glob-based config (fixes #8813) Mar 27, 2019
@mysticatea mysticatea removed the do not merge This pull request should not be merged yet label May 10, 2019
@mysticatea
Copy link
Member Author

I updated this PR and I believe ready for review.

@mysticatea mysticatea changed the title New: extends in glob-based config (fixes #8813) New: extends in glob-based config (fixes #8813) May 18, 2019
Copy link
Member Author

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

Thank you for your review!

conf/config-schema.js Show resolved Hide resolved
tests/lib/shared/config-validator.js Show resolved Hide resolved
Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Just left one question.

lib/cli-engine/config-array-factory.js Show resolved Hide resolved
@mysticatea
Copy link
Member Author

(If I use GitHub review feature to bundle multiple replies, GitHub seems to show those duplicate. 😕 )

@mysticatea mysticatea merged commit 54e6eda into master May 24, 2019
@mysticatea mysticatea deleted the overrides-extends branch May 24, 2019 18:42
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request May 24, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request May 27, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request May 30, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request May 30, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request Jun 18, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request Jun 22, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request Jun 23, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request Jun 23, 2019
kaykayehnn added a commit to kaykayehnn/typescript-react-redux-boilerplate that referenced this pull request Jun 24, 2019
@gziolo
Copy link

gziolo commented Aug 29, 2019

It looks like overrides inherits also basePath for filtering files from the location of the config file when using extend making it not that much useful when consuming config published to npm. Related PR where I discovered it: WordPress/gutenberg-examples#87 (comment)

This is the line which sets basePath based on the location of the file:

const basePath = filePath ? path.dirname(filePath) : cwd;

Example of the override:

criteria:
     { includes: [Array],
       excludes: null,
       basePath:
        '/Users/gziolo/PhpstormProjects/gutenberg-examples/node_modules/@wordpress/scripts/config' },

which obviously can't match any files in the project.

@platinumazure
Copy link
Member

@gziolo Would you mind opening a new issue? Thanks!

@gziolo
Copy link

gziolo commented Aug 29, 2019

I think it's similar to #12032. I commented there. I wanted to do more research before jumping into creating a new issue :)

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Nov 21, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Nov 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Glob override configs do not support "extends"
4 participants