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

Community Beginner ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

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?

 

js errors.jpg

TOPICS
Code

Views

1.4K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Nov 20, 2019 Nov 20, 2019

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%

Likes

Translate

Translate
LEGEND ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

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%

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Nov 20, 2019 Nov 20, 2019

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines