canirequire

canirequireCommonJS › tslint-config-prettier

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

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. JSON

CommonJS CommonJS — require() works on every Node.js version

tslint-config-prettier ships CommonJS only. require("tslint-config-prettier") works everywhere. 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.

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

Does tslint-config-prettier@1.18.0 actually load? Runtime test results

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.

Runtimerequire("tslint-config-prettier")import "tslint-config-prettier"
Node.js 18✓ works✗ failsERR_IMPORT_ASSERTION_TYPE_MISSING
Node.js 20✓ works✗ failsERR_IMPORT_ASSERTION_TYPE_MISSING
Node.js 22✓ works✗ failsERR_IMPORT_ATTRIBUTE_MISSING
Node.js 24✓ works✗ failsERR_IMPORT_ATTRIBUTE_MISSING
Node.js 26✓ works✗ failsERR_IMPORT_ATTRIBUTE_MISSING
Bun 1.4✓ works✓ works

How to import tslint-config-prettier

ES modules (import)

import tslintConfigPrettier from "tslint-config-prettier";

Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.

CommonJS (require)

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).

VersionsFormatFirst published
1.0.0 – 1.18.0CommonJSJun 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 everywhere. 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 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

Other commonjs packages

Similar popularity