Validation Warning: Unknown option "*.js" with value XXX was found in the config root.
See original GitHub issueDescription
I get this error on precommit hook: ● Validation Warning:
Unknown option “*.js” with value [‘prettier-eslint --write’, ‘git add’] was found in the config root.
You are probably trying to mix simple and advanced config formats. Adding
“linters”: { “*.js”: [“prettier-eslint --write”,“git add”] }
will fix it and remove this message.
Please refer to https://github.com/okonet/lint-staged#configuration for more information…
It seems that in the last version 7.2.0 the configuration options changed: from
"lint-staged": {
"*.{js,scss}": [
"prettier-eslint --write",
"git add"
]
"ignore": [
"**/src/scripts/*.min.js"
]
},
to
"lint-staged": {
"linters": {
"*.{js,scss}": [
"prettier-eslint --write",
"git add"
]
},
"ignore": [
"**/src/scripts/*.min.js"
]
},
Documentation need to be updated.
Steps to reproduce
Install version 7.20 Add the following config in package.json:
"lint-staged": {
"*.{js,scss}": [
"prettier-eslint --write",
"git add"
]
"ignore": [
"**/src/scripts/*.min.js"
]
},
Environment
- OS: macOS High Sierra
- Node.js: v9.10.1
lint-staged
: 7.2.0
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
jest-validate | Yarn - Package Manager
Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration.
Read more >Configuring Jest
The file will be discovered automatically, if it is named jest.config.js|ts|mjs|cjs|json . You can use --config flag to pass an explicit path to ......
Read more >Could not find a declaration file for module 'vue-xxx'
I have tried 'vue-treeselect', 'vue-select', 'vue-multiselect' with more or less the same result (* those libraries don't allow import ...
Read more >Troubleshooting Common Errors - Gatsby
Problems installing sharp with gatsby-plugin-sharp - gyp ERR! build error ... The version of Node.js that's used to install sharp needs to match...
Read more >Converse.js API Documentation Source: headless/dist ...
"While position does not point past the end of data:" for (let i = 0; i < data.length; i++) { // "Find the...
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
Nice rant. Like I said. A PR is welcome.
We are to the classic problem here, who writes the code thinks usage/documentation is clear and obvious. Neither the advance config format neither the warning does not explain, or give an example how a correct config should be. Literally here is the avance format:
Advanced config format To set options and keep lint-staged extensible, advanced format can be used. This should hold linters object in linters property.
To set options and keep lint-staged extensible, advanced format can be used This does not say nothing, what options?, what does it mean keep extensible? What about: To customize lint-staged some advance options are available:
This should hold linters object in linters property. What is the
linters
object? What is the linters property? and where should I keep it? What about: To use the avance options the config format should be as the following:Now is useless to discuss on this and point references how documentation should be written. Just keep in mind that when we write configuration documentation we should put ourself in other shoes.