[英]package.json - pathname pattern for .ts .tsx .js .jsx
I am trying to write a npm script that goes trought all of my src files and tests (lints) files that end in either .ts
.tsx
.js
or .jsx
. 我正在尝试编写一个npm脚本,该脚本遍历了所有以.ts
.tsx
.js
或.jsx
结尾的src文件和测试(皮棉)文件。 So the linter should test all of these (and only these). 因此,lint应该测试所有这些(并且仅测试这些)。
What I have so far: "lint": "eslint --max-warnings 0 --ext .js \\"src/**/*.ts*\\""
到目前为止,我所拥有的: "lint": "eslint --max-warnings 0 --ext .js \\"src/**/*.ts*\\""
.ts
and .tsx
files? 这会同时测试.ts
和.tsx
文件吗? You could do it like this: 您可以这样做:
"lint": "eslint --max-warnings 0 --ext .js \"src/**/*.{ts,tsx}\""
As far as I know, that is the only way to handle multiple file extensions. 据我所知,这是处理多个文件扩展名的唯一方法。 When using a asteriks, i get the feedback "The system cannot find the path specified." 使用星号时,我得到反馈“系统找不到指定的路径”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.