Skip to content

Docs: --rule also needs --no-eslintrc to "start fresh" #2773

@IanVS

Description

@IanVS

I am adding ESLint to an existing project and have many failures to clean up. I would like to use the CLI to apply only one rule at a time, fix only those issues, and then commit just those fixes, so that I have a single rule per commit. However, I am finding this difficult.

My plan was to use eslint --reset --rule 'quotes: [2, single]' lib so that only the quotes rule is applied, and none of the default rules, as suggested in the docs:

--rule
This option specifies rules to be used. They will be merged into any previously defined rules. To start fresh, simply combine with the --reset flag.

But I am extending standard in my .eslintrc and the --reset flag does not reset rules in plugins (as mentioned in #2100 (comment)).

I am also using ECMA modules ("ecmaFeatures": {"modules": true} which I cannot find a way to set from the CLI, so using --no-eslintrc isn't an option to avoid extending standard. For the time being I can remove the plugin from my .eslintrc, but it seems like maybe there should be a better way?

Edit: Even when using --reset, the rules defined in my .eslintrc are still applied. In my opinion, the documentation for --rule is a little misleading. To really "start fresh", it seems necessary to use --no-eslintrc in addition to --reset (at least until v1.0).

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 incorrectlydocumentationRelates to ESLint's documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions