{"id":20285,"library":"prettier-config-a11y","title":"prettier-config-a11y","description":"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.","status":"active","version":"1.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/nickmccurdy/prettier-config-a11y","tags":["javascript","prettier","config","prettier-config","accessibility"],"install":[{"cmd":"npm install prettier-config-a11y","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-config-a11y","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-config-a11y","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: requires Prettier >= 1.17.0 to apply the config","package":"prettier","optional":false}],"imports":[{"note":"ESM import is preferred for modern projects; CommonJS require also works if using CJS.","wrong":"const config = require('prettier-config-a11y')","symbol":"prettier-config-a11y","correct":"import config from 'prettier-config-a11y'"},{"note":"The recommended way is to set the `prettier` key in package.json to the module name, or use `\"prettier-config-a11y\"` in .prettierrc.json.","wrong":"using \"extends\": \"prettier-config-a11y\" in .prettierrc.js (deprecated pattern)","symbol":"use with .prettierrc","correct":"\"prettier\": \"prettier-config-a11y\" in package.json or .prettierrc.json: \"prettier-config-a11y\""},{"note":"When programmatically resolving config, you can pass the module name as the `config` option.","wrong":"","symbol":"prettier.resolveConfig","correct":"await prettier.resolveConfig(filePath, { config: 'prettier-config-a11y' })"}],"quickstart":{"code":"// 1. Install\nnpm install --save-dev prettier prettier-config-a11y\n\n// 2. In package.json, add:\n{\n  \"prettier\": \"prettier-config-a11y\"\n}\n\n// 3. Or create .prettierrc.json with:\n\"prettier-config-a11y\"\n\n// 4. Run prettier on your files:\nnpx prettier --write .","lang":"javascript","description":"Installs the config and applies it via package.json or .prettierrc.json, then formats all files."},"warnings":[{"fix":"Consider testing with v2.0.0-alpha.x but note it's alpha software.","message":"v1.x may be deprecated in favor of v2 alpha. Check for breaking changes before upgrading to v2.","severity":"deprecated","affected_versions":">=1.0.0 <2.0.0"},{"fix":"Ensure you are not mixing multiple Prettier config files; use single source of truth.","message":"The config extends Prettier's defaults but explicitly sets many options; be aware that it may override your existing .prettierrc settings if not properly scoped.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If upgrading from v1, review formatting changes and adjust accordingly.","message":"v2 alpha enables experimental ternaries and consistent quote props, which may change formatting of existing code.","severity":"breaking","affected_versions":">=2.0.0-alpha.0 <2.0.0"},{"fix":"In .prettierrc.js, use `module.exports = require('prettier-config-a11y')` if you need an object.","message":"The config is published as a plain string module, not an object; some tools expect an object config.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed: npm install prettier-config-a11y --save-dev and that you use the string literal correctly.","cause":"Missing or incorrect path when using require/import or Prettier config resolution fails.","error":"Error: Cannot find module 'prettier-config-a11y'"},{"fix":"Use a valid JSON file (.prettierrc.json) or set the `prettier` key in package.json to the module name.","cause":"Using .prettierrc file without proper JSON format or mixing with other config keys.","error":"Invalid configuration file: \".prettierrc\" is not a valid configuration"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}