Registry / devops / prettier-with-tabs

prettier-with-tabs

JSON →
library0.22.0jsnpmunverified

A fork of Prettier v0.22.0 (beta) that adds an option to indent lines with tabs instead of spaces. Prettier is an opinionated JavaScript formatter that parses JS into an AST and pretty-prints it, ignoring original formatting. This fork targets developers who need tab indentation before official support, but is no longer maintained (upstream Prettier now supports tabs via `useTabs`). Legacy release, only useful for historical reference or locked toolchains.

npm install prettier-with-tabs
INSTALL
IMPORT
SIG · PRETTIER-WITH-TABS
P
prettier-with-tabs
devopsjavascriptv0.22.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

prettier.format
✓ import prettier from 'prettier-with-tabs'; prettier.format(code, { tabWidth: 4 });
✗ const prettier = require('prettier-with-tabs'); prettier.format(code, { tabWidth: 4 }); // valid, but CJS only, not ESM
This package is CJS-only (no ESM). Use named exports like `format` are not available; default export is the api object.
prettier.check
✓ import prettier from 'prettier-with-tabs'; prettier.check(code);
✗ import { check } from 'prettier-with-tabs'; // no named export 'check'
Same as format; the API is through the default export object.
prettier.resolveConfig
✓ import prettier from 'prettier-with-tabs'; prettier.resolveConfig.sync(process.cwd());
✗ import { resolveConfig } from 'prettier-with-tabs'; // not a named export
resolveConfig is a nested object; use dot notation.

Formats a JavaScript function with tabs for indentation using the fork's default tab style.

import prettier from 'prettier-with-tabs'; const code = `function hello(name) { console.log('hello, ' + name); }`; const formatted = prettier.format(code, { parser: 'babel', tabWidth: 4, // Note: this fork does not support useTabs; tabs are always used }); console.log(formatted); // Output: // function hello(name) { // \tconsole.log('hello, ' + name); // }
Debug
Known issues
deprecatedThe package is a deprecated fork; upstream Prettier now supports `useTabs` option natively.
fix
Migrate to official prettier package and use `useTabs: true`.
affects: >=0.0.1
breakingThe package name 'prettier-with-tabs' is confusing; many expect it to be a plugin or config, not a full fork.
fix
Use official prettier with `useTabs` option, or if you need this exact behavior, pin version.
affects: >=0.0.1
gotchaThis version (0.22.0) is a beta; formatting may change across minor releases.
fix
Do not rely on consistent formatting across updates; pin to exact version.
affects: >=0.22.0 <1.0.0
gotchaThe package is CJS-only, no ESM exports. Using `import` requires a bundler or Node >=12 with esm flag.
fix
Use `require('prettier-with-tabs')` or configure your transpiler to handle CJS.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find module 'prettier-with-tabs'
Package not installed or typo in package name.
fix
Run `npm install prettier-with-tabs` or check the name in package.json.
TypeError: prettier.format is not a function
Importing incorrectly; e.g., destructuring a non-existent named export.
fix
Use default import: `import prettier from 'prettier-with-tabs'` then `prettier.format(...)`.
Error: Invalid version: "0.22.0"
Using a semver range that doesn't match the package's actual version (e.g., `^1.0.0`).
fix
Use exact version `0.22.0` or range `~0.22.0`.
Upgrade
Version history
0.22.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
prettier-with-tabs — npm install prettier-with-tabs · libregistry