{"name":"remark-lint-ordered-list-marker-value","version":"1.0.1","description":"remark-lint rule to warn when the marker value of ordered lists violates a given style","license":"MIT","keywords":["remark","lint","rule","ordered","list","marker"],"repository":{"type":"git","url":"https://github.com/wooorm/remark-lint/tree/master/packages/remark-lint-ordered-list-marker-value"},"bugs":{"url":"https://github.com/wooorm/remark-lint/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"dependencies":{"unified-lint-rule":"^1.0.0","unist-util-generated":"^1.1.0","unist-util-position":"^3.0.0","unist-util-visit":"^1.1.1"},"xo":false,"_id":"remark-lint-ordered-list-marker-value@1.0.1","_npmVersion":"5.1.0","_nodeVersion":"8.1.2","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-P6fYui3MvuB21+6AYH8Lbe7SVZ2VQL+FVJUuDCBhe01bgx6SajGmQ/f4Iqt0gCHEAaKw7e2B7tdwd36ifbs1EA==","shasum":"81f92b5dc25dad34e900f6e13a9fd52a4d41f5bf","tarball":"http://registry-npm.ywwl.com/remark-lint-ordered-list-marker-value/download/remark-lint-ordered-list-marker-value-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWy6zf3B3rmmw3WVNiS7vhX1xIJwRVxb93COTdl7HLCAIgJ9uqA9V6vk3R8GgfjIolnon5/jtVU+t9GFA95OJX6/4="}],"size":2372,"noattachment":false,"key":"/remark-lint-ordered-list-marker-value/-/remark-lint-ordered-list-marker-value-1.0.1.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-lint-ordered-list-marker-value-1.0.1.tgz_1502971162295_0.3906252181623131"},"directories":{},"readme":"<!--This file is generated-->\n\n# remark-lint-ordered-list-marker-value\n\n[![Build][badge-build-image]][badge-build-url]\n[![Coverage][badge-coverage-image]][badge-coverage-url]\n[![Downloads][badge-downloads-image]][badge-downloads-url]\n[![Size][badge-size-image]][badge-size-url]\n[![Sponsors][badge-funding-sponsors-image]][badge-funding-url]\n[![Backers][badge-funding-backers-image]][badge-funding-url]\n[![Chat][badge-chat-image]][badge-chat-url]\n\n[`remark-lint`][github-remark-lint] rule to warn when ordered list values are inconsistent.\n\n## Contents\n\n* [What is this?](#what-is-this)\n* [When should I use this?](#when-should-i-use-this)\n* [Presets](#presets)\n* [Install](#install)\n* [Use](#use)\n* [API](#api)\n  * [`unified().use(remarkLintOrderedListMarkerValue[, options])`](#unifieduseremarklintorderedlistmarkervalue-options)\n  * [`Options`](#options)\n  * [`Style`](#style)\n* [Recommendation](#recommendation)\n* [Fix](#fix)\n* [Examples](#examples)\n* [Compatibility](#compatibility)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package checks ordered list values.\n\n## When should I use this?\n\nYou can use this package to check ordered lists.\n\n## Presets\n\nThis plugin is included in the following presets:\n\n| Preset | Options |\n| - | - |\n| [`remark-preset-lint-consistent`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-consistent) | `'consistent'` |\n| [`remark-preset-lint-markdown-style-guide`](https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-markdown-style-guide) | `'one'` |\n\n## Install\n\nThis package is [ESM only][github-gist-esm].\nIn Node.js (version 16+),\ninstall with [npm][npm-install]:\n\n```sh\nnpm install remark-lint-ordered-list-marker-value\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport remarkLintOrderedListMarkerValue from 'https://esm.sh/remark-lint-ordered-list-marker-value@4'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n<script type=\"module\">\n  import remarkLintOrderedListMarkerValue from 'https://esm.sh/remark-lint-ordered-list-marker-value@4?bundle'\n</script>\n```\n\n## Use\n\nOn the API:\n\n```js\nimport remarkLint from 'remark-lint'\nimport remarkLintOrderedListMarkerValue from 'remark-lint-ordered-list-marker-value'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport {read} from 'to-vfile'\nimport {unified} from 'unified'\nimport {reporter} from 'vfile-reporter'\n\nconst file = await read('example.md')\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintOrderedListMarkerValue)\n  .use(remarkStringify)\n  .process(file)\n\nconsole.error(reporter(file))\n```\n\nOn the CLI:\n\n```sh\nremark --frail --use remark-lint --use remark-lint-ordered-list-marker-value .\n```\n\nOn the CLI in a config file (here a `package.json`):\n\n```diff\n …\n \"remarkConfig\": {\n   \"plugins\": [\n     …\n     \"remark-lint\",\n+    \"remark-lint-ordered-list-marker-value\",\n     …\n   ]\n }\n …\n```\n\n## API\n\nThis package exports no identifiers.\nIt exports the [TypeScript][typescript] types\n[`Options`][api-options] and\n[`Style`][api-style].\nThe default export is\n[`remarkLintOrderedListMarkerValue`][api-remark-lint-ordered-list-marker-value].\n\n### `unified().use(remarkLintOrderedListMarkerValue[, options])`\n\nWarn when ordered list values are inconsistent.\n\n###### Parameters\n\n* `options` ([`Options`][api-options], default: `'consistent'`)\n  — preferred style\n\n###### Returns\n\nTransform ([`Transformer` from `unified`][github-unified-transformer]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n`consistent` looks at the first list with two or more items, and\ninfer `'single'` if both are the same, and `'ordered'` otherwise.\n\n###### Type\n\n```ts\ntype Options = Style | 'consistent'\n```\n\n### `Style`\n\nCounter style (TypeScript type).\n\n* `'one'`\n  — values should always be exactly `1`\n* `'ordered'`\n  — values should increment by one from the first item\n* `'single'`\n  — values should stay the same as the first item\n\n###### Type\n\n```ts\ntype Style = 'one' | 'ordered' | 'single'\n```\n\n## Recommendation\n\nWhile `'single'` might be the smartest style,\nas it makes it easier to move items around without having to renumber\neverything and doesn’t have problems with aligning content of the 9th and\nthe 10th item,\nit’s not used a lot and arguably looks unnatural.\n`'one'` is like `'single'` but forces every list to start at `1`.\nWhile not often needed,\nstarting lists at other values is sometimes useful.\nSo `'ordered'` is recommended,\nalthough `'single'` is also a viable choice.\n\n## Fix\n\n[`remark-stringify`][github-remark-stringify] retains the value of the first\nitem and increments further items by default.\nPass `incrementListMarker: false` to not increment further items.\n\n## Examples\n\n##### `ok.md`\n\n###### In\n\n```markdown\n1. Mercury\n2. Venus\n\n***\n\n3. Earth\n4. Mars\n\n***\n\n* Jupiter\n```\n\n###### Out\n\nNo messages.\n\n##### `ok-infer-single.md`\n\n###### In\n\n```markdown\n2. Mercury\n2. Venus\n\n***\n\n3. Earth\n3. Mars\n```\n\n###### Out\n\nNo messages.\n\n##### `nok-chaotic.md`\n\n###### In\n\n```markdown\n2. Mercury\n1. Venus\n\n***\n\n1. Earth\n1. Mars\n```\n\n###### Out\n\n```text\n2:2: Unexpected ordered list item value `1`, expected `3`\n7:2: Unexpected ordered list item value `1`, expected `2`\n```\n\n##### `ok.md`\n\nWhen configured with `'one'`.\n\n###### In\n\n```markdown\n1. Mercury\n1. Venus\n```\n\n###### Out\n\nNo messages.\n\n##### `ok.md`\n\nWhen configured with `'ordered'`.\n\n###### In\n\n```markdown\n1. Mercury\n2. Venus\n\n***\n\n3. Earth\n4. Mars\n\n***\n\n0. Jupiter\n1. Saturn\n```\n\n###### Out\n\nNo messages.\n\n##### `ok.md`\n\nWhen configured with `'single'`.\n\n###### In\n\n```markdown\n1. Mercury\n1. Venus\n\n***\n\n3. Earth\n3. Mars\n\n***\n\n0. Jupiter\n0. Saturn\n```\n\n###### Out\n\nNo messages.\n\n##### `not-ok.md`\n\nWhen configured with `'one'`.\n\n###### In\n\n```markdown\n1. Mercury\n2. Venus\n\n***\n\n3. Earth\n\n***\n\n2. Mars\n1. Jupiter\n```\n\n###### Out\n\n```text\n2:2: Unexpected ordered list item value `2`, expected `1`\n6:2: Unexpected ordered list item value `3`, expected `1`\n10:2: Unexpected ordered list item value `2`, expected `1`\n```\n\n##### `not-ok.md`\n\nWhen configured with `'ordered'`.\n\n###### In\n\n```markdown\n1. Mercury\n1. Venus\n\n***\n\n2. Mars\n1. Jupiter\n```\n\n###### Out\n\n```text\n2:2: Unexpected ordered list item value `1`, expected `2`\n7:2: Unexpected ordered list item value `1`, expected `3`\n```\n\n##### `not-ok.md`\n\nWhen configured with `'single'`.\n\n###### In\n\n```markdown\n1. Mercury\n2. Venus\n\n***\n\n2. Mars\n1. Jupiter\n```\n\n###### Out\n\n```text\n2:2: Unexpected ordered list item value `2`, expected `1`\n7:2: Unexpected ordered list item value `1`, expected `2`\n```\n\n##### `not-ok.md`\n\nWhen configured with `'🌍'`.\n\n###### Out\n\n```text\n1:1: Unexpected value `🌍` for `options`, expected `'one'`, `'ordered'`, `'single'`, or `'consistent'`\n```\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,\n`remark-lint-ordered-list-marker-value@4`,\ncompatible with Node.js 16.\n\n## Contribute\n\nSee [`contributing.md`][github-dotfiles-contributing] in [`remarkjs/.github`][github-dotfiles-health] for ways\nto get started.\nSee [`support.md`][github-dotfiles-support] for ways to get help.\n\nThis project has a [code of conduct][github-dotfiles-coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## License\n\n[MIT][file-license] © [Titus Wormer][author]\n\n[api-options]: #options\n\n[api-remark-lint-ordered-list-marker-value]: #unifieduseremarklintorderedlistmarkervalue-options\n\n[api-style]: #style\n\n[author]: https://wooorm.com\n\n[badge-build-image]: https://github.com/remarkjs/remark-lint/workflows/main/badge.svg\n\n[badge-build-url]: https://github.com/remarkjs/remark-lint/actions\n\n[badge-chat-image]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[badge-chat-url]: https://github.com/remarkjs/remark/discussions\n\n[badge-coverage-image]: https://img.shields.io/codecov/c/github/remarkjs/remark-lint.svg\n\n[badge-coverage-url]: https://codecov.io/github/remarkjs/remark-lint\n\n[badge-downloads-image]: https://img.shields.io/npm/dm/remark-lint-ordered-list-marker-value.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/remark-lint-ordered-list-marker-value\n\n[badge-funding-backers-image]: https://opencollective.com/unified/backers/badge.svg\n\n[badge-funding-sponsors-image]: https://opencollective.com/unified/sponsors/badge.svg\n\n[badge-funding-url]: https://opencollective.com/unified\n\n[badge-size-image]: https://img.shields.io/bundlejs/size/remark-lint-ordered-list-marker-value\n\n[badge-size-url]: https://bundlejs.com/?q=remark-lint-ordered-list-marker-value\n\n[esm-sh]: https://esm.sh\n\n[file-license]: https://github.com/remarkjs/remark-lint/blob/main/license\n\n[github-dotfiles-coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md\n\n[github-dotfiles-contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md\n\n[github-dotfiles-health]: https://github.com/remarkjs/.github\n\n[github-dotfiles-support]: https://github.com/remarkjs/.github/blob/main/support.md\n\n[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[github-remark-lint]: https://github.com/remarkjs/remark-lint\n\n[github-remark-stringify]: https://github.com/remarkjs/remark/tree/main/packages/remark-stringify\n\n[github-unified-transformer]: https://github.com/unifiedjs/unified#transformer\n\n[npm-install]: https://docs.npmjs.com/cli/install\n\n[typescript]: https://www.typescriptlang.org\n","publish_time":1502971163324,"_cnpm_publish_time":1502971163324,"dist-tags":{"latest":"4.0.1"}}