antfu / eslint-config

Anthony's ESLint config preset

Home Page:https://eslint-config.antfu.me/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not run on save

safejace opened this issue · comments

Describe the bug

when i save my files in vscode, it does not format the files

Reproduction

https://stackblitz.com/edit/github-nwnyxj?file=server%2Fapi%2Ftest.ts

System Info

System:
    OS: Linux 6.2 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (20) x64 12th Gen Intel(R) Core(TM) i7-12800H
    Memory: 4.20 GB / 31.01 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.10.0 - ~/.local/share/pnpm/node
    npm: 10.2.3 - ~/.local/share/pnpm/npm
    pnpm: 8.7.6 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 120.0.6099.71

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.

edit:

just a note cuz i was messing around with it. but i added the formatters to the repro and got this error:

Error: Unexpected key "formatters" found.

Does it work if you save multiple times?

Does it work if you save multiple times?

no. does it for you in the repro?

The reproduction works for me on my local VS Code. Did you even get https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint installed?

The reproduction works for me on my local VS Code. Did you even get https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint installed?

yes, as far as i am aware, i had everything installed as per the readme.

why are the files not being formatted in the repro env?

No, your repros works for me. I am not able to reproduce it

Do you see something in your ESlint tab? An error that could be helpful?
image

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

commented

I really do not want to reopen this, but I think I can provide some help as I had very similar problem.

I forgot to install typescript and as such, eslint did ignore all *.ts files.

If you just run eslint . you will end up with an empty log with no problems cause it skips all auto-ignored files, so instead, pin just a single file down.

To diagnose the problem, break a file intentionally then run:

pnpm eslint src/index.ts --debug

image

So yhea basically, (future me) install typescript, plus it might be worth it to run eslint on a single file.