Skip to content

Stdin input throwing unpretty error when config is missing #7213

Closed
@nzakas

Description

(Split out from #7144)

Tell us about your environment

  • ESLint Version: master
  • Node Version: 4.4.2
  • npm Version: 2.15.0

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

Please show your full configuration: n/a

What did you do? Please include the actual source code causing the issue.

Ran this in the command line in a directory without a configuration file.

$ echo 'var x = "y";' | eslint --stdin

What did you expect to happen?

I expected to see the pretty message telling me there is no config file.

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

I get an ugly message telling me a config file is missing:

No ESLint configuration found.
Error: No ESLint configuration found.
    at getLocalConfig (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/config.js:162:35)
    at Config.getConfig (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/config.js:256:22)
    at processText (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/cli-engine.js:222:33)
    at CLIEngine.executeOnText (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/cli-engine.js:749:26)
    at Object.execute (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/lib/cli.js:174:42)
    at /Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/bin/eslint.js:57:36
    at ConcatStream.<anonymous> (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/node_modules/concat-stream/index.js:36:43)
    at emitNone (events.js:72:20)
    at ConcatStream.emit (events.js:166:7)
    at finishMaybe (/Users/cowboyd/.nvm/versions/node/v4.2.3/lib/node_modules/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:475:14)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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 features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions