wxt-dev / wxt

⚡ Next-gen Web Extension Framework
https://wxt.dev
MIT License
4.43k stars 185 forks source link

ESLint config being generated when ESLint is not installed #1082

Open aklinker1 opened 1 week ago

aklinker1 commented 1 week ago

Describe the bug

When running wxt prepare, ESLint config is generated even when eslint isn't installed.

Reproduction

https://github.com/aklinker1/github-better-line-counts/tree/2660c4f1f7c47a1e2ace8d410e76931082507986

Steps to reproduce

bun i

And .wxt/eslintrc-auto-import.json will be created.

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 4.91 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.3 - ~/.asdf/installs/nodejs/18.20.3/bin/node
    npm: 10.7.0 - ~/.asdf/plugins/nodejs/shims/npm
    bun: 1.1.31 - ~/.bunv/bin/bun
  Browsers:
    Chrome: 129.0.6668.101
    Safari: 17.2.1
  npmPackages:
    wxt: ^0.19.11 => 0.19.11

Used Package Manager

bun

Validations

aklinker1 commented 1 week ago

This probably just needs to be changed to undefined instead of defaulting to 8. Should probably return undefined from getEslintVersion in this case as well, instead of an empty tuple.

https://github.com/wxt-dev/wxt/blob/b14c9107fe8a44d273912b9d349c9aadeb5f12a6/packages/wxt/src/core/resolve-config.ts#L388-L389