# Is tslint-config-prettier ESM-only? Can you require() it?

> tslint-config-prettier@1.18.0 is a CommonJS package. CommonJS — require() works on every Node.js version we test.

Do you wanna use tslint and prettier without conflicts? tslint-config-prettier disables all conflicting rules that may cause such problems. Prettier takes care of formatting and tslint the rest.

Last verified Sep 9, 2026 against tslint-config-prettier@1.18.0.

tslint-config-prettier ships CommonJS only. require("tslint-config-prettier") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js >=4.0.0. import "tslint-config-prettier" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

## What to do

1. require("tslint-config-prettier") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js >=4.0.0.
2. From ES modules use the default import: import tslintConfigPrettier from "tslint-config-prettier"; then destructure. Named imports only work when Node.js can statically detect the exports.
3. TypeScript: no types are available for tslint-config-prettier; declare the module yourself if you need them.

## Facts

- Latest: 1.18.0 (Feb 4, 2019)
- Module format: CommonJS
- Last CommonJS version: 1.18.0
- TypeScript types: none
- Node engines: >=4.0.0
- Weekly downloads: 221K
- License: MIT

## Runtime test results for tslint-config-prettier@1.18.0

Installed and executed on Sep 9, 2026 with require("tslint-config-prettier") from a CommonJS file and import "tslint-config-prettier" from an ES module.

| Runtime | require("tslint-config-prettier") | import "tslint-config-prettier" |
|---|---|---|
| Node.js 18 | works | fails (ERR_IMPORT_ASSERTION_TYPE_MISSING) |
| Node.js 20 | works | fails (ERR_IMPORT_ASSERTION_TYPE_MISSING) |
| Node.js 22 | works | fails (ERR_IMPORT_ATTRIBUTE_MISSING) |
| Node.js 24 | works | fails (ERR_IMPORT_ATTRIBUTE_MISSING) |
| Node.js 26 | works | fails (ERR_IMPORT_ATTRIBUTE_MISSING) |
| Bun 1.4.0 | works | works |

## How to import tslint-config-prettier

ES modules:

```js
import tslintConfigPrettier from "tslint-config-prettier";
```

CommonJS:

```js
const tslintConfigPrettier = require("tslint-config-prettier");
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (19 versions; the newest 19 shown).

| Versions | Format | First published |
|---|---|---|
| 1.0.0 – 1.18.0 | CommonJS | Jun 7, 2017 |

## Frequently asked

**Is tslint-config-prettier ESM-only?**

tslint-config-prettier@1.18.0 is a CommonJS package. tslint-config-prettier ships CommonJS only. require("tslint-config-prettier") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js >=4.0.0. import "tslint-config-prettier" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

**Can I import tslint-config-prettier with ES module syntax?**

Yes. import tslintConfigPrettier from "tslint-config-prettier" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

**Does tslint-config-prettier work in Bun?**

Yes. import "tslint-config-prettier" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

**Does tslint-config-prettier ship TypeScript types?**

No. tslint-config-prettier ships no type declarations and there is no @types package for it.

## Links

- [tslint-config-prettier on npm](https://www.npmjs.com/package/tslint-config-prettier)
- [Source repository](https://github.com/prettier/tslint-config-prettier)
- [HTML version](https://canirequire.com/package/tslint-config-prettier/)
- [JSON version](https://canirequire.com/package/tslint-config-prettier.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
