[英]ESLint not working for json import when using experimental-json-modules
I have the following in my package.json...我的 package.json 中有以下内容...
"lint:fix": "node --experimental-json-modules ./node_modules/.bin/eslint **/*.mjs --fix"
And the following in my code以及我的代码中的以下内容
import pkgjson from "../package.json" assert { type: 'json' };
But when I run the lint command I see...但是当我运行 lint 命令时,我看到...
1:39 error Parsing error: Unexpected token assert
How do I use json imports with eslint?如何在 eslint 中使用 json 导入?
Eslint Support of assert {type: "json"}
Eslint 支持
assert {type: "json"}
Eslint discussion thread Eslint 讨论线程
In the discussion thread you can find several alternatives to solve this problem在讨论线程中,您可以找到解决此问题的几种替代方法
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.