[英]package.json webpack linting json file with eslint
我正在嘗試使用 eslint lint json 文件。 有沒有辦法用 esline 做到這一點,或者有沒有我可以為此目的使用的插件? 謝謝。
我通過安裝eslint-plugin-json
模塊解決了這個問題,然后將'json'
類型添加到.eslintrc
的plugins
部分
然后我可以像這樣 lint json 文件
eslint . --ext .json
我試過eslint-plugin-json
,但它不會為你自動修復你的 json,這意味着你必須手動修復 lint 問題。
所以我制作了eslint-plugin-json-format
,它內置了自動修復功能。
它還將(可選)為您對 package.json 進行排序
eslint --ext .json . --fix
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.