Giter VIP home page Giter VIP logo

Comments (6)

zemd avatar zemd commented on June 13, 2024 1

having the same issue but with ( character. as a quick fix would be great if lint-staged could wrap each file name with quotes by default or using some kind configuration option like --wrap-with-quotes but meanwhile the only fix would be using .js with escaping manually:

// ...
 "*": (filenames) => {
    return [`prettier --ignore-unknown --write ${filenames.map((file) => `'${file}'`).join(" ")}`];
  },
// ...

from lint-staged.

iiroj avatar iiroj commented on June 13, 2024

This issue is probably related to an old-running problem of lint-staged not escaping the filenames correctly.

Looking at your logs it seems something eats the $route part on the way, but it could be internal to execa as well, since it's not intentional by lint-staged.

from lint-staged.

iiroj avatar iiroj commented on June 13, 2024

Testing for myself, at least ESLint has no problems with a file like test.$param.js through lint-staged.

Is this an issue with pnpm?

from lint-staged.

iiroj avatar iiroj commented on June 13, 2024

Based on your logs, does thss command work normally for you without lint-staged in the mix, but just running it directly:

pnpm fix:style /home/flc/my/smc/nexus2/third-nexus-client/app/routes/_auth.old.$route.tsx

Also to nitpick your configuration, it says your command is this:

prettier --experimental-ternaries --write .

Since it includes the ., prettier will always run for all files instead of just the staged file. The purpose of lint-staged is to pass the staged file as an argument to your script, so in this case the full script would be:

prettier --experimental-ternaries --write . /home/flc/my/smc/nexus2/third-nexus-client/app/routes/_auth.old.$route.tsx

from lint-staged.

lachieh avatar lachieh commented on June 13, 2024

Duplicate of #962

from lint-staged.

iiroj avatar iiroj commented on June 13, 2024

Thanks @lachieh, closing as duplicate.

from lint-staged.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.