{"_id":"remark-lint-media-style","_rev":"1-1a487115e646208af0ede8b711d06fc0","name":"remark-lint-media-style","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"remark-lint-media-style","version":"1.0.0","keywords":["image","link","lint","media","reference","remark","remark-lint","remark-lint-rule","resource","rule","style"],"author":{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"},"license":"MIT","_id":"remark-lint-media-style@1.0.0","maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com"}],"homepage":"https://github.com/remarkjs/remark-lint/tree/main#readme","bugs":{"url":"https://github.com/remarkjs/remark-lint/issues"},"xo":{"rules":{"complexity":"off","capitalized-comments":"off","logical-assignment-operators":"off"},"prettier":true},"dist":{"shasum":"0bc5534691d58adf92f82d5e084e6092b66412aa","tarball":"https://registry.npmjs.org/remark-lint-media-style/-/remark-lint-media-style-1.0.0.tgz","fileCount":5,"integrity":"sha512-q+SzByD/0dKVSL6W5ZmXWz1/t5NxCVJVrG+iJrrzH71Q0O60Eq5IYwp6NcFQtZRurDIQ7whaIC0nIBKYDa5Swg==","signatures":[{"sig":"MEQCIB8ceOCFc2z4pDiKx4moi0DM4k1ll0p9sVKGsHgr3nWWAiB3Wt/F4oBR0fvEq82u6VjyGCVHU0gRnNlVgUb6haBV+g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19744},"type":"module","types":"./index.d.ts","exports":"./index.js","funding":{"url":"https://opencollective.com/unified","type":"opencollective"},"gitHead":"5a350c5c9e0bd81f534c4e1446961a6da827d360","scripts":{},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"repository":{"url":"git+https://github.com/remarkjs/remark-lint.git#main","type":"git"},"_npmVersion":"11.0.0","description":"remark-lint rule to check whether references or resources are used","directories":{},"sideEffects":false,"_nodeVersion":"23.1.0","dependencies":{"@types/mdast":"^4.0.0","unified-lint-rule":"^3.0.0","unist-util-visit-parents":"^6.0.0"},"typeCoverage":{"strict":true,"atLeast":100},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/remark-lint-media-style_1.0.0_1737979443221_0.19959192124069447","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"bugs":{"url":"https://github.com/remarkjs/remark-lint/issues"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com"}],"dependencies":{"@types/mdast":"^4.0.0","unified-lint-rule":"^3.0.0","unist-util-visit-parents":"^6.0.0"},"description":"remark-lint rule to check whether references or resources are used","exports":"./index.js","funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"keywords":["image","link","lint","media","reference","remark","remark-lint","remark-lint-rule","resource","rule","style"],"license":"MIT","name":"remark-lint-media-style","repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-lint.git#main"},"scripts":{},"sideEffects":false,"typeCoverage":{"atLeast":100,"strict":true},"type":"module","version":"1.0.1","xo":{"prettier":true,"rules":{"capitalized-comments":"off","complexity":"off","logical-assignment-operators":"off"}},"_id":"remark-lint-media-style@1.0.1","gitHead":"46ccbcd49deaada0172ad10425a2cd6b5f21a2c2","types":"./index.d.ts","homepage":"https://github.com/remarkjs/remark-lint/tree/main#readme","_nodeVersion":"23.1.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-1+K2VZGX+TktYY6OsLg+4uQRp0qPeFJH9UlF2kAd0CuamuNNzNYqjPSeH4NqDvo3iLPRj31uqMiaHIp3hCXtxg==","shasum":"3bb89d9f338df68a5989d2fa88534519c4a46d1c","tarball":"https://registry.npmjs.org/remark-lint-media-style/-/remark-lint-media-style-1.0.1.tgz","fileCount":5,"unpackedSize":19744,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHf11PQm3V3uP3wTmQfC6E7KfUkQ42JnMsiunWPSYmZDAiA0lXH4E/ocM5TsJ5g0HiNb9cJW7yR8JBoG66Jq2kvEzQ=="}]},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/remark-lint-media-style_1.0.1_1737981179034_0.7960458605138752"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-27T12:04:03.220Z","modified":"2025-01-27T12:32:59.372Z","1.0.0":"2025-01-27T12:04:03.380Z","1.0.1":"2025-01-27T12:32:59.230Z"},"bugs":{"url":"https://github.com/remarkjs/remark-lint/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"license":"MIT","homepage":"https://github.com/remarkjs/remark-lint/tree/main#readme","keywords":["image","link","lint","media","reference","remark","remark-lint","remark-lint-rule","resource","rule","style"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-lint.git#main"},"description":"remark-lint rule to check whether references or resources are used","contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com"}],"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"readme":"<!--This file is generated-->\n\n# remark-lint-media-style\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 the style of specifying\nthe URL of images and links is incorrect.\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(remarkLintMediaStyle[, options])`](#unifieduseremarklintmediastyle-options)\n  * [`Options`](#options)\n  * [`Style`](#style)\n* [Examples](#examples)\n* [Compatibility](#compatibility)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package checks for media (image and link) style:\nwhether references or resources are used.\n\n## When should I use this?\n\nYou can use this package to check that the style of specifying the URL\nof images and links is correct.\n\n## Presets\n\nThis plugin is not included in presets maintained here.\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-media-style\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport remarkLintMediaStyle from 'https://esm.sh/remark-lint-media-style@1'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n<script type=\"module\">\n  import remarkLintMediaStyle from 'https://esm.sh/remark-lint-media-style@1?bundle'\n</script>\n```\n\n## Use\n\nOn the API:\n\n```js\nimport remarkLint from 'remark-lint'\nimport remarkLintMediaStyle from 'remark-lint-media-style'\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(remarkLintMediaStyle)\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-media-style .\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-media-style\",\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[`remarkLintMediaStyle`][api-remark-lint-media-style].\n\n### `unified().use(remarkLintMediaStyle[, options])`\n\nWarn when the style of specifying the URL of images and links is\nincorrect.\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### `Options`\n\nConfiguration (TypeScript type).\n\n* `'consistent'`\n  — detect the first used style and warn when further rules differ;\n  “reference-reuse” cannot be detected\n* [`Style`][api-style]\n  — style to prefer\n\n### `Style`\n\nStyle (TypeScript type).\n\n* `'reference'`\n  — prefer references\n* `'reference-reuse'`\n  — allow resources when used once,\n  prefer references otherwise\n* `'resource'`\n  — prefer resources\n\n## Examples\n\n##### `ok-consistent-reference.md`\n\n###### In\n\n```markdown\n[Mercury][] and [Venus][].\n\n[mercury]: https://example.com/mercury/\n[venus]: https://example.com/venus/\n```\n\n###### Out\n\nNo messages.\n\n##### `ok-consistent-resource.md`\n\n###### In\n\n```markdown\n[Mercury](https://example.com/mercury/) and\n[Venus](https://example.com/venus/).\n```\n\n###### Out\n\nNo messages.\n\n##### `ok-reference-reuse.md`\n\nWhen configured with `'reference-reuse'`.\n\n###### In\n\n```markdown\n[Mercury](https://example.com/mercury/),\n[Venus][], and [Earth][].\n\n**[Venus][]** is the second planet from the Sun.\n\n[venus]: https://example.com/venus/\n[earth]: https://example.com/earth/\n```\n\n###### Out\n\nNo messages.\n\n##### `nok-reference.md`\n\nWhen configured with `'reference'`.\n\n###### In\n\n```markdown\n[Mercury](https://example.com/mercury/),\n[Venus](https://example.com/venus/), and\n[Earth][].\n\n[earth]: https://example.com/earth/\n```\n\n###### Out\n\n```text\n1:1-1:40: Unexpected resource for url `https://example.com/mercury/`, expected a definition and a reference to it\n2:1-2:36: Unexpected resource for url `https://example.com/venus/`, expected a definition and a reference to it\n```\n\n##### `nok-resource.md`\n\nWhen configured with `'resource'`.\n\n###### In\n\n```markdown\n[Mercury](https://example.com/mercury/),\n[Venus](https://example.com/venus/), and\n[Earth][].\n\n[earth]: https://example.com/earth/\n```\n\n###### Out\n\n```text\n3:1-3:10: Unexpected reference for url `https://example.com/earth/`, expected resource\n```\n\n##### `nok-reference-reuse.md`\n\nWhen configured with `'reference-reuse'`.\n\n###### In\n\n```markdown\n[Mercury](https://example.com/mercury/),\n[Venus](https://example.com/venus/), and [Earth][].\n\n**[Venus](https://example.com/venus/)** is the second planet from the Sun.\n\n[earth]: https://example.com/earth/\n```\n\n###### Out\n\n```text\n2:1-2:36: Unexpected resource for reused url `https://example.com/venus/`, expected a definition and a reference to it\n4:3-4:38: Unexpected resource for reused url `https://example.com/venus/`, expected a definition and a reference to it\n```\n\n##### `reference-reuse-defined.md`\n\nWhen configured with `'reference-reuse'`.\n\n###### In\n\n```markdown\n[Mercury](https://example.com/mercury/).\n\n[mercury]: https://example.com/mercury/\n```\n\n###### Out\n\n```text\n1:1-1:40: Unexpected resource for reused url `https://example.com/mercury/`, expected a reference to `mercury`\n```\n\n##### `not-ok.md`\n\nWhen configured with `'🌍'`.\n\n###### Out\n\n```text\n1:1: Unexpected value `🌍` for `options`, expected `'reference-reuse'`, `'reference'`, `'resource'`, or `'consistent'`\n```\n\n##### `definitions.md`\n\n###### In\n\n```markdown\n[mercury]: https://example.com/mercury/\n[venus]: https://example.com/venus/\n```\n\n###### Out\n\nNo messages.\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-media-style@1`,\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-media-style]: #unifieduseremarklintmediastyle-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-media-style.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/remark-lint-media-style\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-media-style\n\n[badge-size-url]: https://bundlejs.com/?q=remark-lint-media-style\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-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","readmeFilename":"readme.md"}