PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, December 19, 2022

[FIXED] How to suppress "{variable} is better written in dot notation."

 December 19, 2022     javascript, jshint, properties, syntax     No comments   

Issue

Is there an option to and/or how do I suppress errors like the following?

175,14:['tracker'] is better written in dot notation.


Solution

If it's a feature and not a bug, place this at the top of your file.

/*jshint sub:true*/

If it's a bug, you should refactor your code

foo['tracker'] = bar // from this...
foo.tracker = bar;   // to this!

Good post on the reasons here: https://stackoverflow.com/a/2001410/94668

As suggested by: @ThorSummoner you can use below in your .jshintrc file

"sub": true


Answered By - TomFuertes
Answer Checked By - Robin (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing