eslint icon indicating copy to clipboard operation
eslint copied to clipboard

feat: add meta.defaultOptions

Open JoshuaKGoldberg opened this issue 2 years ago • 42 comments

Prerequisites checklist

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

[ ] Documentation update [ ] Bug fix (template) [ ] New rule (template) [ ] Changes an existing rule (template) [ ] Add autofix to a rule [ ] Add a CLI option [x] Add something to the core [ ] Other, please explain:

What changes did you make? (Give an overview)

Augments linting to factor in a new optional meta.defaultOptions. If a rule describes default options this way, any user-provided options are merged on top of the default options.

These defaults are applied by a new deepMergeArrays utility in:

  • ConfigValidator
  • Linter in two places:
    • For configs: by augmenting the existing getRuleOptions helper
    • For inline comments in flat config: with a new getRuleOptionsInline helper
      • Inline comments in legacy configs go through RuleValidator instead
  • RuleValidator

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

  • Issue: https://github.com/eslint/eslint/issues/17448
  • RFC: https://github.com/eslint/rfcs/pull/113

Co-authored-by: Milos Djermanovic [email protected]

JoshuaKGoldberg avatar Oct 16 '23 16:10 JoshuaKGoldberg

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Oct 16 '23 16:10 eslint-github-bot[bot]

Deploy Preview for docs-eslint canceled.

Name Link
Latest commit c555a0549a6c6d395eaeccdc7aef9b6017d81594
Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/66bc05c46a48860008229a38

netlify[bot] avatar Oct 16 '23 16:10 netlify[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Oct 19 '23 03:10 eslint-github-bot[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Oct 26 '23 10:10 eslint-github-bot[bot]

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Nov 05 '23 22:11 github-actions[bot]

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Nov 16 '23 22:11 github-actions[bot]

Not stale. @JoshuaKGoldberg there's a review comment for you to look into. Thanks.

Rec0iL99 avatar Nov 17 '23 13:11 Rec0iL99

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Nov 21 '23 02:11 eslint-github-bot[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Nov 21 '23 02:11 eslint-github-bot[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Nov 21 '23 03:11 eslint-github-bot[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Nov 21 '23 04:11 eslint-github-bot[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Nov 21 '23 04:11 eslint-github-bot[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Nov 21 '23 05:11 eslint-github-bot[bot]

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Dec 01 '23 22:12 github-actions[bot]

This pull request was auto-closed due to inactivity. While we wish we could keep working on every request, we unfortunately don't have the bandwidth to continue here and need to focus on other things. You can resubmit this pull request if you would like to continue working on it.

github-actions[bot] avatar Dec 08 '23 22:12 github-actions[bot]

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Dec 09 '23 13:12 eslint-github-bot[bot]

In view of the current situation that the related RFC is about to be merged, I think this PR will also be active, so it should not be regarded as stable and closed.

kecrily avatar Dec 09 '23 13:12 kecrily

Hi @JoshuaKGoldberg!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The commit message tag wasn't recognized. Did you mean "docs", "fix", or "feat"?
  • There should be a space following the initial tag and colon, for example 'feat: Message'.
  • The first letter of the tag should be in lowercase

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

eslint-github-bot[bot] avatar Dec 16 '23 04:12 eslint-github-bot[bot]

@JoshuaKGoldberg can you please rebase and address the conflicts?

nzakas avatar Jan 04 '24 20:01 nzakas

The browser tests aren't failing for me locally. Test flake?

JoshuaKGoldberg avatar Jan 06 '24 23:01 JoshuaKGoldberg

Yes, the browser tests can be a little bit flaky, but they look okay right now.

nzakas avatar Jan 09 '24 22:01 nzakas

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Jan 21 '24 22:01 github-actions[bot]

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Feb 01 '24 22:02 github-actions[bot]

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

@JoshuaKGoldberg there are a few conflicts for you to look at and a review comment too

Waiting for @mdjermanovic's review before merging

Rec0iL99 avatar Feb 02 '24 03:02 Rec0iL99

Maybe we could simplify function deepMergeObjects like this:

function deepMergeObjects(first, second) {
    if (second === void 0) {
        return first;
    }

    if (!isObjectNotArray(first) || !isObjectNotArray(second)) {
        return second;
    }

    const result = {
        ...first,
        ...second
    };

    for (const key of Object.keys(second)) {
        if (Object.prototype.propertyIsEnumerable.call(first, key)) {
            result[key] = deepMergeObjects(first[key], second[key]);
        }
    }

    return result;
}

mdjermanovic avatar Feb 02 '24 12:02 mdjermanovic

Wow! Really nice refactor, thanks! 👏

JoshuaKGoldberg avatar Feb 02 '24 19:02 JoshuaKGoldberg

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Feb 15 '24 22:02 github-actions[bot]

Ah, timing - I'm going through the code now. Will respond soon.

JoshuaKGoldberg avatar Feb 15 '24 22:02 JoshuaKGoldberg

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

github-actions[bot] avatar Feb 29 '24 22:02 github-actions[bot]

Waiting for @mdjermanovic to review here.

@JoshuaKGoldberg there's a conflict to resolve.

Rec0iL99 avatar Mar 01 '24 04:03 Rec0iL99