question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warnings when using "use strict"

See original GitHub issue

When you enforce Strict mode, in our case because we use closure-compiler-maven-plugin in ECMASCRIPT_2016 mode which does enforce strict mode as its default setting, VirtualSelect triggers a bunch of warnings:

Mar 25, 2022 1:38:37 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 0 error(s), 7 warning(s)
[WARNING] /some/path/resources/js/virtual-select.js [5:3]: WARNING - Suspicious code. The result of the 'not' operator is not being used.

[WARNING] /some/path/resources/js/virtual-select.js [5:1205]: WARNING - Suspicious code. The result of the 'not' operator is not being used.

[WARNING] /some/path/resources/js/virtual-select.js [5:2215]: WARNING - Left operand of && operator is always falsy.

[WARNING] /some/path/resources/js/virtual-select.js [5:3256]: WARNING - Suspicious code. The result of the 'not' operator is not being used.

[WARNING] /some/path/resources/js/virtual-select.js [5:4095]: WARNING - Left operand of && operator is always falsy.

[WARNING] /some/path/resources/js/virtual-select.js [5:4095]: WARNING - Left operand of && operator is always truthy.

[WARNING] /some/path/resources/js/virtual-select.js [5:4095]: WARNING - Suspicious code. The result of the 'not' operator is not being used.

The line number is always 5 because of the already-minified https://raw.githubusercontent.com/sa-si-dev/virtual-select/master/dist/virtual-select.min.js that is used to generate this report.

Would it be possible to make VirtualSelect more compatible with Strict mode?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sa-si-devcommented, Apr 24, 2022

@Jaaap I have added an uncompressed file virtual-select.js in the dist folder. Please check it and let me know if there is any warning in your build.

1reaction
sa-si-devcommented, Apr 18, 2022

Is it possible to build an unminified version of the javascript and publish it next to https://raw.githubusercontent.com/sa-si-dev/virtual-select/master/dist/virtual-select.min.js so https://raw.githubusercontent.com/sa-si-dev/virtual-select/master/dist/virtual-select.js That would be very helpful.

I will check the possibilities and add unminified file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why use strict and warnings? - perl - Stack Overflow
Using use strict ; use warnings; catches many errors sooner than they would be caught otherwise, which makes it easier to find the...
Read more >
What are the use strict and use warnings pragmas in Perl?
The use warnings pragma helps us find any typing errors and warns us when something goes wrong with the program. It can be...
Read more >
Strict mode - JavaScript - MDN Web Docs
JavaScript's strict mode is a way to opt in to a restricted variant of JavaScript, thereby implicitly opting-out of "sloppy mode".
Read more >
Always use strict and use warnings in your perl code!
They are compiler flags that instruct Perl to behave in a stricter way. They are there to help you avoid a number of...
Read more >
JavaScript "use strict" - W3Schools
The syntax, for declaring strict mode, was designed to be compatible with older versions of JavaScript. Compiling a numeric literal (4 + 5;)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found