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

Update: add missing additionalProperties: false to some rules' schema #13198

Merged
merged 1 commit into from Jun 19, 2020

Conversation

mdjermanovic
Copy link
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 id-match: ["error", "^[a-z]+([A-Z][a-z]+)*$", { "foo": true }]*/
/*eslint no-unused-vars: ["error", { "foo": true }] */
/*eslint padded-blocks: ["error", "never", { "foo": true }] */

What did you expect to happen?

ESLint to report invalid configuration for all 3 rules, because "foo" isn't an expected property.

This is how almost all rules work, to avoid typos and misconfiguration.

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

no warnings

What changes did you make? (Give an overview)

Added additionalProperties: false to the following rules:

  • id-match
  • no-unused-vars
  • padded-blocks

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

I think this kind of fixes should be semver-minor.

@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 enhancement This change enhances an existing feature of ESLint and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jun 13, 2020
@kaicataldo
Copy link
Member

I'd like another review before merging, but this makes sense to me and I agree that this should be a semver-minor bug fix.

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

I agree that this is a semver-minor bugfix. The rest of the rules' schemas establish the precedent that we'll use additionalProperties: false to prevent accidental misconfigurations, and it's unexpected that these three rules didn't have that.

@btmills btmills merged commit 638a6d6 into master Jun 19, 2020
@btmills btmills deleted the schema-additionalproperties branch June 19, 2020 16:06
@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 enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants