user no-unused-vars except function
See original GitHub issuemy code:
var name = 'TM';
function show() {
console.log('this is test');
}
//something
<button onClick="show()">Test</button>
//something
it have error: error ‘name’ is defined but never used no-unused-vars error ‘show’ is defined but never used no-unused-vars
i only want to ignore function. how to do??
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
no-unused-vars - ESLint - Pluggable JavaScript Linter
This rule is aimed at eliminating unused variables, functions, and function parameters. A variable foo is considered to be used if any of...
Read more >How to disable warn about some unused params, but keep ...
Only way that I found is to use ignore pattern argsIgnorePattern in rule options. If your variable is unused, just add underscore _ctx...
Read more >option to exclude functions from no-unused-vars #5086 - GitHub
I want to keep the no-unused-vars rule as an error, but in an ES2015 module, functions that are not called are considered "unused...
Read more >Rule no-unused-vars - ESLint中文文档
This rule is aimed at eliminating unused variables, functions and variables in parameters of functions, as such, warns when one is found. A...
Read more >Assigned a Value but Never Used | React JS Debugging
Assigned a Value but Never Used | No Unused Vars | React JS Debugging | Eslint Warnings & Errors.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@platinumazure @ilyavolodin @vitorbal @ljharb very thanks. I think best way is i use
// eslint-disable-line
. because i dont need use CommonJS or ECMAScript modules. very thanks.I think you want to use the
/* exported */
comment here. That tells ESLint that your function is intended to be exported to global scope and used by a different file.Reference: http://eslint.org/docs/rules/no-unused-vars#exported