From 9cdda8091355364cbb9a5c9e75889d5d67b08bdf Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Fri, 15 Dec 2023 14:59:01 +0100 Subject: [PATCH] Remove `remark-lint-no-auto-link-without-protocol` --- package.json | 1 - .../.npmrc | 2 - .../index.js | 88 -------- .../package.json | 55 ----- .../readme.md | 212 ------------------ .../tsconfig.json | 3 - 6 files changed, 361 deletions(-) delete mode 100644 packages/remark-lint-no-auto-link-without-protocol/.npmrc delete mode 100644 packages/remark-lint-no-auto-link-without-protocol/index.js delete mode 100644 packages/remark-lint-no-auto-link-without-protocol/package.json delete mode 100644 packages/remark-lint-no-auto-link-without-protocol/readme.md delete mode 100644 packages/remark-lint-no-auto-link-without-protocol/tsconfig.json diff --git a/package.json b/package.json index c78a6d5..7b38740 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,6 @@ "packages/remark-lint-list-item-spacing/", "packages/remark-lint-maximum-heading-length/", "packages/remark-lint-maximum-line-length/", - "packages/remark-lint-no-auto-link-without-protocol/", "packages/remark-lint-no-blockquote-without-marker/", "packages/remark-lint-no-consecutive-blank-lines/", "packages/remark-lint-no-duplicate-defined-urls/", diff --git a/packages/remark-lint-no-auto-link-without-protocol/.npmrc b/packages/remark-lint-no-auto-link-without-protocol/.npmrc deleted file mode 100644 index 3757b30..0000000 --- a/packages/remark-lint-no-auto-link-without-protocol/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -ignore-scripts=true -package-lock=false diff --git a/packages/remark-lint-no-auto-link-without-protocol/index.js b/packages/remark-lint-no-auto-link-without-protocol/index.js deleted file mode 100644 index aaf6650..0000000 --- a/packages/remark-lint-no-auto-link-without-protocol/index.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Deprecated. - * - * ## API - * - * to do: remove. - * - * [api-remark-lint-no-auto-link-without-protocol]: #api - * - * @module no-auto-link-without-protocol - * @author Titus Wormer - * @copyright 2015 Titus Wormer - * @license MIT - * @deprecated - * **Stability: Legacy**. - * This rule is no longer recommended for use. - * With CommonMark, all autolinks (except for emails) are required to have a - * protocol. - * Otherwise they don’t parse. - * The previous suggestion to add a protocol to email autolinks was wrong. - * - * @example - * {"name": "ok.md"} - * - * - * - * - * Most Markdown vendors don’t recognize the following as a link: - * - * - * @example - * {"name": "not-ok.md", "label": "input"} - * - * - * - * @example - * {"name": "not-ok.md", "label": "output"} - * - * 1:1-1:14: All automatic links must start with a protocol - */ - -/** - * @typedef {import('mdast').Root} Root - */ - -import {toString} from 'mdast-util-to-string' -import {lintRule} from 'unified-lint-rule' -import {pointEnd, pointStart} from 'unist-util-position' -import {visit} from 'unist-util-visit' - -// Protocol expression. -// See: . -const protocol = /^[a-z][a-z+.-]+:\/?/i - -const remarkLintNoAutoLinkWithoutProtocol = lintRule( - { - origin: 'remark-lint:no-auto-link-without-protocol', - url: 'https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-auto-link-without-protocol#readme' - }, - /** - * @param {Root} tree - * Tree. - * @returns {undefined} - * Nothing. - */ - function (tree, file) { - visit(tree, 'link', function (node) { - const end = pointEnd(node) - const headStart = pointStart(node.children[0]) - const start = pointStart(node) - const tailEnd = pointEnd(node.children[node.children.length - 1]) - - if ( - end && - headStart && - start && - tailEnd && - end.column === tailEnd.column + 1 && - start.column === headStart.column - 1 && - !protocol.test(toString(node)) - ) { - file.message('All automatic links must start with a protocol', node) - } - }) - } -) - -export default remarkLintNoAutoLinkWithoutProtocol diff --git a/packages/remark-lint-no-auto-link-without-protocol/package.json b/packages/remark-lint-no-auto-link-without-protocol/package.json deleted file mode 100644 index cdd0b28..0000000 --- a/packages/remark-lint-no-auto-link-without-protocol/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "remark-lint-no-auto-link-without-protocol", - "version": "3.1.2", - "description": "Deprecated", - "license": "MIT", - "keywords": [ - "auto", - "link", - "lint", - "protocol", - "remark", - "remark-lint", - "remark-lint-rule", - "rule" - ], - "repository": "https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-auto-link-without-protocol", - "bugs": "https://github.com/remarkjs/remark-lint/issues", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - }, - "author": "Titus Wormer (https://wooorm.com)", - "contributors": [ - "Titus Wormer " - ], - "sideEffects": false, - "type": "module", - "exports": "./index.js", - "files": [ - "index.d.ts", - "index.d.ts.map", - "index.js" - ], - "dependencies": { - "@types/mdast": "^4.0.0", - "mdast-util-to-string": "^4.0.0", - "unified-lint-rule": "^2.0.0", - "unist-util-position": "^5.0.0", - "unist-util-visit": "^5.0.0" - }, - "scripts": {}, - "typeCoverage": { - "atLeast": 100, - "detail": true, - "ignoreCatch": true, - "strict": true - }, - "xo": { - "prettier": true, - "rules": { - "capitalized-comments": "off", - "unicorn/prefer-at": "off" - } - } -} diff --git a/packages/remark-lint-no-auto-link-without-protocol/readme.md b/packages/remark-lint-no-auto-link-without-protocol/readme.md deleted file mode 100644 index aa0c341..0000000 --- a/packages/remark-lint-no-auto-link-without-protocol/readme.md +++ /dev/null @@ -1,212 +0,0 @@ - - -# remark-lint-no-auto-link-without-protocol - -[![Build][badge-build-image]][badge-build-url] -[![Coverage][badge-coverage-image]][badge-coverage-url] -[![Downloads][badge-downloads-image]][badge-downloads-url] -[![Size][badge-size-image]][badge-size-url] -[![Sponsors][badge-funding-sponsors-image]][badge-funding-url] -[![Backers][badge-funding-backers-image]][badge-funding-url] -[![Chat][badge-chat-image]][badge-chat-url] - -Deprecated. - -## Contents - -* [Presets](#presets) -* [Install](#install) -* [Use](#use) -* [API](#api) -* [Examples](#examples) -* [Compatibility](#compatibility) -* [Contribute](#contribute) -* [License](#license) - -## Presets - -This plugin is not included in presets maintained here. - -## Install - -This package is [ESM only][github-gist-esm]. -In Node.js (version 16+), -install with [npm][npm-install]: - -```sh -npm install remark-lint-no-auto-link-without-protocol -``` - -In Deno with [`esm.sh`][esm-sh]: - -```js -import remarkLintNoAutoLinkWithoutProtocol from 'https://esm.sh/remark-lint-no-auto-link-without-protocol@3' -``` - -In browsers with [`esm.sh`][esm-sh]: - -```html - -``` - -## Use - -On the API: - -```js -import remarkLint from 'remark-lint' -import remarkLintNoAutoLinkWithoutProtocol from 'remark-lint-no-auto-link-without-protocol' -import remarkParse from 'remark-parse' -import remarkStringify from 'remark-stringify' -import {read} from 'to-vfile' -import {unified} from 'unified' -import {reporter} from 'vfile-reporter' - -const file = await read('example.md') - -await unified() - .use(remarkParse) - .use(remarkLint) - .use(remarkLintNoAutoLinkWithoutProtocol) - .use(remarkStringify) - .process(file) - -console.error(reporter(file)) -``` - -On the CLI: - -```sh -remark --frail --use remark-lint --use remark-lint-no-auto-link-without-protocol . -``` - -On the CLI in a config file (here a `package.json`): - -```diff - … - "remarkConfig": { - "plugins": [ - … - "remark-lint", -+ "remark-lint-no-auto-link-without-protocol", - … - ] - } - … -``` - -## API - -This package exports no identifiers. -It exports no additional [TypeScript][typescript] types. -The default export is -[`remarkLintNoAutoLinkWithoutProtocol`][api-remark-lint-no-auto-link-without-protocol]. - -to do: remove. - -## Examples - -##### `ok.md` - -###### In - -```markdown - - - -Most Markdown vendors don’t recognize the following as a link: - -``` - -###### Out - -No messages. - -##### `not-ok.md` - -###### In - -```markdown - -``` - -###### Out - -```text -1:1-1:14: All automatic links must start with a protocol -``` - -## Compatibility - -Projects maintained by the unified collective are compatible with maintained -versions of Node.js. - -When we cut a new major release, we drop support for unmaintained versions of -Node. -This means we try to keep the current release line, -`remark-lint-no-auto-link-without-protocol@3`, -compatible with Node.js 12. - -## Contribute - -See [`contributing.md`][github-dotfiles-contributing] in [`remarkjs/.github`][github-dotfiles-health] for ways -to get started. -See [`support.md`][github-dotfiles-support] for ways to get help. - -This project has a [code of conduct][github-dotfiles-coc]. -By interacting with this repository, organization, or community you agree to -abide by its terms. - -## License - -[MIT][file-license] © [Titus Wormer][author] - -[api-remark-lint-no-auto-link-without-protocol]: #api - -[author]: https://wooorm.com - -[badge-build-image]: https://github.com/remarkjs/remark-lint/workflows/main/badge.svg - -[badge-build-url]: https://github.com/remarkjs/remark-lint/actions - -[badge-chat-image]: https://img.shields.io/badge/chat-discussions-success.svg - -[badge-chat-url]: https://github.com/remarkjs/remark/discussions - -[badge-coverage-image]: https://img.shields.io/codecov/c/github/remarkjs/remark-lint.svg - -[badge-coverage-url]: https://codecov.io/github/remarkjs/remark-lint - -[badge-downloads-image]: https://img.shields.io/npm/dm/remark-lint-no-auto-link-without-protocol.svg - -[badge-downloads-url]: https://www.npmjs.com/package/remark-lint-no-auto-link-without-protocol - -[badge-funding-backers-image]: https://opencollective.com/unified/backers/badge.svg - -[badge-funding-sponsors-image]: https://opencollective.com/unified/sponsors/badge.svg - -[badge-funding-url]: https://opencollective.com/unified - -[badge-size-image]: https://img.shields.io/bundlejs/size/remark-lint-no-auto-link-without-protocol - -[badge-size-url]: https://bundlejs.com/?q=remark-lint-no-auto-link-without-protocol - -[esm-sh]: https://esm.sh - -[file-license]: https://github.com/remarkjs/remark-lint/blob/main/license - -[github-dotfiles-coc]: https://github.com/remarkjs/.github/blob/main/code-of-conduct.md - -[github-dotfiles-contributing]: https://github.com/remarkjs/.github/blob/main/contributing.md - -[github-dotfiles-health]: https://github.com/remarkjs/.github - -[github-dotfiles-support]: https://github.com/remarkjs/.github/blob/main/support.md - -[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c - -[npm-install]: https://docs.npmjs.com/cli/install - -[typescript]: https://www.typescriptlang.org diff --git a/packages/remark-lint-no-auto-link-without-protocol/tsconfig.json b/packages/remark-lint-no-auto-link-without-protocol/tsconfig.json deleted file mode 100644 index 4082f16..0000000 --- a/packages/remark-lint-no-auto-link-without-protocol/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -}