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

After upgrading to 0.39.8 eslint fails on suggested .eslintrc.js #222

Closed
5 tasks done
some-user123 opened this issue Jul 17, 2023 · 3 comments · Fixed by #224
Closed
5 tasks done

After upgrading to 0.39.8 eslint fails on suggested .eslintrc.js #222

some-user123 opened this issue Jul 17, 2023 · 3 comments · Fixed by #224

Comments

@some-user123
Copy link

Describe the bug

I'm using the suggested config from the README:

// .eslintrc.js
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

module.exports = {
  extends: '@antfu'
}

That won't pass eslint check after upgrade to 0.39.8:

Error:   1:1  error  Unexpected use of the global variable 'process'. Use 'require("process")' instead  n/prefer-global/process

Seems inconsistent to me 😉

Reproduction

https://github.com/antfu/eslint-config/

System Info

Binaries:
    Node: 18.8.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.18.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.6.2 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Edge: Spartan (44.22621.1848.0), Chromium (114.0.1823.82)
    Internet Explorer: 11.0.22621.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@Tragio
Copy link

Tragio commented Jul 19, 2023

This is due to #214.

You can exclude that rule in .eslintrc.js using the following:

// .eslintrc.js
process.env.ESLINT_TSCONFIG = 'tsconfig.json'

module.exports = {
  extends: '@antfu',
  rules: { 'n/prefer-global/process': 0 },
}

@some-user123
Copy link
Author

some-user123 commented Jul 19, 2023

I know, that I can just disable the rule. However, I'd expect to find a guide in the Readme that doesn't violate its own rules or requires changing them...

In the current situation either the rules are bad or the instructions in the Readme...

@zanminkian
Copy link
Contributor

#224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants