{"id":13483962,"url":"https://github.com/retextjs/retext-quotes","last_synced_at":"2025-05-07T20:46:09.662Z","repository":{"id":39999844,"uuid":"66000068","full_name":"retextjs/retext-quotes","owner":"retextjs","description":"plugin to check quotes and apostrophes","archived":false,"fork":false,"pushed_at":"2025-01-16T10:39:45.000Z","size":159,"stargazers_count":12,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T20:46:03.200Z","etag":null,"topics":["apostrophe","guillemet","natural-language","quote","retext","retext-plugin"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/retextjs.png","metadata":{"funding":{"github":"unifiedjs","open_collective":"unified"},"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-08-18T13:37:18.000Z","updated_at":"2025-01-16T10:39:45.000Z","dependencies_parsed_at":"2024-01-13T18:24:27.528Z","dependency_job_id":"a6851cde-89f0-4b2e-8010-8d17ff4f24a2","html_url":"https://github.com/retextjs/retext-quotes","commit_stats":{"total_commits":86,"total_committers":4,"mean_commits":21.5,"dds":"0.046511627906976716","last_synced_commit":"492460d52a271f3fa3f0b0763ad5878a4854e563"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-quotes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-quotes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-quotes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/retextjs%2Fretext-quotes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/retextjs","download_url":"https://codeload.github.com/retextjs/retext-quotes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954144,"owners_count":21830895,"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":["apostrophe","guillemet","natural-language","quote","retext","retext-plugin"],"created_at":"2024-07-31T17:01:17.323Z","updated_at":"2025-05-07T20:46:09.655Z","avatar_url":"https://github.com/retextjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["JavaScript"],"sub_categories":[],"readme":"# retext-quotes\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[retext][]** plugin to check quotes and apostrophes.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`unified().use(retextQuotes[, options])`](#unifieduseretextquotes-options)\n  * [`Options`](#options)\n* [Messages](#messages)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([retext][]) plugin to check quotes and\napostrophes.\nIt warns if their style (`\"straight\"` or `“smart”`) or level of nesting is not\nthe preferred style.\n\n## When should I use this?\n\nYou can opt-into this plugin when you’re dealing with content that might contain\npunctuation mistakes, and have authors that can fix that content.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install retext-quotes\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport retextQuotes from 'https://esm.sh/retext-quotes@6'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import retextQuotes from 'https://esm.sh/retext-quotes@6?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay our document `example.txt` contains:\n\n```txt\nA sentence \"with quotes, 'nested' quotes,\nand '80s apostrophes.\"\n```\n\n…and our module `example.js` contains:\n\n```js\nimport retextEnglish from 'retext-english'\nimport retextQuotes from 'retext-quotes'\nimport retextStringify from 'retext-stringify'\nimport {unified} from 'unified'\nimport {read} from 'to-vfile'\nimport {reporter} from 'vfile-reporter'\n\nconst file = await unified()\n  .use(retextEnglish)\n  .use(retextQuotes)\n  .use(retextStringify)\n  .process(await read('example.txt'))\n\nconsole.error(reporter(file))\n```\n\n…then running `node example.js` yields:\n\n```txt\nexample.txt\n  1:12-1:13  warning  Expected a smart quote: `“`, not `\"`       quote       retext-quotes\n  1:26-1:27  warning  Expected a smart quote: `‘`, not `'`       quote       retext-quotes\n  1:33-1:34  warning  Expected a smart quote: `’`, not `'`       quote       retext-quotes\n    2:5-2:6  warning  Expected a smart apostrophe: `’`, not `'`  apostrophe  retext-quotes\n  2:22-2:23  warning  Expected a smart quote: `”`, not `\"`       quote       retext-quotes\n\n⚠ 5 warnings\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`retextQuotes`][api-retext-quotes].\n\n### `unified().use(retextQuotes[, options])`\n\nCheck quotes and apostrophes.\n\n###### Parameters\n\n* `options` ([`Options`][api-options], optional)\n  — configuration\n\n###### Returns\n\nTransform ([`Transformer`][unified-transformer]).\n\n###### Notes\n\nThis plugin knows about apostrophes as well and prefers `'` when\n`preferred: 'straight'`, and `’` otherwise.\n\nThe values in `straight` and `smart` can be one or two characters.\nWhen two, the first character determines the opening quote and the second\nthe closing quote at that level.\nWhen one, both the opening and closing quote are that character.\n\nThe order in which the preferred quotes appear in their respective list\ndetermines which quotes to use at which level of nesting.\nSo, to prefer `‘’` at the first level of nesting, and `“”` at the second,\npass: `smart: ['‘’', '“”']`.\n\nIf quotes are nested deeper than the given amount of quotes, the markers\nwrap around: a third level of nesting when using `smart: ['«»', '‹›']`\nshould have double guillemets, a fourth single, a fifth double again, etc.\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n* `preferred` (`'smart'` or `'straight'`, default: `'smart'`)\n  — style of quotes to use\n* `smart` (`Array\u003cstring\u003e`, default: `['“”', '‘’']`)\n  — list of quotes to see as “smart”\n* `straight` (`Array\u003cstring\u003e`, default: `['\"', \"'\"]`)\n  — list of quotes to see as “straight”\n\n## Messages\n\nEach message is emitted as a [`VFileMessage`][vfile-message] on `file`, with\n`source` set to `'retext-quotes'`, `ruleId` to `'apostrophe'` or `'quote'`,\n`actual` to the unexpected character, and `expected` to suggestions.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `retext-quotes@^6`,\ncompatible with Node.js 16.\n\n## Related\n\n* [`retext-contractions`](https://github.com/retextjs/retext-contractions)\n  — check apostrophe use in contractions\n* [`retext-diacritics`](https://github.com/retextjs/retext-diacritics)\n  — check for proper use of diacritics\n* [`retext-sentence-spacing`](https://github.com/retextjs/retext-sentence-spacing)\n  — check spacing between sentences\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`retextjs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/retextjs/retext-quotes/workflows/main/badge.svg\n\n[build]: https://github.com/retextjs/retext-quotes/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/retextjs/retext-quotes.svg\n\n[coverage]: https://codecov.io/github/retextjs/retext-quotes\n\n[downloads-badge]: https://img.shields.io/npm/dm/retext-quotes.svg\n\n[downloads]: https://www.npmjs.com/package/retext-quotes\n\n[size-badge]: https://img.shields.io/bundlejs/size/retext-quotes\n\n[size]: https://bundlejs.com/?q=retext-quotes\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/retextjs/retext/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[health]: https://github.com/retextjs/.github\n\n[contributing]: https://github.com/retextjs/.github/blob/main/contributing.md\n\n[support]: https://github.com/retextjs/.github/blob/main/support.md\n\n[coc]: https://github.com/retextjs/.github/blob/main/code-of-conduct.md\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[retext]: https://github.com/retextjs/retext\n\n[unified]: https://github.com/unifiedjs/unified\n\n[unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[vfile-message]: https://github.com/vfile/vfile-message\n\n[api-options]: #options\n\n[api-retext-quotes]: #unifieduseretextquotes-options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretextjs%2Fretext-quotes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretextjs%2Fretext-quotes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretextjs%2Fretext-quotes/lists"}