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.

Error `string` and `indent` should be strings

See original GitHub issue

I’m getting this error message when running lint-staged with husky:

husky > npm run -s precommit (node v8.1.3)

`string` and `indent` should be strings

husky > pre-commit hook failed (add --no-verify to bypass)

Config:

"lint-staged": {
  "{config,src,tests,mocks}/**/*.{js,jsx}": [
    "prettier-eslint --write",
    "git add",
    "npm run test -- --findRelatedTests"
  ],
  "src/**/*.scss": [
    "stylelint --syntax scss --fix",
    "git add"
  ]
},

I tested out husky without lint-staged and it worked. I also tested out lint-staged with no rules which worked as well.

When I modify my rules to only include one test file like this:

"lint-staged": {
  "test.scss": [
    "stylelint --syntax scss --fix",
    "git add"
  ]
},

I get this error message:

/home/jonathan/Projects/kontextR/cockpit-ui/node_modules/indent-string/index.js:6
                throw new TypeError('`string` and `indent` should be strings');
                ^

TypeError: `string` and `indent` should be strings
    at module.exports (/home/jonathan/Projects/kontextR/cockpit-ui/node_modules/indent-string/index.js:6:9)
    at renderHelper (/home/jonathan/Projects/kontextR/cockpit-ui/node_modules/listr-update-renderer/index.js:19:16)
    at render (/home/jonathan/Projects/kontextR/cockpit-ui/node_modules/listr-update-renderer/index.js:48:12)
    at Timeout._id.setInterval [as _onTimeout] (/home/jonathan/Projects/kontextR/cockpit-ui/node_modules/listr-update-renderer/index.js:68:4)
    at ontimeout (timers.js:488:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:283:5)

Environment node: 8.1.3 npm: 5.1.0 husky: 0.14.3 lint-staged: 4.0.1

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
kevinchappellcommented, Jul 18, 2017

@IgnusG I’m on npm 5.3.0.

This is definitely a dependency version issue. Removing node_modules and re- npm installing fixed the problem.

1reaction
IgnusGcommented, Aug 3, 2017

@cirpo remove node_modules, package.lock and then try npm install. Hope it helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proper indentation for multiline strings? - python
In docstrings it is obvious that you should use correct indentation as most uses of the docstring will do the required processing.
Read more >
Is there a way to indent here-strings? - TechNet - Microsoft
It appears that the only thing you cannot indent in a here-string is the closing "@. Anything else can be indented. Sample error...
Read more >
Proper Indentation for Python Multiline Strings - YouTube
Full Tutorial: https://blog.finxter.com/proper- indentation -for-python-multiline- strings /Email Academy: ...
Read more >
Proper Indentation for Python Multiline Strings - Finxter
In this article we are going to look at how to properly indent your code for Python multiline strings, so let's start by...
Read more >
YAML Multiline Strings
They can be in the string, but : cannot appear before a space or newline, and # cannot appear after a space or...
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