unnecessaryUseStricts
Reports unnecessary "use strict" directives in ES modules and classes.
✅ This rule is included in the ts logical presets.
ES modules and class bodies are automatically in strict mode.
The "use strict" directive has no effect in these contexts and is redundant.
Examples
Section titled “Examples”"use strict";
export function calculate(value: number) { return value * 2;}
export class Calculator { add(a: number, b: number) { return a + b; }}export function calculate(value: number) { return value * 2;}
export class Calculator { add(a: number, b: number) { return a + b; }}Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If you are working with non-module scripts that need to be executed in strict mode, you should not use this rule.
This rule only flags "use strict" directives in ES modules (files with import or export statements).
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- Biome:
noRedundantUseStrict
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.