{"id":20626,"library":"tslint-plugin-prettier","title":"tslint-plugin-prettier","description":"Runs Prettier as a TSLint rule and reports differences as individual TSLint issues. Stable version 2.3.0, low release cadence (last update 2019). Integrates Prettier formatting into TSLint workflows, emitting each difference as a separate lint failure. Unlike other tools, it supports both TSLint 5/6 and Prettier 1.x/2.x, but TSLint itself is deprecated in favor of ESLint. No active development expected.","status":"deprecated","version":"2.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/prettier/tslint-plugin-prettier","tags":["javascript","prettier","tslint","tslint-plugin","tslint-rules","typescript"],"install":[{"cmd":"npm install tslint-plugin-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add tslint-plugin-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add tslint-plugin-prettier","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required to load rules","package":"tslint","optional":false},{"reason":"peer dependency, used for formatting comparison","package":"prettier","optional":false}],"imports":[{"note":"CJS-only package, no ESM exports.","wrong":"import plugin from 'tslint-plugin-prettier'","symbol":"default","correct":"const plugin = require('tslint-plugin-prettier')"},{"note":"Use destructured require for Rules.","wrong":"import { Rules } from 'tslint-plugin-prettier'","symbol":"Rules","correct":"const { Rules } = require('tslint-plugin-prettier')"},{"note":"Named export for the rule class.","wrong":"import { PrettierRule } from 'tslint-plugin-prettier'","symbol":"PrettierRule","correct":"const { PrettierRule } = require('tslint-plugin-prettier')"}],"quickstart":{"code":"// tslint.json\n{\n  \"extends\": [\"tslint-plugin-prettier\"],\n  \"rules\": {\n    \"prettier\": true\n  }\n}\n\n// Run: tslint --config tslint.json 'src/**/*.ts'","lang":"typescript","description":"Enables the prettier rule in TSLint, checking formatting against Prettier's defaults."},"warnings":[{"fix":"Migrate to ESLint + eslint-plugin-prettier.","message":"TSLint itself is deprecated. Prettier integration is better done via eslint-plugin-prettier.","severity":"deprecated","affected_versions":"all"},{"fix":"Use Prettier directly for formatting, or limit rule scope to specific files.","message":"The rule reports each difference as a separate failure, which can flood output in large files.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to Prettier >=1.9 and TSLint >=5.0.","message":"Version 2.0.0 dropped support for Prettier <1.9 and TSLint <5.0.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install tslint-plugin-prettier --save-dev","cause":"Package not installed or peer dependencies missing.","error":"Cannot find module 'tslint-plugin-prettier'"},{"fix":"Add 'tslint-plugin-prettier' to 'extends' or 'rulesDirectory' in tslint.json.","cause":"tslint.json not configured correctly or plugin not loaded.","error":"Could not find rule: 'prettier'"},{"fix":"Use \"prettier\": true or \"prettier\": true in tslint.json.","cause":"The 'prettier' rule accepts only boolean (true) or an object with options.","error":"Invalid 'prettier' rule options"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}