Is there an elegant way to tell eslint to ensure that we're not using any ES6 syntax / functions?

邮差的信 提交于 2021-02-08 15:09:55

问题


Is there an elegant way to tell ESLint to ensure that we're not using any ES6 / EMCAScript 2015 syntax / functions?

I've found the following answer somewhat helpful but it seems that it doesn't take care of everything (e.g. I don't see how to catch the usage of Object.assign()): How to disable usage of certain ES2015 features with ESLint 2?


回答1:


eslint-plugin-es5 is the package dedicated to your use case. For example the rule es5/no-es6-static-methods forbids the usage of Object.assign.



来源:https://stackoverflow.com/questions/37013985/is-there-an-elegant-way-to-tell-eslint-to-ensure-that-were-not-using-any-es6-sy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!