如何配置package.json以运行eslint脚本 [英] How to configure package.json to run eslint script
问题描述
所以我将eslint用作我的react项目的一个linter,我希望它检查我所有的.js
文件.
我可以通过脚本来做到这一点:
"lint": "eslint back/*.js && eslint backTest/*.js && eslint front/actions/*.js"
如何获取它以递归方式检查每个.js
文件,例如:
"lint": "eslint -r *.js"
这将使我不必单独键入每个文件
预先感谢您的帮助
eslint "**/*.js"
以递归方式(在当前文件夹中)在所有文件夹中的所有js文件上运行
您还可以:AnyFolder/**/*.js
并忽略文件夹:eslint "**/*.js" --ignore-pattern node_modules/
在 eslint/命令行界面中了解更多信息 >
So I am using eslint as a linter for my react project and I would like it to check all of my .js
files.
I am able to do this through the script:
"lint": "eslint back/*.js && eslint backTest/*.js && eslint front/actions/*.js"
how can I get it to examine every .js
file recursively, something like:
"lint": "eslint -r *.js"
This would save me having to type out each file inidvidually
Thanks in advance for the help
eslint "**/*.js"
to run on all js files in all the folders recursively (in the current folder)
You can also do: AnyFolder/**/*.js
And to ignore a folder: eslint "**/*.js" --ignore-pattern node_modules/
Know more at eslint/command-line-interface
这篇关于如何配置package.json以运行eslint脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!