{"name":"unified-lint-rule","version":"2.1.2","description":"unified plugin to make it a bit easier to create linting rules","license":"MIT","keywords":["unified","unified-plugin","plugin","lint","rule"],"repository":{"type":"git","url":"git+https://github.com/remarkjs/remark-lint.git","directory":"packages/unified-lint-rule"},"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/unist":"^2.0.0","trough":"^2.0.0","unified":"^10.0.0","vfile":"^5.0.0"},"scripts":{},"xo":false,"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"639271aed95fa579623f385bade4939a9c70e959","homepage":"https://github.com/remarkjs/remark-lint#readme","_id":"unified-lint-rule@2.1.2","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-JWudPtRN7TLFHVLEVZ+Rm8FUb6kCAtHxEXFgBGDxRSdNMnGyTU5zyYvduHSF/liExlFB3vdFvsAHnNVE/UjAwA==","shasum":"3ca2c6199b84aa8b48b60fda0f61b8eba55807d5","tarball":"http://registry-npm.ywwl.com/unified-lint-rule/download/unified-lint-rule-2.1.2.tgz","fileCount":6,"unpackedSize":11317,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwK4OkbmdJwqor5hyW5+LT2t2fFaoETeNPJDzog5AJ5QIgXrCHNzuYpUv4eh/g/03xOzvRO8QP7giokQ4ysGdmUzY="}],"size":3925,"noattachment":false,"key":"/unified-lint-rule/-/unified-lint-rule-2.1.2.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/unified-lint-rule_2.1.2_1684246309738_0.15361408310120095"},"_hasShrinkwrap":false,"readme":"<!--This file is generated-->\n\n# unified-lint-rule\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**[unified][github-unified]** helper to help make lint rules.\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  * [`lintRule(meta, rule)`](#lintrulemeta-rule)\n  * [`Label`](#label)\n  * [`Meta`](#meta)\n  * [`Rule`](#rule)\n  * [`Severity`](#severity)\n* [Compatibility](#compatibility)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a helper that makes it a bit easier to create linting rules.\n\n## When should I use this?\n\nYou can use this package when you want to make custom lint rules.\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 unified-lint-rule\n```\n\nIn Deno with [`esm.sh`][esm-sh]:\n\n```js\nimport {lintRule} from 'https://esm.sh/unified-lint-rule@3'\n```\n\nIn browsers with [`esm.sh`][esm-sh]:\n\n```html\n<script type=\"module\">\n  import {lintRule} from 'https://esm.sh/unified-lint-rule@3?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {lintRule} from 'unified-lint-rule'\n\nconst remarkLintFileExtension = lintRule(\n  'remark-lint:file-extension',\n  function (tree, file, options) {\n    const ext = file.extname\n    const option = options || 'md'\n\n    if (ext && ext.slice(1) !== option) {\n      file.message('Incorrect extension: use `' + option + '`')\n    }\n  }\n)\n\nexport default remarkLintFileExtension\n```\n\n## API\n\nThis package exports the identifier\n[`lintRule`][api-lint-rule].\nIt exports the [TypeScript][typescript] types\n[`Label`][api-label],\n[`Meta`][api-meta], and\n[`Severity`][api-severity].\nThere is no default export.\n\n### `lintRule(meta, rule)`\n\nCreate a plugin.\n\n###### Parameters\n\n* `meta` ([`Meta`][api-meta] or `string`)\n  — info or origin\n* `rule` ([`Rule`][api-rule])\n  — rule\n\n###### Returns\n\nPlugin ([`Plugin` from `unified`][github-unified-plugin]).\n\n### `Label`\n\nSeverity label (TypeScript type);\n`'off'`: `0`, `'on'` and `warn`: `1`, `'error'`: `2`.\n\n###### Type\n\n```ts\ntype Label = 'error' | 'on' | 'off' | 'warn'\n```\n\n### `Meta`\n\nRule metadata (TypeScript type).\n\n###### Fields\n\n* `origin` (`string`)\n  — name of the lint rule\n* `url` (`string`, optional)\n  — link to documentation\n\n### `Rule`\n\nRule (TypeScript type).\n\n###### Parameters\n\n* `tree` ([`Node` from `unist`][github-unist-node])\n  — tree\n* `file` ([`VFile`][github-vfile])\n  — file\n* `options` (`any`, optional)\n  — parameter\n\n###### Returns\n\nNothing (`Promise<undefined>` or `undefined`).\n\n### `Severity`\n\nSeverity number (TypeScript type);\n`0`: `'off'`, `1`: `'on'` and `warn`, `2`: `'error'`.\n\n###### Type\n\n```ts\ntype Severity = 0 | 1 | 2\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`unified-lint-rule@3`,\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-label]: #label\n\n[api-lint-rule]: #lintrulemeta-rule\n\n[api-meta]: #meta\n\n[api-rule]: #rule\n\n[api-severity]: #severity\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/unified-lint-rule.svg\n\n[badge-downloads-url]: https://www.npmjs.com/package/unified-lint-rule\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/unified-lint-rule\n\n[badge-size-url]: https://bundlejs.com/?q=unified-lint-rule\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-unified]: https://github.com/unifiedjs/unified\n\n[github-unified-plugin]: https://github.com/unifiedjs/unified#plugin\n\n[github-unist-node]: https://github.com/syntax-tree/unist#node\n\n[github-vfile]: https://github.com/vfile/vfile\n\n[npm-install]: https://docs.npmjs.com/cli/install\n\n[typescript]: https://www.typescriptlang.org\n","publish_time":1684246309985,"_cnpm_publish_time":1684246309985,"dist-tags":{"latest":"3.0.1"}}