Registry / devops / prettier-plugin-css-grid

prettier-plugin-css-grid

JSON →
library0.1.2jsnpmunverified

An opinionated CSS Grid formatter for Prettier that automatically formats grid-template-areas and related CSS grid properties. Version 0.1.2 is the current stable release. It works as a Prettier plugin (peer dependency: Prettier ^2.0.0) and requires Node >= 12. Unlike general CSS formatters, this plugin specifically aligns grid cells into a readable ASCII grid, improving developer experience when working with CSS Grid layouts. It is type-safe with included TypeScript definitions.

npm install prettier-plugin-css-grid
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-CS
P
prettier-plugin-css-grid
devopsjavascriptv0.1.2
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.

default
const prettierPluginCssGrid = require('prettier-plugin-css-grid')
import prettierPluginCssGrid from 'prettier-plugin-css-grid' (ESM default import not supported; CJS only)
Plugin is CommonJS only; use require(). Listed as peer dependency—loading is automatic via Prettier plugin resolution.

Shows installation and formatting of a CSS file with grid-template-areas using Prettier and this plugin.

npm install --save-dev prettier prettier-plugin-css-grid echo '{"grid-template-areas": "a b\nc d"}' > test.css prettier --write test.css cat test.css
Debug
Known issues
gotchaPlugin requires Prettier version ^2.0.0. Using with Prettier v1 will not work.
fix
Update Prettier to v2 or later.
affects: >=0.1.0
gotchaNode.js version must be >= 12. Older Node versions will cause errors.
fix
Upgrade Node to v12 or later.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'prettier-plugin-css-grid'
Plugin not installed or not in node_modules.
fix
Run npm install --save-dev prettier-plugin-css-grid
Error: Could not resolve a prettier configuration file - Using --config or .prettierrc is recommended
Plugin is loaded globally but not detected; Prettier needs a config file to enable plugins.
fix
Add 'plugins: ["prettier-plugin-css-grid"]' to .prettierrc
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
prettierrequiredpeer dependency required for plugin to work
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-plugin-css-grid — npm install prettier-plugin-css-grid · libregistry