Registry / devops / prettier-config-a11y

prettier-config-a11y

JSON →
library1.1.2jsnpmunverified

A Prettier configuration preset that optimizes code formatting for accessibility, addressing visual, cognitive, and motor disabilities. The latest stable version is 1.1.2. It explicitly sets Prettier options to improve readability, such as enforcing consistent quotes, prose wrap, and other defaults that benefit screen readers and users with cognitive disabilities. Differentiators include a focus on accessibility rationale and explicit setting of defaults rather than relying on Prettier's own defaults. The package has a v2 alpha series with experimental features like ternaries and consistent quote props. It requires Prettier >= 1.17.0.

npm install prettier-config-a11y
INSTALL
IMPORT
SIG · PRETTIER-CONFIG-A1
P
prettier-config-a11y
devopsjavascriptv1.1.2
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.

prettier-config-a11y
import config from 'prettier-config-a11y'
const config = require('prettier-config-a11y')
ESM import is preferred for modern projects; CommonJS require also works if using CJS.
use with .prettierrc
"prettier": "prettier-config-a11y" in package.json or .prettierrc.json: "prettier-config-a11y"
using "extends": "prettier-config-a11y" in .prettierrc.js (deprecated pattern)
The recommended way is to set the `prettier` key in package.json to the module name, or use `"prettier-config-a11y"` in .prettierrc.json.
prettier.resolveConfig
await prettier.resolveConfig(filePath, { config: 'prettier-config-a11y' })
When programmatically resolving config, you can pass the module name as the `config` option.

Installs the config and applies it via package.json or .prettierrc.json, then formats all files.

// 1. Install npm install --save-dev prettier prettier-config-a11y // 2. In package.json, add: { "prettier": "prettier-config-a11y" } // 3. Or create .prettierrc.json with: "prettier-config-a11y" // 4. Run prettier on your files: npx prettier --write .
Debug
Known issues
deprecatedv1.x may be deprecated in favor of v2 alpha. Check for breaking changes before upgrading to v2.
fix
Consider testing with v2.0.0-alpha.x but note it's alpha software.
affects: >=1.0.0 <2.0.0
gotchaThe config extends Prettier's defaults but explicitly sets many options; be aware that it may override your existing .prettierrc settings if not properly scoped.
fix
Ensure you are not mixing multiple Prettier config files; use single source of truth.
affects: >=1.0.0
breakingv2 alpha enables experimental ternaries and consistent quote props, which may change formatting of existing code.
fix
If upgrading from v1, review formatting changes and adjust accordingly.
affects: >=2.0.0-alpha.0 <2.0.0
gotchaThe config is published as a plain string module, not an object; some tools expect an object config.
fix
In .prettierrc.js, use `module.exports = require('prettier-config-a11y')` if you need an object.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-config-a11y'
Missing or incorrect path when using require/import or Prettier config resolution fails.
fix
Ensure the package is installed: npm install prettier-config-a11y --save-dev and that you use the string literal correctly.
Invalid configuration file: ".prettierrc" is not a valid configuration
Using .prettierrc file without proper JSON format or mixing with other config keys.
fix
Use a valid JSON file (.prettierrc.json) or set the `prettier` key in package.json to the module name.
Upgrade
Version history
1.1.2latest on npm
Audit
Dependencies
prettierrequiredpeer dependency: requires Prettier >= 1.17.0 to apply the config
Agent activity
4 hits · last 30 days
node
4
Resources
prettier-config-a11y — npm install prettier-config-a11y · libregistry