Registry / devops / prettier-tslint

prettier-tslint

JSON →
library0.4.2jsnpmunverified

Formats TypeScript files by running Prettier followed by tslint --fix. Latest version 0.4.2 (Jan 2019) is stable but unmaintained; peer dependencies require prettier ^1.7.4 and typescript ^2.5.3 || ^3.0.0. Provides CLI commands `fix` and `check`, and a programmatic API. No additional configuration beyond existing .prettierrc and tslint.json. Designed for projects migrating from TSLint to Prettier; now deprecated in favor of prettier + eslint.

npm install prettier-tslint
INSTALL
IMPORT
SIG · PRETTIER-TSLINT
P
prettier-tslint
devopsjavascriptv0.4.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fix
import { fix } from 'prettier-tslint'
const fix = require('prettier-tslint').fix
ESM syntax works with TypeScript or bundlers; CommonJS require is also valid but less common
check
import { check } from 'prettier-tslint'
import check from 'prettier-tslint'
Default import is not exported; must use named import
prettier-tslint (CLI)
npx prettier-tslint fix file.ts
npm run prettier-tslint fix file.ts
CLI commands are `fix` and `check`; no programmatic default export

Installs peer dependencies and runs prettier-tslint fix on all TypeScript files in src/.

npm install --save-dev prettier-tslint prettier typescript npx prettier-tslint fix 'src/**/*.ts'
Debug
Known issues
deprecatedTSLint itself is deprecated in favor of ESLint; prettier-tslint is unmaintained since 2019 and may not work with newer TypeScript versions.
fix
Migrate to prettier + eslint with @typescript-eslint/parser.
affects: >=0.4.2
breakingThe fix function writes to disk and does not return a result; behavior may change before 1.0.0.
fix
Assume fix modifies files in place; check file after call for verification.
affects: >=0.1.0 <1.0.0
gotchaUses tslint --fix which can introduce changes not fully formatted by Prettier; run order is Prettier then tslint.
fix
Ensure tslint rules are compatible with Prettier formatting to avoid conflicts.
affects: all
gotchaRequires both prettier and typescript as peer dependencies; missing either causes runtime errors.
fix
Explicitly install prettier and typescript in the project.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'prettier'
Peer dependency prettier not installed.
fix
npm install --save-dev prettier
Error: Cannot find module 'typescript'
Peer dependency typescript not installed.
fix
npm install --save-dev typescript
SyntaxError: Unexpected token (expected an assignment or function call
Input file contains unsupported JavaScript syntax or TSLint version mismatch.
fix
Ensure the file is valid TypeScript and use compatible TSLint version (5.x).
prettier-tslint: error: unknown option `--write'
Using CLI option --write which is not supported; only fix and check commands exist.
fix
Use `prettier-tslint fix <files>` instead.
Upgrade
Version history
0.4.2latest on npm
Audit
Dependencies
prettierrequiredPeer dependency for code formatting
typescriptrequiredPeer dependency for TypeScript parsing
Agent activity
12 hits · last 30 days
node
12
Resources
prettier-tslint — npm install prettier-tslint · libregistry