eslint-plugin-typescript-formatter
v1.0.0
Published
TypeScript built-in formatter for ESLint
Downloads
499
Maintainers
Readme
eslint-plugin-typescript-formatter
TypeScript built-in formatter for ESLint
Table of contents
Installation
npm:
npm install --save-dev eslint-plugin-typescript-formatter
yarn:
yarn add -D eslint-plugin-typescript-formatter
Configuration
Modify your .eslintrc.json
file to include:
{
"plugins": [
"typescript-formatter"
],
"rules": {
"typescript-formatter/format": [
"warn",
{
"baseIndentSize": 0,
"indentSize": 2,
"tabSize": 2,
"newLineCharacter": "\n",
"convertTabsToSpaces": true,
"indentStyle": 2,
"trimTrailingWhitespace": true,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForFunctions": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"insertSpaceBeforeTypeAnnotation": false,
"indentMultiLineObjectLiteralBeginningOnBlankLine": false,
"semicolons": "insert",
"indentSwitchCase": true
}
]
}
}
Rule options schema is available in TypeScript source code.