Warnings when using "use strict"
See original GitHub issueWhen 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:
- Created a year ago
- Comments:5 (4 by maintainers)
Top 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 >
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
@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.
I will check the possibilities and add unminified file.