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
muslnode 18–226 runs
build_error
glibcnode 18–226 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.fixConsider 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.fixEnsure 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.fixIf 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.fixIn .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.
fixEnsure 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.
fixUse a valid JSON file (.prettierrc.json) or set the `prettier` key in package.json to the module name.
Audit
Dependencies
prettierrequiredpeer dependency: requires Prettier >= 1.17.0 to apply the config