最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Any solution to autofix or autocorrect ESLint rules? - Stack Overflow

programmeradmin1浏览0评论

I have implemented a new set of ESLint rules to an existing Javasript-React project and need to fix around 7000 lint errors. Is there any solution available to auto fix or autocorrect Linting rules like below

  ✖  18:47  A space is required before '}'    object-curly-spacing
  ✖  19:10  A space is required after '{'     object-curly-spacing
  ✖  21:14  Missing trailing ma            ma-dangle
  ✖  129:9  Expected newline before return statement  newline-before-return
  ✖  133:2  Missing semicolon                 semi

I have implemented a new set of ESLint rules to an existing Javasript-React project and need to fix around 7000 lint errors. Is there any solution available to auto fix or autocorrect Linting rules like below

  ✖  18:47  A space is required before '}'    object-curly-spacing
  ✖  19:10  A space is required after '{'     object-curly-spacing
  ✖  21:14  Missing trailing ma            ma-dangle
  ✖  129:9  Expected newline before return statement  newline-before-return
  ✖  133:2  Missing semicolon                 semi
Share Improve this question edited Nov 9, 2016 at 1:51 user2864740 62.1k15 gold badges158 silver badges228 bronze badges asked Nov 9, 2016 at 1:43 mshameermshameer 4,1512 gold badges17 silver badges15 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

If you run eslint with the --fix flag it will try to fix any linting changes that it can, and let you know which ones it cannot. See the documentation here: http://eslint/blog/2015/09/eslint-v1.5.0-released

发布评论

评论列表(0)

  1. 暂无评论