Error `string` and `indent` should be strings
See original GitHub issueI’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:
- Created 6 years ago
- Comments:15 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@IgnusG I’m on npm
5.3.0
.This is definitely a dependency version issue. Removing node_modules and re-
npm install
ing fixed the problem.@cirpo remove node_modules, package.lock and then try
npm install
. Hope it helps