Skip to content

ESLint looks for .eslintrc.* files even when -c flag is used #9535

@not-an-aardvark

Description

@not-an-aardvark

Tell us about your environment

  • ESLint Version: master
  • Node Version: 8.8.0
  • npm Version: 5.4.2

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

default

Please show your full configuration:

Configuration
# foo.yml

rules:
  semi: 2
# .eslintrc.yml

rules:
  no-console: 2

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('foo');
eslint -c foo.yml foo.js

What did you expect to happen?

I expected no errors to be reported, because I used the -c flag to specify a config, so I did not expect ESLint to also look for other config files in the filesystem.

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

1:1   error  Unexpected console statement         no-console

In addition to the config file specified with -c, ESLint also looked for .eslintrc files in the current directory, so the no-console rule was enabled.

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 discussioncoreRelates to ESLint's core APIs and featuresdocumentationRelates to ESLint's documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions