Strict Configuration · How it works

1 min read
Mid-level1 min read
Rapid overview

How it works

The mental model is two layers, not one. Layer one is consistencyvar 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 riskno-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

RuleFixes
no-varvarlet/const
prefer-constletconst when never reassigned
prefer-arrow-callbackFunction expressions → arrow functions
prefer-templateString concatenation → template literals
eqeqeq=====
quotesQuote style normalization
semiAdd/remove semicolons
import/orderReorder imports
@typescript-eslint/consistent-type-importsAdd type keyword

Rules That Cannot Auto-Fix

  • no-explicit-any - Requires manual typing
  • no-unused-vars - Requires removing or using
  • complexity - Requires refactoring
  • no-floating-promises - Requires await/catch/void

See also