![](/img/trans.png)
[英]Node 16: is the --experimental-json-modules CLI flag still required?
[英]ESLint not working for json import when using experimental-json-modules
我的 package.json 中有以下內容...
"lint:fix": "node --experimental-json-modules ./node_modules/.bin/eslint **/*.mjs --fix"
以及我的代碼中的以下內容
import pkgjson from "../package.json" assert { type: 'json' };
但是當我運行 lint 命令時,我看到...
1:39 error Parsing error: Unexpected token assert
如何在 eslint 中使用 json 導入?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.