Skip to main content

indent

danger
We strongly recommend you do not use this rule or any other formatting linter rules. Use a separate dedicated formatter instead. See What About Formatting? for more information.

Enforce consistent indentation.

🛠

Some problems reported by this rule are automatically fixable by the --fix ESLint command line option.

Warning

danger

Please read Issue #1824: Problems with the indent rule before using this rule!

Examples

This rule extends the base eslint/indent rule. It adds support for TypeScript nodes.

How to Use

.eslintrc.cjs
module.exports = {
// Note: you must disable the base rule as it can report incorrect errors
"indent": "off",
"@typescript-eslint/indent": "warn"
};

Options

See eslint/indent options.

Taken with ❤️ from ESLint core

Resources