我的 package.json 中有以下内容...
"lint:fix": "node --experimental-json-modules ./node_modules/.bin/eslint **/*.mjs --fix"
Run Code Online (Sandbox Code Playgroud)
我的代码中包含以下内容
import pkgjson from "../package.json" assert { type: 'json' };
Run Code Online (Sandbox Code Playgroud)
但是当我运行 lint 命令时,我看到......
1:39 error Parsing error: Unexpected token assert
Run Code Online (Sandbox Code Playgroud)
如何将 json 导入与 eslint 结合使用?
归档时间: |
|
查看次数: |
3199 次 |
最近记录: |