CodeQL documentation

Unknown directive

ID: js/unknown-directive
Kind: problem
Security severity: 
Severity: warning
Precision: high
Tags:
   - quality
   - reliability
   - correctness
Query suites:
   - javascript-security-and-quality.qls

Click to see the query in the CodeQL repository

If a directive is accidentally misspelled, it will have no effect.

Recommendation

Correct the misspelling.

Example

The following code snippet shows a function that contains a "usestrict" directive. Most likely, the programmer intended this to be a "use strict" directive, but due to the typo, the function will not execute in strict mode.

function f() {
    "usestrict";
    ...
}

Correct the misspelling by replacing "usestrict" with "use strict".

References

  • © GitHub, Inc.
  • Terms
  • Privacy
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy