Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/witcher112/eslint-plugin-typescript-formatter
TypeScript built-in formatter for ESLint
https://github.com/witcher112/eslint-plugin-typescript-formatter
eslint eslint-plugin typescript
Last synced: 28 days ago
JSON representation
TypeScript built-in formatter for ESLint
- Host: GitHub
- URL: https://github.com/witcher112/eslint-plugin-typescript-formatter
- Owner: witcher112
- License: mit
- Created: 2023-01-12T04:01:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-12T06:25:22.000Z (almost 2 years ago)
- Last Synced: 2024-09-29T01:21:23.246Z (about 1 month ago)
- Topics: eslint, eslint-plugin, typescript
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-typescript-formatter
[![npm version](https://img.shields.io/npm/v/eslint-plugin-typescript-formatter.svg?maxAge=2592000)](https://www.npmjs.com/package/eslint-plugin-typescript-formatter)
[![GitHub issues](https://img.shields.io/github/issues/witcher112/eslint-plugin-typescript-formatter.svg)](https://github.com/witcher112/eslint-plugin-typescript-formatter/issues)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/witcher112/eslint-plugin-typescript-formatter/blob/main/LICENSE)
[![Known Vulnerabilities](https://snyk.io/test/github/witcher112/eslint-plugin-typescript-formatter/badge.svg)](https://snyk.io/test/github/witcher112/eslint-plugin-typescript-formatter)TypeScript built-in formatter for ESLint
## Table of contents
- [eslint-plugin-typescript-formatter](#eslint-plugin-typescript-formatter)
- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Configuration](#configuration)
- [Credits](#credits)## Installation
npm:
```shell
npm install --save-dev eslint-plugin-typescript-formatter
```yarn:
```shell
yarn add -D eslint-plugin-typescript-formatter
```## Configuration
Modify your `.eslintrc.json` file to include:
```json
{
"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](https://github.com/microsoft/TypeScript/blob/v5.6.2/src/services/types.ts#L1184).
## Credits
* [vvakame/typescript-formatter](https://github.com/vvakame/typescript-formatter)
* [ghaschel/eslint-plugin-js-beautify-html](https://github.com/ghaschel/eslint-plugin-js-beautify-html)