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

Init wizard is still not generating flat config #114

Closed
egorFiNE opened this issue May 6, 2024 · 4 comments
Closed

Init wizard is still not generating flat config #114

egorFiNE opened this issue May 6, 2024 · 4 comments

Comments

@egorFiNE
Copy link

egorFiNE commented May 6, 2024

Just like in #18369, init wizard is still generating old config format.

Steps to repeat:

  1. create an empty dir
  2. npm init in it
  3. npm init @eslint/config in it
  4. Answer questions

Expected result:

Successfully created new config format

Actual result:

Successfully created .eslintrc.js file

Maybe related to #106, although locally installed eslint version is the latest.

Complete shell session log

Complete shell session log
Last login: Mon May  6 11:26:49 on ttys000
gray:workspace egor$ mkdir eslint-frustration
gray:workspace egor$ cd eslint-frustration/
gray:eslint-frustration egor$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (eslint-frustration)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/egor/workspace/eslint-frustration/package.json:

{
  "name": "eslint-frustration",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}


Is this OK? (yes) yes
gray:eslint-frustration egor$ echo 'console.log("Hello world");' > test.mjs
gray:eslint-frustration egor$ ls
package.json  test.mjs
gray:eslint-frustration egor$ npm init @eslint/config
✔ How would you like to use ESLint? · style
✔ What type of modules does your project use? · esm
✔ Which framework does your project use? · none
✔ Does your project use TypeScript? · No / Yes
✔ Where does your code run? · browser
✔ How would you like to define a style for your project? · prompt
✔ What format do you want your config file to be in? · JavaScript
✔ What style of indentation do you use? · 4
✔ What quotes do you use for strings? · single
✔ What line endings do you use? · unix
✔ Do you require semicolons? · No / Yes
Local ESLint installation not found.
The config that you've selected requires the following dependencies:

eslint@latest
✔ Would you like to install them now? · No / Yes
✔ Which package manager do you want to use? · npm
Installing eslint@latest

added 89 packages, and audited 90 packages in 2s

22 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
A config file was generated, but the config file itself may not follow your linting rules.
Successfully created .eslintrc.js file in /Users/egor/workspace/eslint-frustration
gray:eslint-frustration egor$ npx eslint --version
v9.2.0
gray:eslint-frustration egor$
@aladdin-add
Copy link
Member

can you try npm init @eslint/config@latest?

@aladdin-add
Copy link
Member

Duplicate of eslint/eslint#18369

@aladdin-add aladdin-add marked this as a duplicate of eslint/eslint#18369 May 6, 2024
@egorFiNE
Copy link
Author

egorFiNE commented May 6, 2024

Duplicate of eslint/eslint#18369

It is indeed, hence why I have linked it.

can you try npm init @eslint/config@latest?

This way it works as expected.

But that's not the command that's specified in the documentation and which the website leads users to start with.

@nzakas
Copy link
Member

nzakas commented May 6, 2024

It is updated here:
https://eslint.org/docs/latest/use/getting-started

We just need to update it on the homepage.

@nzakas nzakas closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants