Skip to content

Commit

Permalink
🛠️ Lint markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Singh1 committed Sep 16, 2021
1 parent 6eda3d1 commit c98502d
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 28 deletions.
6 changes: 6 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"line-length": {
"code_blocks": false,
"tables": false
}
}
2 changes: 2 additions & 0 deletions docs/_404.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD033 -->

<h1 align="center">404: Not Found</h1>

<p align="center">Try going back to the <a href="/">homepage</a></p>
2 changes: 2 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD041 -->

- Introduction

- [Getting Started](README.md)
Expand Down
11 changes: 8 additions & 3 deletions docs/rules/align-attributes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# `align-attributes`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
> 🔧 The `--fix` option on the command line can automatically fix some of the problems reported by this rule.
<!-- markdownlint-disable-next-line MD033 -->

> 🔧 The `--fix` option on the command line can automatically fix some of the
> problems reported by this rule.
The `align-attributes` rule verifies that the attributes are spaced out.

Expand All @@ -12,7 +16,8 @@ For readability when debugging and editing the userscript.

## Options

This rule has a number option which represents the spaces after the longest attribute name. Defaults to 2.
This rule has a number option which represents the spaces after the longest
attribute name. Defaults to 2.

## Examples

Expand Down
3 changes: 2 additions & 1 deletion docs/rules/filename-user.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `filename-user`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
The `filename-user` rule verifies that the filename ends in `.user.js`.

Expand Down
15 changes: 10 additions & 5 deletions docs/rules/no-invalid-metadata.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
# `no-invalid-metadata`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
The `no-invalid-metadata` rule verifies that the userscript metadata for the file is valid.
The `no-invalid-metadata` rule verifies that the userscript metadata for the file
is valid.

## Why?

So errors don't come and the metadata is provided for ease of handling userscripts and users in production.
So errors don't come and the metadata is provided for ease of handling userscripts
and users in production.

## Options

This rule has an object option:

- `"top"` (default: `"required"`) requires that the metadata be on the top of the file
- `"top"` (default: `"required"`) requires that the metadata be on the top of the
file

## Examples

Expand Down Expand Up @@ -114,4 +118,5 @@ console.log('starting userscript');

## When Not to Use It

Turn off this rule when you are not linting userscripts or know that any of the above conditions won't cause a problem on your end.
Turn off this rule when you are not linting userscripts or know that any of the
above conditions won't cause a problem on your end.
6 changes: 4 additions & 2 deletions docs/rules/require-attribute-space-prefix.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# `require-attribute-space-prefix`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
The `require-attribute-space-prefix` rule verifies that the header attribute are prefixed by at least one space.
The `require-attribute-space-prefix` rule verifies that the header attribute are
prefixed by at least one space.

## Why?

Expand Down
12 changes: 8 additions & 4 deletions docs/rules/require-description.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# `require-description`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
The `require-description` rule verifies that the description attribute is present and there is no more than one of it.
The `require-description` rule verifies that the description attribute is present
and there is no more than one of it.

## Why?

To give a better description on the userscript and to make sure that there is not accidentally more than one.
To give a better description on the userscript and to make sure that there is not
accidentally more than one.

## Options

Expand Down Expand Up @@ -76,4 +79,5 @@ This rule has a string option:

## When Not to Use It

This rule should apply to all userscripts which want to be descriptive about what they do.
This rule should apply to all userscripts which want to be descriptive about what
they do.
11 changes: 8 additions & 3 deletions docs/rules/require-name.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# `require-name`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
> 🔧 The `--fix` option on the command line can automatically fix some of the problems reported by this rule.
<!-- markdownlint-disable-next-line MD033 -->

The `require-name` rule verifies that the name attribute is present and there is no more than one of it. It also ensures that it is the first attribute.
> 🔧 The `--fix` option on the command line can automatically fix some of the
> problems reported by this rule.
The `require-name` rule verifies that the name attribute is present and there is
no more than one of it. It also ensures that it is the first attribute.

## Why?

Expand Down
7 changes: 5 additions & 2 deletions docs/rules/require-version.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `require-version`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
The `require-version` rule verifies that a valid version attribute is present.

Expand Down Expand Up @@ -69,4 +70,6 @@ This rule has a string option:

## When Not to Use It

Don't use this rule when you are not using versions and pushing to production. It is recommended that you enable this rule with the `"optional"` option in that case.
Don't use this rule when you are not using versions and pushing to production.
It is recommended that you enable this rule with the `"optional"` option in that
case.
14 changes: 10 additions & 4 deletions docs/rules/use-download-and-update-url.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# `use-download-and-update-url`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
> 🔧 The `--fix` option on the command line can automatically fix some of the problems reported by this rule.
<!-- markdownlint-disable-next-line MD033 -->

The `use-download-and-update-url` rule verifies that if the `updateURL` attribute is present then the `downloadURL` attribute is too and vice versa.
> 🔧 The `--fix` option on the command line can automatically fix some of the
> problems reported by this rule.
The `use-download-and-update-url` rule verifies that if the `updateURL` attribute
is present then the `downloadURL` attribute is too and vice versa.

## Why?

Expand Down Expand Up @@ -35,4 +40,5 @@ For compatibility with different userscript runners.

## When Not to Use It

When you are sure that the userscript runner that you and your users use is compatible with your choice.
When you are sure that the userscript runner that you and your users use is
compatible with your choice.
14 changes: 10 additions & 4 deletions docs/rules/use-homepage-and-url.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# `use-homepage-and-url`

> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration file enables this rule.
> ✅ The "extends": "plugin:userscripts/recommended" property in a configuration
> file enables this rule.
> 🔧 The `--fix` option on the command line can automatically fix some of the problems reported by this rule.
<!-- markdownlint-disable-next-line MD033 -->

The `use-homepage-and-url` rule verifies that if the `homepage` attribute is present then the `homepageURL` attribute is too and vice versa.
> 🔧 The `--fix` option on the command line can automatically fix some of the
> problems reported by this rule.
The `use-homepage-and-url` rule verifies that if the `homepage` attribute is
present then the `homepageURL` attribute is too and vice versa.

## Why?

Expand Down Expand Up @@ -35,4 +40,5 @@ For compatibility with different userscript runners.

## When Not to Use It

When you are sure that the userscript runner that you and your users use is compatible with your choice.
When you are sure that the userscript runner that you and your users use is
compatible with your choice.

0 comments on commit c98502d

Please sign in to comment.