prettylint

raw JSON →
2.0.0 verified Sat Apr 25 auth: no javascript

Run Prettier as a linter, providing eslint-style output for Prettier formatting errors. Version 2.0.0 requires Node >=16 and Prettier ^3.0.0 as a peer dependency. Lightweight alternative to eslint-plugin-prettier with no ESLint integration needed; outputs warnings in a familiar format. Minimal configuration: works out of the box with default Prettier config or custom config files.

error Error: Cannot find module 'prettier'
cause Missing peer dependency prettier.
fix
npm install --save-dev prettier
error Error: Requires prettier ^3.0.0
cause Prettier version is too old (<3.0.0).
fix
npm install prettier@latest --save-dev
error TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
cause Passing multiple --ignore-path values (e.g., --ignore-path .gitignore .prettierignore) treats second argument as file pattern.
fix
Specify only one ignore file: --ignore-path .gitignore
breaking Version 2.0.0 requires Prettier ^3.0.0; previous versions used Prettier 2.x.
fix Update Prettier to ^3.0.0.
breaking Version 2.0.0 requires Node.js >=16.
fix Upgrade Node.js to 16 or later.
gotcha Prettylint does not use .eslintrc; it uses Prettier's config resolution (.prettierrc or prettier key in package.json).
fix Ensure Prettier configuration is present, or use --config to specify a file.
gotcha The --ignore-path flag defaults to ['.gitignore', '.prettierignore']; only one file can be passed explicitly (not an array).
fix To use a custom ignore file, specify only one path: --ignore-path .myignore.
gotcha Output format defaults to 'eslint-formatter-pretty', which may not be installed automatically.
fix npm install --save-dev eslint-formatter-pretty or use --format <other>.
npm install prettylint
yarn add prettylint
pnpm add prettylint

Run prettylint on all TypeScript files in the project, auto-fixing issues.

npx prettylint "**/*.ts" --fix
# or install locally:
npm install --save-dev prettylint prettier
npx prettylint .