Skip to main content
Participant
Nov 20, 2019 4:29 PM UTC
Answered

Errors in Dreamweaver output tab - ERROR: 'xxxxxx' is defined but never used. [no-unused-vars]

I have 3 functions in a .js file that I absolutely use in my HTML. However, I get the errors below. Is it because the functions are not called within the .js file? How can I suppress the errors?

 

This topic is closed to new replies. Start a new post to keep the conversation going.
osgood_Correct answer
Legend
Nov 20, 2019 4:43 PM UTC

Yes, this will usually happen if you have an onclick event etc set in the actual html rather than the javascript block itself.

 

In my experience all web editors report these as errors. Linting is only really meant for guidance. You should not expect it to work 100%

2 replies

Jon Fritz
Community Expert
Community Expert
Nov 20, 2019 5:57 PM UTC

If you know your code is valid, and you just want DW to shut up about the non-error, you can go to...

Site > Manage Sites> click your site > Edit (pencil icon) > Advanced Settings > JS Lint (bottom option) > click Edit Configuration File > scroll down to "no-unused-vars" and change "error" to "off"

Save and close the .eslintrc.js file

Translate
osgood_Correct answer
Legend
Nov 20, 2019 4:43 PM UTC

Yes, this will usually happen if you have an onclick event etc set in the actual html rather than the javascript block itself.

 

In my experience all web editors report these as errors. Linting is only really meant for guidance. You should not expect it to work 100%

Translate