Registry / devops / prettier-plugin-coffeescript

prettier-plugin-coffeescript

JSON →
library0.1.5jsnpmunverified

A Prettier plugin that adds support for formatting CoffeeScript (v2.5.0+) files. Current version 0.1.5, last updated in 2020. Requires a forked version of Prettier (prettier-v2.1.0-dev.100-gitpkg) which may not be stable. Release cadence is sporadic. Unlike other CoffeeScript formatters, this integrates directly with Prettier's ecosystem, enabling consistent formatting across languages. However, due to the forked Prettier dependency and lack of recent maintenance, it may not work with current Prettier releases.

npm install prettier-plugin-coffeescript
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-CO
P
prettier-plugin-coffeescript
devopsjavascriptv0.1.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

default
// No import needed; plugin auto-loads when installed
const plugin = require('prettier-plugin-coffeescript');
Prettier plugins are auto-discovered based on package name. No manual import required.
plugin
// Plugins field in .prettierrc: { "plugins": ["prettier-plugin-coffeescript"] }
{ "plugins": ["./node_modules/prettier-plugin-coffeescript"] }
Use the package name, not path, for Prettier to resolve it.
options
// CLI: prettier --plugin=prettier-plugin-coffeescript file.coffee
prettier --plugin=prettier-plugin-coffeescript --parser=coffeescript file.coffee
Parser is inferred; do not set parser manually.

Shows installation, configuration, and basic usage of the plugin with Prettier.

// Install dependencies: // yarn add --dev coffeescript@^2.5.0 github:helixbass/prettier#prettier-v2.1.0-dev.100-gitpkg prettier-plugin-coffeescript // or // npm install --save-dev coffeescript@^2.5.0 github:helixbass/prettier#prettier-v2.1.0-dev.100-gitpkg prettier-plugin-coffeescript // Then create .prettierrc (JSON): { "plugins": ["prettier-plugin-coffeescript"], "printWidth": 80, "tabWidth": 2 } // Format a CoffeeScript file: // npx prettier --write path/to/file.coffee
Debug
Known issues
breakingRequires a forked version of Prettier (prettier-v2.1.0-dev.100-gitpkg) which is not the official release. May not work with standard Prettier.
fix
Install the forked Prettier from GitHub as described in the README.
affects: >=0.1.0
deprecatedThe plugin has not been updated since 2020 and may be incompatible with newer versions of CoffeeScript or Prettier.
fix
Consider using an alternative CoffeeScript formatter or contributing to the project.
affects: >=0.1.5
gotchaThe plugin expects CoffeeScript v2.5.0 or higher. Older versions will cause parsing errors.
fix
Upgrade CoffeeScript to ^2.5.0.
affects: >=0.1.0
gotchaWhen installing via npm, the forked Prettier dependency may not be resolved correctly without a lockfile.
fix
Use yarn or manually verify the installed version in node_modules.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier'
The plugin expects the forked Prettier to be installed, but standard Prettier is not sufficient.
fix
npm install --save-dev github:helixbass/prettier#prettier-v2.1.0-dev.100-gitpkg
SyntaxError: Unexpected token
CoffeeScript file uses syntax not supported by the plugin's parser (e.g., v2.5.0+ features).
fix
Ensure coffeescript@^2.5.0 is installed and the plugin recognizes the correct parser.
Error: No parser could be inferred for file
File extension is not .coffee or the plugin is not properly loaded.
fix
Ensure the file has .coffee extension and the plugin is listed in .prettierrc's plugins array.
Upgrade
Version history
0.1.5latest on npm
Audit
Dependencies
coffeescriptrequiredRuntime peer dependency for parsing CoffeeScript; version ^2.5.0 required.
prettierrequiredForked version required; install from github:helixbass/prettier#prettier-v2.1.0-dev.100-gitpkg.
Agent activity
6 hits · last 30 days
node
6
Resources
prettier-plugin-coffeescript — npm install prettier-plugin-coffeescript · libregistry