简体   繁体   English

如何在 Yeoman webapp 中配置 eslint?

[英]How can I configure eslint in Yeoman webapp?

I don't find the right .eslintrc to edit in my Yeoman webapp folder.我在 Yeoman webapp 文件夹中.eslintrc要编辑的正确.eslintrc I would like to use double quote instead single quote.我想用双引号代替单引号。 I also try do add a .eslintrc in my home folder without success.我也尝试在我的主文件夹中添加一个.eslintrc没有成功。 Thank you.谢谢你。

Ok I finally found.好吧我终于找到了。 You must edit the eslintConfig section of package.json in the root directory of your Yeoman webapp.您必须在eslintConfig应用程序的根目录中编辑package.jsoneslintConfig部分。 Thank you me.谢谢我。

Fragment of package.json : package.json 的片段:

 "eslintConfig": {
    "env": {
      "es6": true,
      "node": true,
      "browser": true
    },
    "rules": {
      "quotes": [
        2,
        "single"
      ]
    }
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM