[英]How to lint deprecated JavaScript methods in Sublime Text?
I use SublimeLinter everyday for linting JavaScript using Sublime Linter. 我每天都使用SublimeLinter来使用Sublime Linter来衬里JavaScript。 And I don't know is it possible to use it not for syntax check, but for deprecated methods check too. 而且我不知道是否可以将其用于语法检查,而不用于过时的方法检查。
For example, when I see an object MyDeprectedObject
or a method obj.deprecatedMethod
it should show me an error. 例如,当我看到一个对象MyDeprectedObject
或方法obj.deprecatedMethod
,应该向我显示错误。
I have seen jslint/jshint, eslint and seems like it's not possible to use them for my needs at the moment. 我已经看过jslint / jshint,eslint,并且目前看来无法使用它们。
Have you seen a tool I'm looking for? 您看到我正在寻找的工具了吗? How are you doing deprecated methods/objects check? 您如何进行过时的方法/对象检查?
ESlint allows you to easily create custom rules. ESlint允许您轻松创建自定义规则。 You can create one to check for the names of the objects/properties and display custom errors. 您可以创建一个以检查对象/属性的名称并显示自定义错误。 You can take a look at any of the existing rules for an example of how to create your own. 您可以查看任何现有规则,以获取有关如何创建自己的规则的示例。 Here's also a nice tutorial to creating custom rules: https://gist.github.com/jareware/7179093 这也是创建自定义规则的不错的教程: https : //gist.github.com/jareware/7179093
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.