diff --git a/CHANGELOG.md b/CHANGELOG.md index bae071e..6b888bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,7 @@
Change unordered marker from asterisk to dash — #1 ⇄ #2 (⊶ 261fe4cb) -↠ Added the initial style guide with the [comprehensive base rule set][docs-rules] with support for [GitHub Flavored Markdown][gfm] which is based on the [CommonMark][commonmark] specification. +↠ Added the initial style guide with the [comprehensive base rule set][docs-rules] with support for [GitHub Flavored Markdown][gfm] which is based on the [CommonMark][] specification.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eb38e8b..be6a89a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,7 +132,7 @@ When [reporting a bug](#bug-reports), sometimes even when [suggesting enhancemen - …Complete – Provide all parts needed to reproduce the behavior - …Verifiable – Test the code you're about to provide to make sure it reproduces the behavior -A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][sscce], a _Short, Self Contained, Correct (Compilable), Example_. +A MCVE is a common practice like on [Stack Overflow][stackoverflow-mcve] and sometimes it is also called [SSCCE][], a _Short, Self Contained, Correct (Compilable), Example_. The recommended way for GitHub based projects is to create it as [Gist][gh-gist] or new repository, but of course you can [attach it to issues and pull requests as files][ghd-attach-file], use any free code paste- or file hosting service or paste the code in [Markdown code blocks][ghd-markdown-code-blocks] into the issue. diff --git a/README.md b/README.md index 9e49526..358207a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ A style guide establishes and enforces style to improve the intelligibility and ### Getting Started The [project documentation][docs] contains chapters to learn about -the [comprehensive base rule set][docs-rules] with support for [GitHub Flavored Markdown][gfm] which is based on the [CommonMark][commonmark] specification. It includes rules for all document elements like e.g. [code blocks][docs-rules-code-blocks], [headings][docs-rules-headings] or [lists][docs-rules-lists], defines [naming conventions][docs-rules-naming-conventions] and best practices for [whitespaces][docs-rules-whitespaces], [Raw HTML][docs-rules-raw-html], [emphasizing][docs-rules-emphasis] and [strings][docs-rules-strings]. +the [comprehensive base rule set][docs-rules] with support for [GitHub Flavored Markdown][gfm] which is based on the [CommonMark][] specification. It includes rules for all document elements like e.g. [code blocks][docs-rules-code-blocks], [headings][docs-rules-headings] or [lists][docs-rules-lists], defines [naming conventions][docs-rules-naming-conventions] and best practices for [whitespaces][docs-rules-whitespaces], [Raw HTML][docs-rules-raw-html], [emphasizing][docs-rules-emphasis] and [strings][docs-rules-strings]. The development chapters contain information about the [requirements][docs-dev-requirements] and [how to build][docs-dev-building] the style guide documentation. diff --git a/package.json b/package.json index 71eafda..547d83c 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,6 @@ "lint-staged": "^10.5.4", "npm-run-all": "^4.1.5", "prettier": "^2.2.1", - "remark-cli": "^5.0.0" + "remark-cli": "^9.0.0" } } diff --git a/packages/@arcticicestudio/remark-preset-lint/index.js b/packages/@arcticicestudio/remark-preset-lint/index.js index f27aa31..92d79d2 100644 --- a/packages/@arcticicestudio/remark-preset-lint/index.js +++ b/packages/@arcticicestudio/remark-preset-lint/index.js @@ -6,6 +6,7 @@ /** * Arctic Ice Studio Markdown Style Guide rules as an extensible remark-lint rule preset. + * * @version 0.3.0 * @license MIT * @author Arctic Ice Studio diff --git a/packages/@arcticicestudio/remark-preset-lint/package.json b/packages/@arcticicestudio/remark-preset-lint/package.json index c7b5652..580d616 100644 --- a/packages/@arcticicestudio/remark-preset-lint/package.json +++ b/packages/@arcticicestudio/remark-preset-lint/package.json @@ -38,76 +38,81 @@ "access": "public" }, "dependencies": { - "remark-frontmatter": "^1.3.0", - "remark-lint": "^6.0.1", - "remark-lint-blockquote-indentation": "^1.0.1", - "remark-lint-checkbox-character-style": "^1.0.1", - "remark-lint-checkbox-content-indent": "^1.0.1", - "remark-lint-code-block-style": "^1.0.1", - "remark-lint-definition-case": "^1.0.1", - "remark-lint-definition-spacing": "^1.0.1", - "remark-lint-emphasis-marker": "^1.0.1", - "remark-lint-fenced-code-flag": "^1.0.1", - "remark-lint-fenced-code-marker": "^1.0.1", - "remark-lint-file-extension": "^1.0.1", - "remark-lint-final-definition": "^1.0.1", - "remark-lint-final-newline": "^1.0.1", - "remark-lint-first-heading-level": "^1.1.1", - "remark-lint-hard-break-spaces": "^1.0.2", - "remark-lint-heading-increment": "^1.0.1", - "remark-lint-heading-style": "^1.0.1", - "remark-lint-linebreak-style": "^1.0.1", - "remark-lint-link-title-style": "^1.0.1", - "remark-lint-list-item-bullet-indent": "^1.0.1", - "remark-lint-list-item-content-indent": "^1.0.1", - "remark-lint-list-item-indent": "^1.0.1", - "remark-lint-list-item-spacing": "^1.1.1", - "remark-lint-maximum-heading-length": "^1.0.1", - "remark-lint-maximum-line-length": "^1.0.2", - "remark-lint-no-auto-link-without-protocol": "^1.0.1", - "remark-lint-no-blockquote-without-marker": "^2.0.1", - "remark-lint-no-consecutive-blank-lines": "^1.0.1", - "remark-lint-no-duplicate-definitions": "^1.0.1", - "remark-lint-no-duplicate-headings": "^1.0.1", - "remark-lint-no-duplicate-headings-in-section": "^1.0.1", - "remark-lint-no-emphasis-as-heading": "^1.0.1", - "remark-lint-no-empty-url": "^1.0.2", - "remark-lint-no-file-name-articles": "^1.0.1", - "remark-lint-no-file-name-consecutive-dashes": "^1.0.1", - "remark-lint-no-file-name-irregular-characters": "^1.0.1", - "remark-lint-no-file-name-mixed-case": "^1.0.1", - "remark-lint-no-file-name-outer-dashes": "^1.0.2", - "remark-lint-no-heading-content-indent": "^1.0.1", - "remark-lint-no-heading-indent": "^1.0.1", - "remark-lint-no-heading-like-paragraph": "^1.0.1", - "remark-lint-no-heading-punctuation": "^1.0.1", - "remark-lint-no-html": "^1.0.1", - "remark-lint-no-inline-padding": "^1.0.1", - "remark-lint-no-literal-urls": "^1.0.1", - "remark-lint-no-missing-blank-lines": "^1.0.1", - "remark-lint-no-multiple-toplevel-headings": "^1.0.1", - "remark-lint-no-paragraph-content-indent": "^1.0.3", - "remark-lint-no-reference-like-url": "^1.0.1", - "remark-lint-no-shell-dollars": "^1.0.1", - "remark-lint-no-shortcut-reference-image": "^1.0.1", - "remark-lint-no-shortcut-reference-link": "^1.0.2", - "remark-lint-no-table-indentation": "^1.0.1", - "remark-lint-no-tabs": "^1.0.1", - "remark-lint-no-undefined-references": "^1.0.1", - "remark-lint-no-unused-definitions": "^1.0.1", - "remark-lint-ordered-list-marker-style": "^1.0.1", - "remark-lint-ordered-list-marker-value": "^1.0.1", - "remark-lint-rule-style": "^1.0.1", - "remark-lint-strong-marker": "^1.0.1", - "remark-lint-table-cell-padding": "^1.0.1", - "remark-lint-table-pipe-alignment": "^1.0.1", - "remark-lint-table-pipes": "^1.0.1", - "remark-lint-unordered-list-marker-style": "^1.0.1" + "remark-footnotes": "^3.0.0", + "remark-frontmatter": "^3.0.0", + "remark-gfm": "^1.0.0", + "remark-lint": "^8.0.0", + "remark-lint-blockquote-indentation": "^2.0.1", + "remark-lint-checkbox-character-style": "^3.0.0", + "remark-lint-checkbox-content-indent": "^3.0.0", + "remark-lint-code-block-style": "^2.0.1", + "remark-lint-definition-case": "^2.0.1", + "remark-lint-definition-spacing": "^2.0.1", + "remark-lint-emphasis-marker": "^2.0.1", + "remark-lint-fenced-code-flag": "^2.0.1", + "remark-lint-fenced-code-marker": "^2.0.1", + "remark-lint-file-extension": "^1.0.5", + "remark-lint-final-definition": "^2.1.0", + "remark-lint-final-newline": "^1.0.5", + "remark-lint-first-heading-level": "^2.0.1", + "remark-lint-hard-break-spaces": "^2.0.1", + "remark-lint-heading-increment": "^2.0.1", + "remark-lint-heading-style": "^2.0.1", + "remark-lint-linebreak-style": "^2.0.1", + "remark-lint-link-title-style": "^2.0.1", + "remark-lint-list-item-bullet-indent": "^3.0.0", + "remark-lint-list-item-content-indent": "^2.0.1", + "remark-lint-list-item-indent": "^2.0.1", + "remark-lint-list-item-spacing": "^3.0.0", + "remark-lint-maximum-heading-length": "^2.0.1", + "remark-lint-maximum-line-length": "^2.0.3", + "remark-lint-no-auto-link-without-protocol": "^2.0.1", + "remark-lint-no-blockquote-without-marker": "^4.0.0", + "remark-lint-no-consecutive-blank-lines": "^3.0.0", + "remark-lint-no-duplicate-defined-urls": "^1.0.1", + "remark-lint-no-duplicate-definitions": "^2.0.1", + "remark-lint-no-duplicate-headings": "^2.0.1", + "remark-lint-no-duplicate-headings-in-section": "^2.0.2", + "remark-lint-no-emphasis-as-heading": "^2.0.1", + "remark-lint-no-empty-url": "^2.0.1", + "remark-lint-no-file-name-articles": "^1.0.5", + "remark-lint-no-file-name-consecutive-dashes": "^1.0.5", + "remark-lint-no-file-name-irregular-characters": "^1.0.5", + "remark-lint-no-file-name-mixed-case": "^1.0.5", + "remark-lint-no-file-name-outer-dashes": "^1.0.6", + "remark-lint-no-heading-content-indent": "^3.0.0", + "remark-lint-no-heading-indent": "^3.0.0", + "remark-lint-no-heading-like-paragraph": "^2.0.1", + "remark-lint-no-heading-punctuation": "^2.0.1", + "remark-lint-no-html": "^2.0.1", + "remark-lint-no-inline-padding": "^3.0.0", + "remark-lint-no-literal-urls": "^2.0.1", + "remark-lint-no-missing-blank-lines": "^2.0.1", + "remark-lint-no-multiple-toplevel-headings": "^2.0.1", + "remark-lint-no-paragraph-content-indent": "^3.0.0", + "remark-lint-no-reference-like-url": "^2.0.1", + "remark-lint-no-shell-dollars": "^2.0.2", + "remark-lint-no-shortcut-reference-image": "^2.0.1", + "remark-lint-no-shortcut-reference-link": "^2.0.1", + "remark-lint-no-table-indentation": "^3.0.0", + "remark-lint-no-tabs": "^2.0.1", + "remark-lint-no-undefined-references": "^3.0.0", + "remark-lint-no-unneeded-full-reference-image": "^2.0.1", + "remark-lint-no-unneeded-full-reference-link": "^2.0.1", + "remark-lint-no-unused-definitions": "^2.0.1", + "remark-lint-ordered-list-marker-style": "^2.0.1", + "remark-lint-ordered-list-marker-value": "^2.0.1", + "remark-lint-rule-style": "^2.0.1", + "remark-lint-strong-marker": "^2.0.1", + "remark-lint-table-cell-padding": "^3.0.0", + "remark-lint-table-pipe-alignment": "^2.0.1", + "remark-lint-table-pipes": "^3.0.0", + "remark-lint-unordered-list-marker-style": "^2.0.1" }, "devDependencies": { - "remark-cli": "^5.0.0" + "remark-cli": "^9.0.0" }, "peerDependencies": { - "remark-cli": "^5.0.0" + "remark-cli": "^9.0.0" } } diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/blockquotes.js b/packages/@arcticicestudio/remark-preset-lint/rules/blockquotes.js index 10cecd9..c9c4da1 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/blockquotes.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/blockquotes.js @@ -21,9 +21,7 @@ const noBlockquoteWithoutMarker = require("remark-lint-no-blockquote-without-mar /** * Official remark-lint core rules for blockquote document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/code.js b/packages/@arcticicestudio/remark-preset-lint/rules/code.js index bbbb47f..417dadc 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/code.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/code.js @@ -35,9 +35,7 @@ const noShellDollars = require("remark-lint-no-shell-dollars"); /** * Official remark-lint core rules for code document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/emphasis.js b/packages/@arcticicestudio/remark-preset-lint/rules/emphasis.js index 7234b2d..8a522b1 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/emphasis.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/emphasis.js @@ -38,9 +38,7 @@ const strongMarker = require("remark-lint-strong-marker"); /** * Official remark-lint core rules for emphasis document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/headings.js b/packages/@arcticicestudio/remark-preset-lint/rules/headings.js index a6bf111..2c21ef3 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/headings.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/headings.js @@ -80,9 +80,7 @@ const noMultipleToplevelHeadings = require("remark-lint-no-multiple-toplevel-hea /** * Official remark-lint core rules for heading document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/horizontal-rules.js b/packages/@arcticicestudio/remark-preset-lint/rules/horizontal-rules.js index 1f8e097..ad88762 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/horizontal-rules.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/horizontal-rules.js @@ -14,9 +14,7 @@ const ruleStyle = require("remark-lint-rule-style"); /** * Official remark-lint core rules for horizontal rule document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/links.js b/packages/@arcticicestudio/remark-preset-lint/rules/links.js index 9ffd46d..1d1a69b 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/links.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/links.js @@ -39,6 +39,13 @@ const noAutoLinkWithoutProtocol = require("remark-lint-no-auto-link-without-prot * @see https://arcticicestudio.github.io/styleguide-markdown/rules/links.html#unique-ids */ const noDuplicateDefinitions = require("remark-lint-no-duplicate-definitions"); +/** + * Warn when definitions define the same URL. + * + * @see https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-duplicate-defined-urls + * @see https://arcticicestudio.github.io/styleguide-markdown/rules/links.html#unique-ids + */ +const noDuplicateDefinedURLs = require("remark-lint-no-duplicate-defined-urls"); /** * Disallow empty link and image URLs. * @@ -85,12 +92,26 @@ const noUndefinedReferences = require("remark-lint-no-undefined-references"); * @see https://arcticicestudio.github.io/styleguide-markdown/rules/links.html#no-unused */ const noUnusedDefinitions = require("remark-lint-no-unused-definitions"); +/** + * Warn when full reference images are used that could be collapsed. + * + * @since 0.4.0 + * @see https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-unneeded-full-reference-image + * @see https://arcticicestudio.github.io/styleguide-markdown/rules/images.html#collapsed-reference-links + */ +const noUnneededFullReferenceImage = require("remark-lint-no-unneeded-full-reference-image"); +/** + * Warn when full reference links are used that could be collapsed. + * + * @since 0.4.0 + * @see https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-unneeded-full-reference-link + * @see https://arcticicestudio.github.io/styleguide-markdown/rules/links.html#collapsed-references + */ +const noUnneededFullReferenceLink = require("remark-lint-no-unneeded-full-reference-link"); /** * Official remark-lint core rules for link document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { @@ -100,6 +121,7 @@ module.exports = { [finalDefinition, ["error"]], [noAutoLinkWithoutProtocol, ["warn"]], [noDuplicateDefinitions, ["error"]], + [noDuplicateDefinedURLs, ["warn"]], [noEmptyUrl, ["error"]], [noLiteralUrls, false], [noReferenceLikeUrl, ["error"]], @@ -107,5 +129,7 @@ module.exports = { [noShortcutReferenceLink, false], [noUndefinedReferences, ["error"]], [noUnusedDefinitions, ["warn"]], + [noUnneededFullReferenceImage, ["warn"]], + [noUnneededFullReferenceLink, ["warn"]], ], }; diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/lists.js b/packages/@arcticicestudio/remark-preset-lint/rules/lists.js index c7dc58c..2b9a2b3 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/lists.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/lists.js @@ -69,9 +69,7 @@ const unorderedListMarkerStyle = require("remark-lint-unordered-list-marker-styl /** * Official remark-lint core rules for list document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/naming-conventions.js b/packages/@arcticicestudio/remark-preset-lint/rules/naming-conventions.js index f36f240..aa4f6b4 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/naming-conventions.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/naming-conventions.js @@ -45,9 +45,7 @@ const noFileNameOuterDashes = require("remark-lint-no-file-name-outer-dashes"); /** * Official remark-lint core rules for naming conventions. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/paragraphs.js b/packages/@arcticicestudio/remark-preset-lint/rules/paragraphs.js index f22c7eb..6c35405 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/paragraphs.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/paragraphs.js @@ -14,9 +14,7 @@ const noParagraphContentIndent = require("remark-lint-no-paragraph-content-inden /** * Official remark-lint core rules for paragraph document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/raw-html.js b/packages/@arcticicestudio/remark-preset-lint/rules/raw-html.js index 23d59b7..5bd8582 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/raw-html.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/raw-html.js @@ -13,9 +13,7 @@ const noHtml = require("remark-lint-no-html"); /** * Official remark-lint core rules for raw HTML document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/strings.js b/packages/@arcticicestudio/remark-preset-lint/rules/strings.js index 42ea73a..9be0ccb 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/strings.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/strings.js @@ -14,9 +14,7 @@ const linkTitleStyle = require("remark-lint-link-title-style"); /** * Official remark-lint core rules for string document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/support.js b/packages/@arcticicestudio/remark-preset-lint/rules/support.js index f018e83..0915201 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/support.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/support.js @@ -5,20 +5,54 @@ */ /** - * Add support for YAML and TOML frontmatter. + * Adds support for Pandoc footnotes + * + * @since 0.4.0 + * @see https://github.com/remarkjs/remark-footnotes + * @see https://pandoc.org/ + */ +const footnotes = require("remark-footnotes"); +/** + * Adds support for YAML and TOML frontmatter. * * @since 0.3.0 * @see http://yaml.org * @see https://github.com/toml-lang/toml */ const frontmatter = require("remark-frontmatter"); +/** + * Adds support for "GitHub Flavored Markdown". + * + * @since 0.4.0 + * @see https://github.com/remarkjs/remark-gfm + * @see https://github.github.com/gfm + */ +const gfm = require("remark-gfm"); /** - * Support for rules of specification addons and additions. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * Support for plugins of specification addons and variants. */ module.exports = { - plugins: [[frontmatter, ["yaml", "toml"]]], + plugins: [ + [ + footnotes, + { + /* Enable support for inline notes like `^[note]`. */ + inlineNotes: true, + }, + ], + [frontmatter, ["toml", "yaml"]], + [ + gfm, + { + /* Disallow strikethrough with a single tilde. */ + singleTilde: false, + /* Ensure a space between table cell delimiters (`|`) and and content. */ + tableCellPadding: true, + + /* Align table delimiters (`|`) between cells so that they all align nicely and form a grid. */ + tablePipeAlign: true, + }, + ], + ], }; diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/tables.js b/packages/@arcticicestudio/remark-preset-lint/rules/tables.js index a5d4273..4093988 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/tables.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/tables.js @@ -36,9 +36,7 @@ const tablePipes = require("remark-lint-table-pipes"); /** * Official remark-lint core rules for table document nodes. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/packages/@arcticicestudio/remark-preset-lint/rules/whitespace.js b/packages/@arcticicestudio/remark-preset-lint/rules/whitespace.js index 2c70cbd..9a71619 100644 --- a/packages/@arcticicestudio/remark-preset-lint/rules/whitespace.js +++ b/packages/@arcticicestudio/remark-preset-lint/rules/whitespace.js @@ -56,9 +56,7 @@ const noTabs = require("remark-lint-no-tabs"); /** * Official remark-lint core rules for whitespaces. - * @author Arctic Ice Studio - * @author Sven Greb - * @since 0.1.0 + * * @see https://github.com/remarkjs/remark-lint/blob/main/doc/rules.md#list-of-rules */ module.exports = { diff --git a/src/README.md b/src/README.md index 9e49526..5915f3f 100644 --- a/src/README.md +++ b/src/README.md @@ -1,64 +1 @@ -

- -

The Arctic Ice Studio Markdown code style.

- -

- -

- -

- -Every major open source project has its own style guide, a set of standards and conventions for the writing and design of code, documentations and assets. It is much easier to understand a large codebase when all the code in it is in a consistent style. - -A style guide establishes and enforces style to improve the intelligibility and communication within the project community. It ensures consistency and enforces best practice in usage and language composition. - -### Getting Started - -The [project documentation][docs] contains chapters to learn about -the [comprehensive base rule set][docs-rules] with support for [GitHub Flavored Markdown][gfm] which is based on the [CommonMark][commonmark] specification. It includes rules for all document elements like e.g. [code blocks][docs-rules-code-blocks], [headings][docs-rules-headings] or [lists][docs-rules-lists], defines [naming conventions][docs-rules-naming-conventions] and best practices for [whitespaces][docs-rules-whitespaces], [Raw HTML][docs-rules-raw-html], [emphasizing][docs-rules-emphasis] and [strings][docs-rules-strings]. - -The development chapters contain information about the [requirements][docs-dev-requirements] and [how to build][docs-dev-building] the style guide documentation. - -### Remark Configurations - -To follow the rules in a project and ensure that your code matches this style guide use the official extensible code linter rule preset [@arcticicestudio/remark-preset-lint][gh-tree-pkg-remark-preset-lint] for [remark-lint][gh-remarkjs/remark-lint], a plugin for [remark][]. - -### Contributing - -Read the [contributing guide][docs-dev-contributing] to learn about the development process and how to propose [enhancement suggestions][docs-dev-contributing-enhancements] and [report bugs][docs-dev-contributing-bug-reports], how to [submit pull requests][docs-dev-contributing-pr] and the project‘s [style guides][docs-dev-contributing-styleguides], [branch organization][docs-dev-contributing-branch-org] and [versioning][docs-dev-contributing-versioning] model. - -The guide also includes information about [minimal, complete, and verifiable examples][docs-dev-contributing-mcve] and other ways to contribute to the project like [improving existing issues][docs-dev-contributing-other-improve-issues] and [giving feedback on issues and pull requests][docs-dev-contributing-other-feedback]. - -

- -

Copyright © 2018-present Arctic Ice Studio and Sven Greb

- -

- -[commonmark]: http://commonmark.org -[docs-dev-building]: https://arcticicestudio.github.io/styleguide-markdown/development/building.html -[docs-dev-contributing-branch-org]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#branch-organization -[docs-dev-contributing-bug-reports]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#bug-reports -[docs-dev-contributing-enhancements]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#enhancement-suggestions -[docs-dev-contributing-mcve]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#mcve -[docs-dev-contributing-other-feedback]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#give-feedback-on-issues-and-pull-requests -[docs-dev-contributing-other-improve-issues]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#improve-issues -[docs-dev-contributing-pr]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#pull-requests -[docs-dev-contributing-styleguides]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#style-guides -[docs-dev-contributing-versioning]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html#versioning -[docs-dev-contributing]: https://arcticicestudio.github.io/styleguide-markdown/development/contributing.html -[docs-dev-requirements]: https://arcticicestudio.github.io/styleguide-markdown/development/requirements.html -[docs-rules-code-blocks]: https://arcticicestudio.github.io/styleguide-markdown/rules/code.html#blocks -[docs-rules-emphasis]: https://arcticicestudio.github.io/styleguide-markdown/rules/emphasis.html -[docs-rules-headings]: https://arcticicestudio.github.io/styleguide-markdown/rules/headings.html -[docs-rules-lists]: https://arcticicestudio.github.io/styleguide-markdown/rules/lists.html -[docs-rules-naming-conventions]: https://arcticicestudio.github.io/styleguide-markdown/rules/naming-conventions.html -[docs-rules-raw-html]: https://arcticicestudio.github.io/styleguide-markdown/rules/raw-html.html -[docs-rules-strings]: https://arcticicestudio.github.io/styleguide-markdown/rules/strings.html -[docs-rules-whitespaces]: https://arcticicestudio.github.io/styleguide-markdown/rules/whitespaces.html -[docs-rules]: https://arcticicestudio.github.io/styleguide-markdown/rules/index.html -[docs]: https://arcticicestudio.github.io/styleguide-markdown -[gfm]: https://github.github.com/gfm -[gh-remarkjs/remark-lint]: https://github.com/remarkjs/remark-lint -[gh-tree-pkg-remark-preset-lint]: https://github.com/arcticicestudio/styleguide-markdown/tree/main/packages/@arcticicestudio/remark-preset-lint -[remark]: https://remark.js.org +{% include "git+https://github.com/arcticicestudio/styleguide-markdown.git/README.md" %} diff --git a/src/development/requirements.md b/src/development/requirements.md index 8941368..50534db 100644 --- a/src/development/requirements.md +++ b/src/development/requirements.md @@ -4,7 +4,7 @@ Styleguide Markdown is build with [Node.js][nodejs] which is required to build s ### npm -[npm][npm] is used as package manager which comes prebundled with Node.js and can be used from the CLI. +[npm][] is used as package manager which comes pre-bundled with Node.js and can be used from the CLI. [nodejs]: https://nodejs.org/en/download/releases [npm]: https://npmjs.com diff --git a/src/rules/accessibility-a11y.md b/src/rules/accessibility-a11y.md index ee38354..1a6169a 100644 --- a/src/rules/accessibility-a11y.md +++ b/src/rules/accessibility-a11y.md @@ -1,4 +1,4 @@ -This chapter provides rules to improve the accessibility as documented by the [A11Y][a11y] project. +This chapter provides rules to improve the accessibility as documented by the [A11Y][] project. ## Alternative Text diff --git a/src/rules/code.md b/src/rules/code.md index a5ea8aa..2ee1e17 100644 --- a/src/rules/code.md +++ b/src/rules/code.md @@ -241,9 +241,9 @@ export default Snow; Don't use it for -- **project or proper names** - e.g [React][react], [GCC][gcc], [Node.js][nodejs], [Golang][golang] or [Rust][rustlang] -- **libraries** - e.g. [libgit2][], [libc][crates-libc] (Rust Bindings), [glibc][], [glib2][] or [jackson-databind][bintray-jackson-databind] (Java) -- **packages and modules** - e.g. [react-dom][npm-react-dom], [snowsaw][pypi-snowsaw] or [archlinux-keyring][archlinux-keyring] +- **project or proper names** - e.g [React][], [GCC][], [Node.js][nodejs], [Go][] or [Rust][]. +- **libraries** - e.g. [libgit2][], [libc][crates-libc] (Rust Bindings), [glibc][], [glib2][] or [jackson-databind][bintray-jackson-databind] (Java). +- **packages and modules** - e.g. [react-dom][npm-react-dom], [snowsaw][pypi-snowsaw] or [archlinux-keyring][]. [archlinux-keyring]: https://www.archlinux.org/packages/core/any/archlinux-keyring [bintray-jackson-databind]: https://bintray.com/bintray/jcenter/com.fasterxml.jackson.core%3Ajackson-databind @@ -253,7 +253,7 @@ Don't use it for [gh-help-gfm_code_syntax_highlighting]: https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting [glib2]: https://wiki.gnome.org/Projects/GLib [glibc]: https://www.gnu.org/software/libc -[golang]: https://golang.org +[go]: https://golang.org [libgit2]: https://libgit2.github.com [nodejs]: https://nodejs.org [npm-react-dom]: https://www.npmjs.com/package/react-dom @@ -263,4 +263,4 @@ Don't use it for [remark-lint-fenced-code-flag]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-fenced-code-flag [remark-lint-fenced-code-marker]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-fenced-code-marker [remark-lint-no-shell-dollars]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-shell-dollars -[rustlang]: https://www.rust-lang.org +[rust]: https://www.rust-lang.org diff --git a/src/rules/images.md b/src/rules/images.md index 1906b31..99f951d 100644 --- a/src/rules/images.md +++ b/src/rules/images.md @@ -24,6 +24,42 @@ Prefer absolute URLs instead of relative ones to improve the portability of the [snowflake]: https://raw.githubusercontent.com/arcticicestudio/styleguide-markdown/main/src/assets/snowflake.png ``` +## Collapsed Reference Links + +Full references (such as `[Winter][winter]`) can also be written as a collapsed reference (`[Winter][]`) if normalizing the reference text yields the label. + +> remark-lint: [no-unneeded-full-reference-image][remark-lint-no-unneeded-full-reference-image] + +###### Examples + +⇣ **Incorrect** code for this rule: + + + +```markdown +![arctic][arctic] +![snowflake][snowflake] +![winter][winter] + +[arctic]: https://arctic-is-beautiful.io/north-pole.png +[snowflake]: https://snow-is-falling-down.io/snowflake.png +[winter]: https://the-winter-is-sparkling-and-frozen.io/winter.png +``` + + + +⇡ **Correct** code for this rule: + +```markdown +![arctic][north-pole] +![snowflake][] +![winter][] + +[north-pole]: https://arctic-is-beautiful.io/north-pole.png +[snowflake]: https://snow-is-falling-down.io/snowflake.png +[winter]: https://the-winter-is-sparkling-and-frozen.io/winter.png +``` + ## Badges Use badges to represent simple information like latest version number and URL to its docs, the status of CI builds or fetched information of external systems like e.g. the latest version and total download amount from the [NPM registry][npm] or [Rust crates][crates.io]. @@ -43,3 +79,4 @@ Use badges to represent simple information like latest version number and URL to [crates.io]: https://crates.io [npm]: https://npmjs.com +[remark-lint-no-unneeded-full-reference-image]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-no-unneeded-full-reference-image diff --git a/src/rules/links.md b/src/rules/links.md index 4f42b2f..98e8bd6 100644 --- a/src/rules/links.md +++ b/src/rules/links.md @@ -431,6 +431,74 @@ The [Winter][winter] is sparkling and frozen! [winter]: https://the-winter-is-sparkling-and-frozen.io ``` +## No Duplicates + +Prevent definitions that use the same URL. + +> remark-lint: [no-duplicate-defined-urls][remark-lint-no-duplicate-defined-urls] + +###### Examples + +⇣ **Incorrect** code for this rule: + + + +```markdown +[arctic][] +[north-pole][] + +[arctic]: https://arctic-is-beautiful.io +[north-pole]: https://arctic-is-beautiful.io +``` + + + +⇡ **Correct** code for this rule: + +```markdown +[arctic][] +[north-pole][] + +[arctic]: https://arctic-is-beautiful.io +[north-pole]: https://frozen-nordic-arctic.io +``` + +## Collapsed References + +Full references (such as `[Winter][winter]`) can also be written as a collapsed reference (`[Winter][]`) if normalizing the reference text yields the label. + +> remark-lint: [no-unneeded-full-reference-link][remark-lint-no-unneeded-full-reference-link] + +###### Examples + +⇣ **Incorrect** code for this rule: + + + +```markdown +[arctic][arctic] +[snowflake][snowflake] +[Winter][winter] + +[arctic]: https://arctic-is-beautiful.io +[snowflake]: https://snow-is-falling-down.io +[winter]: https://the-winter-is-sparkling-and-frozen.io +``` + + + +⇡ **Correct** code for this rule: + +```markdown +[arctic][north-pole] +[snowflake][] +[Winter][] + +[north-pole]: https://arctic-is-beautiful.io +[snowflake]: https://snow-is-falling-down.io +[winter]: https://the-winter-is-sparkling-and-frozen.io +``` + ## Autolink Protocol Always add a valid protocol when using [autolinks][gfm-spec-links-autolinks]. @@ -577,10 +645,12 @@ The [winter](https://the-winter-is-sparkling-and-frozen.io) is sparkling and fro [remark-lint-definition-spacing]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-definition-spacing [remark-lint-final-definition]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-final-definition [remark-lint-no-auto-link-without-protocol]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-auto-link-without-protocol +[remark-lint-no-duplicate-defined-urls]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-duplicate-defined-urls [remark-lint-no-duplicate-definitions]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-duplicate-definitions [remark-lint-no-empty-url]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-empty-url [remark-lint-no-inline-padding]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-inline-padding [remark-lint-no-reference-like-url]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-reference-like-url [remark-lint-no-undefined-references]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-undefined-references +[remark-lint-no-unneeded-full-reference-link]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-unneeded-full-reference-link [remark-lint-no-unused-definitions]: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-lint-no-unused-definitions [w3-html5-spec-navigate_fragment_identifier]: https://www.w3.org/TR/html52/browsers.html#navigating-to-a-fragment-identifier diff --git a/src/rules/tables.md b/src/rules/tables.md index ad2f619..21008bd 100644 --- a/src/rules/tables.md +++ b/src/rules/tables.md @@ -1,11 +1,11 @@ ## Prefer Lists -Prefer [lists][lists] and only use tables for small, non-complex and single line content. +Prefer [lists][] and only use tables for small, non-complex and single line content. Complex, large tables are difficult to read in source and most importantly, a pain to modify, indent and also read later e.g. when using - line breaks within rows - very long sentences that must be wrapped -- document elements like [code blocks][code-blocks] or [blockquotes][blockquotes] +- document elements like [code blocks][code-blocks] or [blockquotes][] - [inline links][links-inline] with long URLs Lists and subheadings usually suffice to present the same information in a slightly less compact, though much more edit-friendly and more elegant way. diff --git a/src/rules/whitespace.md b/src/rules/whitespace.md index 7071f29..715c230 100644 --- a/src/rules/whitespace.md +++ b/src/rules/whitespace.md @@ -143,7 +143,7 @@ Other style guides suggest to use line breaks after the character limit has been Instead of enforcing a maximum line length, users should use [soft line wrapping][wiki-line_wrap]: -- **Soft wrapping allows line lengths to visually adjust automatically with adjustments to the width of the user's window** or margin settings - This is a standard feature of all modern text editors like [VSCode][vscode-doc-soft_wrap] or [Atom][atom-doc-soft_wrap], IDEs like [JetBrains IntelliJ IDEA][jetbrains-intellij-doc-soft_wrap], word processors, and email clients like [Thunderbird][thunderbird]. +- **Soft wrapping allows line lengths to visually adjust automatically with adjustments to the width of the user's window** or margin settings - This is a standard feature of all modern text editors like [VSCode][vscode-doc-soft_wrap] or [Atom][atom-doc-soft_wrap], IDEs like [JetBrains IntelliJ IDEA][jetbrains-intellij-doc-soft_wrap], word processors, and email clients like [Thunderbird][]. - **Using hard wrap inserts actual line breaks in the text at wrap points causing the Markdown to not look like the rendered output** - With soft wrapping the actual text is still on the same line but will be rendered by the application like it's divided into several lines. This **increases the readability** significantly and leads to the same visual result as if a maximum line length with hard line breaks for flowing text would have been used. - **Less writer effort** - The author can focus on the content instead of formatting.