Opt in to settings that raise errors for problematic code.
Table Of Contents
If the project only includes non-vendor code in a bundle, strict mode can be declared once at the top of the bundle file, instead of per function. When in doubt, declare strict mode per function.
If using ES modules, strict mode is implied, and should not be declared.
Use ESLint's strict rule to detect and enforce strict mode, if you are already using ESLint in your project.
strict to the
rules section of your ESLint configuration file.
strict: [ 'error', 'safe' ]
Some popular rule sets, like
airbnb-base, may not include this rule. Adding it to the eslint configuration file will ensure it is applied.