question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clarify `gitDir` usage?

See original GitHub issue

I spent quite some time trying to figure out why my lint-staged config didn’t work:

  "lint-staged": {
    "gitDir": "../",
    "linters": {
      "src/**/*.{js,jsx,json}": [
        "prettier-eslint --write --single-quote",
        "git add"
      ]
    }
  },

Then I tried to define packages/myapp/src/**/*{js,jsx,json} and it worked.

May you add somewhere in the README this information? (that any pattern must use as root the ones defined as gitDir)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

10reactions
sudo-suhascommented, Sep 9, 2017

I just tested this out and I think the current behavior needs to be changed. When I am defining the lint-staged config inside a package, I shouldn’t have to think about relative paths from a parent folder. And I like the idea of automatically detecting the git directory. That should kill a ton of birds in one shot 😛

1reaction
sudo-suhascommented, Nov 13, 2017

Apologies, I somehow missed replying to this. Since release notes serve as our migration guide, it would make sense to show all the changes required for upgrading to lint-staged@5. I have updated the release notes, please take a look.

If you want to include this information in the readme as well, let me know. I can make a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

git --git-dir not working as expected - Stack Overflow
I got tripped trying to use the -C flag after the git command (e.g. git status -C <path> won't work!) – Kedar Paranjape....
Read more >
git init | Atlassian Git Tutorial
git init creates a new Git repository, can be used to convert an existing, unversioned project to a Git repo, or initialize a...
Read more >
git-worktree Documentation - Git
Use git rev-parse --git-path to get the final path. If you manually move a linked worktree, you need to update the gitdir file...
Read more >
Tweak your Git config for multiple user IDs - Opensource.com
This directive supports three keywords: gitdir , gitdir/I , and onbranch . I will briefly explain gitdir , which I use in the...
Read more >
The best way to store your dotfiles: A bare Git repository ...
It uses a bare repository in a novel way, by configuring $HOME as the work tree ... 2. alias config='/usr/bin/git --git-dir=$HOME/.cfg/.git/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found