Socket
Book a DemoInstallSign in
Socket

eslint-plugin-typescript-formatter

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-typescript-formatter

TypeScript built-in formatter for ESLint

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

eslint-plugin-typescript-formatter

npm version GitHub issues GitHub license Known Vulnerabilities

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.

Credits

Keywords

eslint

FAQs

Package last updated on 03 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts