{"name":"remark-lint-emphasis-marker","version":"3.1.0","description":"remark-lint rule to warn when emphasis markers violate the given style","license":"MIT","keywords":["remark","lint","rule","remark-lint-rule","emphasis","marker"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-lint.git","directory":"packages/remark-lint-emphasis-marker"},"bugs":{"url":"https://github.com/remarkjs/remark-lint/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","types":"index.d.ts","dependencies":{"@types/mdast":"^3.0.0","unified":"^10.0.0","unified-lint-rule":"^2.0.0","unist-util-position":"^4.0.0","unist-util-visit":"^4.0.0"},"scripts":{"build":"rimraf \"*.d.ts\" && tsc && type-coverage"},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"201e9950440ab3abce83e755af180f6b2016affc","homepage":"https://github.com/remarkjs/remark-lint#readme","_id":"remark-lint-emphasis-marker@3.1.0","_nodeVersion":"16.9.0","_npmVersion":"7.23.0","dist":{"integrity":"sha512-sIz5bVe+CpcM5yK//hMFHdGQ8laTfIqjOWJCR4CBizY3iNWIZG7qw5A7pXkOr4DfP8U1inxAWrA+Z+aQ80IscA==","shasum":"1394bd779a0090fc0f76a7ff70697d45cde43565","tarball":"http://registry-npm.ywwl.com/remark-lint-emphasis-marker/download/remark-lint-emphasis-marker-3.1.0.tgz","fileCount":4,"unpackedSize":9889,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAXI8BVdoKMEQ3DfEhzq4J5KM9ZcNwDPyQdFWm8sSMJ9AiEAgvNubXKZ7jC6E9gdv/7Pfc3VBqipBnCILLIlVfc5mj0="}],"size":3096,"noattachment":false,"key":"/remark-lint-emphasis-marker/-/remark-lint-emphasis-marker-3.1.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"johno","email":"johnotander@gmail.com"},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/remark-lint-emphasis-marker_3.1.0_1631963473950_0.9912918250288978"},"_hasShrinkwrap":false,"readme":"<!--This file is generated-->\n\n# remark-lint-emphasis-marker\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 emphasis markers 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(remarkLintEmphasisMarker[, options])`](#unifieduseremarklintemphasismarker-options)\n  * [`Marker`](#marker)\n  * [`Options`](#options)\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 the style of emphasis markers.\n\n## When should I use this?\n\nYou can use this package to check that emphasis is consistent.\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) | `'*'` |\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-emphasis-marker\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport remarkLintEmphasisMarker from 'https://esm.sh/remark-lint-emphasis-marker@4'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n<script type=\"module\">\n  import remarkLintEmphasisMarker from 'https://esm.sh/remark-lint-emphasis-marker@4?bundle'\n</script>\n```\n\n## Use\n\nOn the API:\n\n```js\nimport remarkLint from 'remark-lint'\nimport remarkLintEmphasisMarker from 'remark-lint-emphasis-marker'\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(remarkLintEmphasisMarker)\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-emphasis-marker .\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-emphasis-marker\",\n     …\n   ]\n }\n …\n```\n\n## API\n\nThis package exports no identifiers.\nIt exports the [TypeScript][typescript] types\n[`Marker`][api-marker] and\n[`Options`][api-options].\nThe default export is\n[`remarkLintEmphasisMarker`][api-remark-lint-emphasis-marker].\n\n### `unified().use(remarkLintEmphasisMarker[, options])`\n\nWarn when emphasis markers are inconsistent.\n\n###### Parameters\n\n* `options` ([`Options`][api-options], default: `'consistent'`)\n  — preferred style or whether to detect the first style and warn for\n  further differences\n\n###### Returns\n\nTransform ([`Transformer` from `unified`][github-unified-transformer]).\n\n### `Marker`\n\nMarker (TypeScript type).\n\n###### Type\n\n```ts\ntype Marker = '*' | '_'\n```\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Type\n\n```ts\ntype Options = Marker | 'consistent'\n```\n\n## Recommendation\n\nWhether asterisks or underscores are used affects how and whether emphasis\nworks.\nUnderscores are sometimes used to represent normal underscores inside words,\nso there are extra rules in markdown to support that.\nAsterisks are not used in natural language,\nso they don’t need these rules,\nand thus can form emphasis in more cases.\nAsterisks can also be used as the marker of more constructs than underscores:\nlists.\nDue to having simpler parsing rules,\nlooking more like syntax,\nand that they can be used for more constructs,\nit’s recommended to prefer asterisks.\n\n## Fix\n\n[`remark-stringify`][github-remark-stringify] formats emphasis with\nasterisks by default.\nPass `emphasis: '_'` to always use underscores.\n\n## Examples\n\n##### `ok-asterisk.md`\n\nWhen configured with `'*'`.\n\n###### In\n\n```markdown\n*Mercury*.\n```\n\n###### Out\n\nNo messages.\n\n##### `not-ok-asterisk.md`\n\nWhen configured with `'*'`.\n\n###### In\n\n```markdown\n_Mercury_.\n```\n\n###### Out\n\n```text\n1:1-1:10: Unexpected emphasis marker `_`, expected `*`\n```\n\n##### `ok-underscore.md`\n\nWhen configured with `'_'`.\n\n###### In\n\n```markdown\n_Mercury_.\n```\n\n###### Out\n\nNo messages.\n\n##### `not-ok-underscore.md`\n\nWhen configured with `'_'`.\n\n###### In\n\n```markdown\n*Mercury*.\n```\n\n###### Out\n\n```text\n1:1-1:10: Unexpected emphasis marker `*`, expected `_`\n```\n\n##### `not-ok-consistent.md`\n\n###### In\n\n```markdown\n*Mercury* and _Venus_.\n```\n\n###### Out\n\n```text\n1:15-1:22: Unexpected emphasis marker `_`, expected `*`\n```\n\n##### `not-ok.md`\n\nWhen configured with `'🌍'`.\n\n###### Out\n\n```text\n1:1: Unexpected value `🌍` for `options`, expected `'*'`, `'_'`, 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-emphasis-marker@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-marker]: #marker\n\n[api-options]: #options\n\n[api-remark-lint-emphasis-marker]: #unifieduseremarklintemphasismarker-options\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-emphasis-marker.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/remark-lint-emphasis-marker\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-emphasis-marker\n\n[badge-size-url]: https://bundlejs.com/?q=remark-lint-emphasis-marker\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":1631963474109,"_cnpm_publish_time":1631963474109,"dist-tags":{"latest":"4.0.1"}}