Skip to content

Update: fix operator-linebreak overrides schema#13199

Merged
btmills merged 1 commit intomasterfrom
operatorlinebreak-schema
Jun 19, 2020
Merged

Update: fix operator-linebreak overrides schema#13199
btmills merged 1 commit intomasterfrom
operatorlinebreak-schema

Conversation

@mdjermanovic
Copy link
Copy Markdown
Member

Prerequisites checklist

  • I have read the contributing guidelines.
  • The team has reached consensus on the changes proposed in this pull request. If not, I understand that the evaluation process will begin with this pull request and won't be merged until the team has reached consensus.

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

[X] Bug fix

Tell us about your environment

  • ESLint Version: v7.0.0-alpha.3
  • Node Version: v12.14.0
  • npm Version: v6.13.4

What parser (default, Babel-ESLint, etc.) are you using?

default

Please show your full configuration:

Configuration
module.exports = {
    parserOptions: {
        ecmaVersion: 2015
    }
}

What did you do? Please include the actual source code causing the issue.

Online Demo

/*eslint operator-linebreak: ["error", "after", { "overrides": { "+": true } }]*/

What did you expect to happen?

ESLint to report invalid configuration on true. This value should be one of ["after", "before", "none", "ignore"].

What actually happened? Please include the actual, raw output from ESLint.

no warnings

What changes did you make? (Give an overview)

Fixed the schema for overrides in the operator-linebreak rule. The previous schema actually defined allowed enum for the value of a property named "anyOf" (which doesn't make sense).

Also fixed the documentation. This rule has two options, not one option that can be either string or object.

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

This invalid configuration had specific behavior, different from the 4 valid options. It works mostly as "ignore", but it also disallows cases where linebreaks are on both sides of the specified operator. Nevertheless, this isn't documented and it doesn't look it was intentional.

@mdjermanovic mdjermanovic added bug ESLint is working incorrectly rule Relates to ESLint's core rules evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Apr 19, 2020
@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jun 13, 2020
@btmills btmills merged commit 949a5cd into master Jun 19, 2020
@btmills btmills deleted the operatorlinebreak-schema branch June 19, 2020 16:02
@eslint-deprecated eslint-deprecated Bot locked and limited conversation to collaborators Dec 17, 2020
@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 Dec 17, 2020
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 bug ESLint is working incorrectly rule Relates to ESLint's core rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants