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

next lint shows initial setup prompt even though package.json has eslintConfig key #40133

Closed
1 task done
stefanprobst opened this issue Aug 31, 2022 · 2 comments · Fixed by #40158
Closed
1 task done
Labels
Linting Related to `next lint` or ESLint with Next.js.

Comments

@stefanprobst
Copy link
Contributor

stefanprobst commented Aug 31, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022
Binaries:
  Node: 16.17.0
  npm: 8.15.0
  Yarn: 1.22.19
  pnpm: 7.9.0
Relevant packages:
  next: 12.2.6-canary.7
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

i have a package.json file with eslint configured.

when running next lint it shows the "How would you like to configure ESLint" prompt.

Expected Behavior

don't prompt to setup eslint when it is already configured in package.json

Link to reproduction

n/a

To Reproduce

  1. add eslintConfig to package.json
  2. run npm run lint

issue seems to be that hasEslintConfiguration returns:

{
  "exists": false,
  "emptyEslintrc": false,
  "emptyPkgJsonConfig": false
}

https://github.com/vercel/next.js/blob/canary/packages/next/lib/eslint/hasEslintConfiguration.ts#L35 will never return with exists: true

@stefanprobst stefanprobst added the bug Issue was opened via the bug report template. label Aug 31, 2022
@balazsorban44
Copy link
Member

This seems to have been introduced in #39872 as the first release I could verify this in was 12.2.6-canary.3

@balazsorban44 balazsorban44 added kind: bug Linting Related to `next lint` or ESLint with Next.js. and removed bug Issue was opened via the bug report template. labels Sep 1, 2022
@kodiakhq kodiakhq bot closed this as completed in #40158 Sep 1, 2022
kodiakhq bot pushed a commit that referenced this issue Sep 1, 2022
Fixes #40133

Fixes a small regression introduced in #39872. We should be able to detect if a non-empty `package.json#eslintConfig` property is present.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
atilafassina pushed a commit to atilafassina/next.js that referenced this issue Sep 5, 2022
Fixes vercel#40133

Fixes a small regression introduced in vercel#39872. We should be able to detect if a non-empty `package.json#eslintConfig` property is present.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Linting Related to `next lint` or ESLint with Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants