https://github.com/azz/prettier-tslint
Code ➡️ prettier ➡️ tslint --fix ➡️ Formatted Code ✨
https://github.com/azz/prettier-tslint
prettier tslint typescript
Last synced: 8 months ago
JSON representation
Code ➡️ prettier ➡️ tslint --fix ➡️ Formatted Code ✨
- Host: GitHub
- URL: https://github.com/azz/prettier-tslint
- Owner: azz
- License: mit
- Created: 2017-10-15T13:04:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T10:02:05.000Z (over 3 years ago)
- Last Synced: 2025-03-28T16:44:18.761Z (about 1 year ago)
- Topics: prettier, tslint, typescript
- Language: JavaScript
- Homepage: https://npm.im/prettier-tslint
- Size: 838 KB
- Stars: 225
- Watchers: 2
- Forks: 6
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# prettier-tslint
Formats your TypeScript using [`prettier`](https://github.com/prettier/prettier)
followed by [`tslint --fix`](https://github.com/palantir/tslint).
[](https://travis-ci.org/azz/prettier-tslint)
[](https://github.com/prettier/prettier)
[](https://npmjs.org/prettier-tslint)
[](https://github.com/semantic-release/semantic-release)
[](LICENSE)
## Install
With `npm`:
```bash
npm install --save-dev prettier-tslint
```
Or with `yarn`:
```bash
yarn add --dev prettier-tslint
```
`prettier-tslint` allows you to install your own version of `prettier` and
`typescript`, so make sure you've installed them, too.
## Configuration
`prettier-tslint` find and will respect:
* `prettier`'s `.prettierrc`, or any other config file such as `package.json`.
* `prettier`'s `.prettierignore` file.
* `tslint`'s `tslint.json`.
`prettier-tslint` has no additional configuration.
## CLI
```
Commands:
fix Fix one or more files
check List files that aren't formatted
Options:
--version Show version number [boolean]
--help Show help [boolean]
Examples:
prettier-tslint fix file1.ts file2.ts Fix provided files
prettier-tslint fix '**/*.ts' Fix all TypeScript files
prettier-tslint check '**/*.ts' List all unformatted TypeScript files
```
## API
```js
import { fix, check } from "prettier-tslint";
check("file.ts"); // -> false
fix("file.ts");
check("file.ts"); // -> true
```
Currently the `fix` function will write to disk and not return anything. This behavior **may change** in a minor release before `1.0.0` is released.
## Contributing
See [`CONTRIBUTING.md`](CONTRIBUTING.md)