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.

No staged files match src/**/*.{ts,tsx}

See original GitHub issue

Why I get this error while run precommit script?

MBP-Pavel:components pavel$ nvm version
v8.5.0
MBP-Pavel:components pavel$ node -v
v8.5.0
MBP-Pavel:components pavel$ npm -v
5.5.1
MBP-Pavel:components pavel$ npm run precommit

> components@0.1.0 precommit /Users/pavel/Work/astralnalog/components
> lint-staged

 ↓ Running tasks for src/**/*.{ts,tsx} [skipped]
   → No staged files match src/**/*.{ts,tsx}

package.json

"devDependencies": {
  ...
  "husky": "^0.15.0-beta.11",
  "lint-staged": "^4.3.0",
  "prettier": "^1.7.4",
  "tslint": "^5.8.0",
  "typescript": "^2.5.3",
},
"husky": {
  "hooks": {
    "pre-commit": "lint-staged"
  }
}

.lintstagedrc

{
  "src/**/*.{ts,tsx}": ["prettier --write", "git add"]
}
2017-10-27 9 24 58

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:14

github_iconTop GitHub Comments

73reactions
FrimJocommented, Aug 9, 2018

I solved my problem, I had a space in between ts, and tsx change in .lintstagedrc.json from "*.{ts, tsx}" to "*.{ts,tsx}"

$: yarn lint-staged
 ✔ Running tasks for *.{ts,tsx}
✨  Done in 4.99s.
59reactions
ForsakenHarmonycommented, Jan 25, 2019

having a single type, i.e. *.{js} can also break it, use *.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lint-staged can't find staged files matching glob - Stack Overflow
The error I'm getting: No staged files match any of provided globs. What is the right config for my package.json ...
Read more >
Husky + Lint-Staged on a React TypeScript Project
The commit was blocked because Husky called Lint-Staged command that called the ESLint rule check, and as we expected the rule “no-unused-vars” ...
Read more >
lint-staged - npm
Linter commands work on a subset of all staged files, defined by a glob pattern. lint-staged uses micromatch for matching files with the ......
Read more >
lint-staged - Bountysource
When lint-staged is run the .eslintrc.json file is ignored. ... via husky/lint-staged it does not yield the same result as it ignores my...
Read more >
Use ESLint, Prettier like Pro on React Native
Also, I will introduce Husky and lint-staged, and how to use them like Pro. ... {ts,tsx} [skipped] → No staged files match src/**/*....
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