Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Can't install without prompts #39

Closed
1 task
abitrolly opened this issue Oct 5, 2022 · 3 comments
Closed
1 task

Bug: Can't install without prompts #39

abitrolly opened this issue Oct 5, 2022 · 3 comments
Labels
bug Something isn't working repro:needed

Comments

@abitrolly
Copy link

Environment

Node version: v16.17.1
npm version: 8.15.0
Local ESLint version:
Global ESLint version:
Operating System: Ubuntu 22.04

What parser are you using?

Default (Espree)

What did you do?

I am trying to install ESLint with all defaults be running npm init with --yes option, but it doesn't work.

$ npm init --yes @eslint/config
? How would you like to use ESLint? … 
  To check syntax only
▸ To check syntax and find problems
  To check syntax, find problems, and enforce code style<!-- Paste your code here -->

What did you expect to happen?

All options are chosen by default.

What actually happened?

Command hangs waiting for input.

Participation

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

Additional comments

No response

@abitrolly abitrolly added bug Something isn't working repro:needed labels Oct 5, 2022
@mdjermanovic mdjermanovic transferred this issue from eslint/eslint Oct 5, 2022
@mdjermanovic
Copy link
Member

Hi @abitrolly, thanks for the issue!

This was discussed in #23 and we decided not to support --yes for the reasons described in the linked issue thread.

@mdjermanovic mdjermanovic closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2022
@abitrolly
Copy link
Author

@mdjermanovic understood. From #23.

@aladdin-add's original use case, clarified in #23 (comment), was to have a non-interactive setup that could be run in an unsupervised scenario.

So what is the official way to install ESLint non-interactively without --yes? The only thing that comes to my mind is to throw in some temporary config. I don't know.

@mdjermanovic
Copy link
Member

You can install eslint package:

npm install eslint --save-dev

Then, you should add a config file. A simple config to lint es5 browser scripts can be:

// .eslintrc.js
module.exports = {
    extends: ["eslint:recommended"],
    env: {
        browser: true
    }
};

This enables recommended built-in rules and enables browser globals.

@nzakas nzakas moved this to Complete in Triage Jan 3, 2023
@nzakas nzakas added this to Triage Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working repro:needed
Projects
Archived in project
Development

No branches or pull requests

2 participants