[英]Javascript(Eslint) Function never Used
I have been using Eslint for some time.我已经使用 Eslint 一段时间了。 I have defined a function which takes user input and assignes it to variable.
我定义了一个函数,它接受用户输入并将其分配给变量。 The function is called in HTML on button click.
该函数在按钮单击时在 HTML 中调用。 I have an error in js that this function is never used.
我在js中有一个错误,这个函数从未被使用过。 I know that this is not a problem at all.
我知道这根本不是问题。 Just trying to write correct code from the start.
只是试图从一开始就编写正确的代码。 Thank you!
谢谢!
If you don't want this to be an error stopping you from starting the application, set the eslint no-unused-vars
rule to off
or warn
in your eslint configuration file ( eslintrc.js
or similar).如果您不希望这是阻止您启动应用程序的错误,请将 eslint
no-unused-vars
规则设置为off
或在您的 eslint 配置文件( eslintrc.js
或类似文件)中warn
。 For example:例如:
module.exports = {
...
rules: {
'no-unused-vars': 'off',
},
};
Note that in order for this to work you have to restart the application.请注意,为了使其工作,您必须重新启动应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.