{"id":16864370,"url":"https://github.com/nickserv/prettier-config-a11y","last_synced_at":"2025-04-11T09:42:03.013Z","repository":{"id":56889265,"uuid":"506761654","full_name":"nickserv/prettier-config-a11y","owner":"nickserv","description":"Prettier config improving accessibility for visual, cognitive, and motor disabilities","archived":false,"fork":false,"pushed_at":"2025-03-07T17:36:24.000Z","size":42,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T01:19:49.184Z","etag":null,"topics":["accessibility","config","prettier","prettier-config"],"latest_commit_sha":null,"homepage":"https://npm.im/prettier-config-a11y","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickserv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nickmccurdy"}},"created_at":"2022-06-23T19:10:26.000Z","updated_at":"2025-03-07T17:34:10.000Z","dependencies_parsed_at":"2024-08-02T11:59:41.794Z","dependency_job_id":"48cb8a8a-a2a7-4ca3-9716-ee4aa6314410","html_url":"https://github.com/nickserv/prettier-config-a11y","commit_stats":null,"previous_names":["nickmccurdy/prettier-config","nickserv/prettier-config-a11y"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Fprettier-config-a11y","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Fprettier-config-a11y/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Fprettier-config-a11y/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Fprettier-config-a11y/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickserv","download_url":"https://codeload.github.com/nickserv/prettier-config-a11y/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785942,"owners_count":20995644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accessibility","config","prettier","prettier-config"],"created_at":"2024-10-13T14:42:00.986Z","updated_at":"2025-04-11T09:42:03.003Z","avatar_url":"https://github.com/nickserv.png","language":"JavaScript","funding_links":["https://github.com/sponsors/nickmccurdy"],"categories":[],"sub_categories":[],"readme":"# `prettier-config-a11y`\n\n[Prettier](https://prettier.io/) config improving accessibility for visual,\ncognitive, and motor disabilities\n\n## Installation\n\n```sh\nnpm install --save-dev prettier prettier-config-a11y\n```\n\n```sh\nyarn add --dev prettier prettier-config-a11y\n```\n\n```sh\npnpm add --save-dev prettier prettier-config-a11y\n```\n\n## Usage\n\n### `package.json`\n\n```json\n\"prettier\": \"prettier-config-a11y\"\n```\n\n### [Other Prettier config](https://prettier.io/docs/en/configuration.html)\n\n```json\n\"prettier-config-a11y\"\n```\n\n## Rationale\n\nHere's what I've changed from Prettier's config and why. Most of the defaults\nare already pretty good, so check out the\n[Prettier docs](https://prettier.io/docs/en/options.html) for more information.\n\n### `\"experimentalTernaries\": true`\n\nTernaries are the best way to write complex conditionals in JavaScript\nexpressions and TypeScript types. Because each ternary can only have two\npossible cases, nested ternaries are required to add more.\n\nPrettier indents nested ternaries based on their structure. This indentation\nleads to longer lines, which can cause issues with visual and cognitive\ndisabilities, especially with deeply nested ternaries. I'm testing Prettier's\n[experimental ternaries](https://prettier.io/blog/2023/11/13/curious-ternaries)\n(requires 3.1.0), which preserves indentation of else cases while still\nindenting nesting if cases.\n\n### `\"experimentalOperatorPosition\": \"start\"`\n\nPrints operators at the start of new lines when wrapped. This improves\nreadability for complex expressions and helps users with visual and cognitive\ndisabilities.\n\n### `\"useTabs\": true`\n\nIndentations are easier for assistive technology to read when using tabs instead\nof spaces because they take up less characters. Visual representations of tab\nindentations can also be increased by users with visual and cognitive\ndisabilities without affecting other users.\n\n### `\"quoteProps\": \"consistent\"`\n\nKeeps quoting of props with special characters consistent and easy to adjust,\nresulting in less work for those with cognitive and motor disabilities.\n\n### `\"proseWrap\": \"always\"`\n\nBy default, Prettier does not wrap prose, resulting in inconsistently long lines\nthat are harder to read without soft wrapping.\n\n## Defaults\n\nPrettier 3 already uses these defaults, but I set them explicitly to encourage\naccessibility, even with older versions of Prettier.\n\n### `\"semi\": true`\n\nDisabled users are more likely to prefer semicolons (source:\n[Twitter poll](https://twitter.com/nickemccurdy/status/1624305594415955973)),\nlikely because they make it easier to understand when lines of code end, even\nwhen Prettier wraps them.\n\n### `\"singleQuote\": false` and `\"jsxSingleQuote\": false`\n\nDouble quotes are easier for some assistive technology to read because single\nquotes may be spoken as \"apostrophe\", which is a syllable longer than \"double\nquote\", while \"single quote\" sounds about as long. Double quotes are also\nlarger, making them easier to see. Meanwhile, HTML and JSX code is typically\nformatted with double quotes, so consistently using double quotes in other\nlanguages makes code behave more consistently and potentially reduces cognitive\nload.\n\n### `\"trailingComma\": \"all\"`\n\nReduces the size of diffs, making them easier to read, especially with visual\nand cognitive disabilities.\n\n### `\"arrowParens\": \"always\"`\n\nKeeps arguments in arrow functions consistent and easy to adjust, resulting in\nless work for those with cognitive and motor disabilities.\n\n### `\"endOfLine\": \"lf\"`\n\nThis reduces unnecessary end of line changes when switching operating systems,\nwhich can can be especially confusing for those with disabilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickserv%2Fprettier-config-a11y","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickserv%2Fprettier-config-a11y","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickserv%2Fprettier-config-a11y/lists"}