Do not use "new" for side effects
See original GitHub issueWhen I link the code with jshint I get this warning on this part of code:
new Sortable($(".typeslist")[0);
Removing new
I get “Missing new prefix when invoking a constructor”…
Looks like there is a problem with your script, are you sure “Sortable” should be with the first letter capitalized? It is used for classes usually…
Issue Analytics
- State:
- Created 9 years ago
- Comments:19
Top Results From Across the Web
EsLint - Suppress "Do not use 'new' for side effects"
In this case, the created object is thrown away because its reference isn't stored anywhere, and in many cases, this means that the...
Read more >no-new - ESLint - Pluggable JavaScript Linter
This rule is aimed at maintaining consistency and convention by disallowing constructor calls using the new keyword that do not assign the resulting...
Read more >Do not use 'new' for side effects - JSLint Error Explanations
This error is raised to highlight a a lack of convention. While the code is perfectly valid it contravenes best practice, and in...
Read more >SPCAF | JSH318920: Do not use 'new' for side effects
This option prohibits the use of constructor functions for side-effects. Some people like to call constructor functions without assigning its result to any ......
Read more >No-new - ESLint - W3cubDocs
This rule is aimed at maintaining consistency and convention by disallowing constructor calls using the new keyword that do not assign the resulting...
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 Free
Top 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
Do this:
So I say, strange use. Good luck to you.