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: 6 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 (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-03T06:17:40.000Z (5 months ago)
- Last Synced: 2025-02-01T14:12:50.043Z (17 days ago)
- Topics: eslint, eslint-plugin, typescript
- Language: JavaScript
- Homepage:
- Size: 4.88 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
[](https://www.npmjs.com/package/eslint-plugin-typescript-formatter)
[](https://github.com/witcher112/eslint-plugin-typescript-formatter/issues)
[](https://github.com/witcher112/eslint-plugin-typescript-formatter/blob/main/LICENSE)
[](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)