Skip to content

[6.0.0] '--rulesdir' option doesn't work if a config file has 'root:true' #11888

Description

@mysticatea

Tell us about your environment

  • ESLint Version: 6.0.0
  • Node Version: 12.2.0
  • npm Version: 6.9.0

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

Default.

Please show your full configuration:

module.exports = {
    root: true,
    rules: {
        test: "error"
    }
};
// internal-rules/test.js
const { Linter } = require("eslint")
const linter = new Linter()
const rules = linter.getRules()

module.exports = rules.get("no-console")

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

console.log("hello")
eslint test.js --rulesdir internal-rules

What did you expect to happen?

The test rule in the internal-rules directory warns the code.

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

C:\Users\t-nagashima.AD\dev\sandbox\test.js
  1:1  error  Definition for rule 'test' was not found  test

✖ 1 problem (1 error, 0 warnings)

Are you willing to submit a pull request to fix this bug?

Yes.

Metadata

Metadata

Assignees

No one assigned

    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 discussionbugESLint is working incorrectlycoreRelates to ESLint's core APIs and featuresregressionSomething broke

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions