Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Nov 20, 2019 Nov 20, 2019

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
2.5K
Translate
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%

Translate
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%

Translate
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
Community Expert ,
Nov 20, 2019 Nov 20, 2019
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

Translate
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