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.

How to pass options?

See original GitHub issue

Hey there,

I was wondering how to pass options to lint-staged as there doesn’t appear to be an example in the README.

In particular I’m doing:

"precommit": "lint-staged --verbose",

but nothing different appears to be happening with the --verbose flag so maybe I’m just not using it correctly?

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
elsbrockcommented, Jun 12, 2017

Okay I got it. You simply add it to the same block. I was confused because the output makes you believe it interpretes the gitDir as pattern:

$ cat package.json
…
  "scripts": {
    "precommit": "lint-staged"
  },
  "lint-staged": {
    "gitDir": "../",
    "*.js": [
      "node node_modules/eslint/bin/eslint.js"
    ]
  },
…
$ node node_modules/lint-staged/index.js --verbose
 ↓ Running tasks for gitDir [skipped]
   → No staged files match gitDir
 ↓ Running tasks for *.js [skipped]
   → No staged files match *.js
1reaction
tnrichcommented, Jun 9, 2017

Hey @okonet , I did see that - definitely nice to have a list of what options are available. As for actually using an option though, I’m still unclear on what the correct method is. Did I do it correctly here:

"precommit": "lint-staged --verbose", ?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding arguments and options to your Bash scripts - Red Hat
The ability to use positional parameters—otherwise known as arguments—to specify data to be used as values for variables in the scripts is one ......
Read more >
Parameters / Arguments - Windows CMD - SS64.com
How-to: Pass Command Line arguments (Parameters) to a Windows batch file. A command line argument (or parameter) is any value passed into a...
Read more >
Command Line Arguments in Python - GeeksforGeeks
Options that require arguments should be followed by an equal sign (=). ... Pass list as command line argument in Python.
Read more >
How to Use Command Line Arguments in a Bash Script
We've previously examined how to pass command-line arguments to a bash script. In this tutorial, we'll take a look at how we can...
Read more >
Python - Command Line Arguments - Tutorialspoint
This method getopt.getopt() returns value consisting of two elements: the first is a list of (option, value) pairs. The second is the list...
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