Skip to content

Bug: fix rule schemas #16879

@mho22

Description

@mho22

Environment

Node version: 18.8.0
npm version: 8.18.0
Local ESLint version: 8.26.0
Global ESLint version: 8.26.0
Operating System: macOS 10.15.7

What parser are you using?

Default (Espree)

What did you do?

Configuration
{
	"root": true,
	"env": {
    	"node": true,
		"browser": true
	},
	"extends": [ "eslint:recommended" ],
	"ignorePatterns": [ "**/node_modules/**/*" ],
  	"rules": {
		"no-undef" : "off",
		"no-unused-vars" : "off",
		"array-element-newline": [ "error", "always", { "minItems": 2 } ]
	}
}
var c = [1];
var d = [1, 2];
var e = [1, 2, 3
];
var f = [ 1, 2, 3 ];
var g = [
    function foo() {
        dosomething();
    }, function bar() {
        dosomething();
    }
];

What did you expect to happen?

It should probably return a configuration error because { "minItems" : 2 } shouldn't be allowed.

What actually happened?

it doesn't take the option into account, the rule works like it should have been : "array-element-newline": [ "error", "always" ] without any configuration error reported.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

Checklist

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbreakingThis change is backwards-incompatiblebugESLint is working incorrectlyrepro:yesIssues with a reproducible exampleruleRelates to ESLint's core rules

Type

No type

Projects

Status

Complete

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions