A missing "use strict"
error is common when you use ESLint.
There are 2 possible fixes to it:
- add the statement “use strict” in double quotes as a first line in your JS file
"use strict" //the rest of your JS code goes below // AND must be in a strict mode
- add a custom ESLint rule (as a comment!) to ignore the missing “use strict statement”
/*eslint strict: ["error", "never"]*/ //the rest of your JS code goes below //AND can be in a non-strict mode
You should try the first solution and if you’re not sure why it doesn’t work, then you can disable the ESLint errors for missing strict mode.