strict
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"strict": "error",
},
},
];function foo() {
}function foo() {
"use strict";
}"use strict";
function foo() {
"use strict";
}"use strict";
function foo() {
}function foo() {
"use strict";
}
(function() {
"use strict";
function bar() {
}
function baz(a = 1) {
}
}());
const foo2 = (function() {
"use strict";
return function foo(a = 1) {
};
}());function foo() {
}Examples from the ESLint documentation.
strict
eslint
export default [
{
rules: {
"strict": "error",
},
},
];Oxlint does not have this rule.
suspicious/useStrictMode
suspicious · since 1.8.0
{
"linter": {
"rules": {
"suspicious": {
"useStrictMode": "error"
}
}
}
}Disallow certain properties on certain objects
Enforce consistent brace style for all control statements
Disallow function declarations that contain unsafe references inside loop statements
Disallow unnecessary concatenation of literals or template literals