Strict Configuration · How it works
1 min readHow it works
The mental model is two layers, not one. Layer one is consistency — var vs const, quote style, semicolons, import order. There is no judgment here, only a house style, so you delegate it entirely to eslint --fix and never argue about it in review. Layer two is correctness and risk — no-explicit-any, no-floating-promises, no-unused-vars, complexity. A machine can flag these but can't resolve them, because the fix depends on intent: the right type, the missing await, the refactor.
A strict config is the contract that says "every rule is error, but layer one is auto-corrected on save and on commit." That is what makes a zero-warning policy humane instead of punishing — the mechanical noise is gone before a human ever sees it, so the only thing left in the lint output is signal that genuinely needs a decision. Adoption follows the same split: turn the rules on as warn first, gate new code with --max-warnings 0, then promote to error once the back-catalogue is clean.
Auto-Fix Examples
What eslint --fix Can Fix
// Before
var x = 1;
const y = "hello";
if(x == 1){ console.log(y) }
const fn = function() { return 1; };
// After --fix
const x = 1;
const y = 'hello';
if (x === 1) {
console.log(y);
}
const fn = () => 1;
Rules with Auto-Fix
| Rule | Fixes |
|---|---|
no-var | var → let/const |
prefer-const | let → const when never reassigned |
prefer-arrow-callback | Function expressions → arrow functions |
prefer-template | String concatenation → template literals |
eqeqeq | == → === |
quotes | Quote style normalization |
semi | Add/remove semicolons |
import/order | Reorder imports |
@typescript-eslint/consistent-type-imports | Add type keyword |
Rules That Cannot Auto-Fix
no-explicit-any- Requires manual typingno-unused-vars- Requires removing or usingcomplexity- Requires refactoringno-floating-promises- Requires await/catch/void