8000 [Docs] Add markdownlint for documentation formatting consistency · jsx-eslint/eslint-plugin-react@ae34341 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae34341

Browse files
bmishljharb
authored andcommitted
[Docs] Add markdownlint for documentation formatting consistency
1 parent 11306e1 commit ae34341

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+215
-180
lines changed

.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"line-length": false,
3+
"no-inline-html": false,
4+
"no-hard-tabs": { "spaces_per_tab": 2 },
5+
"ul-style": { "style": "dash" }
6+
}

.markdownlintignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CHANGELOG.md
2+
LICENSE
3+
node_modules

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
4040
* [Docs] Consistent rule descriptions and doc sections ([#3361][] @bmish)
4141
* [Docs] Standardize deprecated rule notice ([#3364][] @bmish)
4242
* [Docs] Fix typos ([#3366][] @bmish)
43+
* [Docs] Add markdownlint for documentation formatting consistency ([#3367][] @bmish)
4344

45+
[#3367]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3367
4446
[#3366]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3366
4547
[#3365]: https://github.com/jsx-eslint/eslint-pl 10000 ugin-react/pull/3365
4648
[#3364]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3364

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# `eslint-plugin-react` <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2+
23
===================
34

45
[![github actions][actions-image]][actions-url]
@@ -8,16 +9,15 @@
89

910
React specific linting rules for `eslint`
1011

11-
# Installation
12+
## Installation
1213

1314
```sh
14-
$ npm install eslint eslint-plugin-react --save-dev
15+
npm install eslint eslint-plugin-react --save-dev
1516
```
1617

1718
It is also possible to install ESLint globally rather than locally (using npm install eslint --global). However, this is not recommended, and any plugins or shareable configs that you use must be installed locally in either case.
1819

19-
# Configuration
20-
20+
## Configuration
2121

2222
Use [our preset](#recommended) to get reasonable defaults:
2323

@@ -109,7 +109,7 @@ Enable the rules that you would like to use.
109109
}
110110
```
111111

112-
# List of supported rules
112+
## List of supported rules
113113

114114
✔: Enabled in the [`recommended`](#recommended) configuration.\
115115
🔧: Fixable with [`eslint --fix`](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems).\
@@ -179,7 +179,7 @@ Enable the rules that you would like to use.
179179
| | | | [react/void-dom-elements-no-children](docs/rules/void-dom-elements-no-children.md) | Disallow void DOM elements (e.g. `<img />`, `<br />`) from receiving children |
180180
<!-- AUTO-GENERATED-CONTENT:END -->
181181

182-
## JSX-specific rules
182+
### JSX-specific rules
183183

184184
<!-- AUTO-GENERATED-CONTENT:START (JSX_RULES) -->
185185
|| 🔧 | 💡 | Rule | Description |
@@ -225,15 +225,15 @@ Enable the rules that you would like to use.
225225
| | 🔧 | | [react/jsx-wrap-multilines](docs/rules/jsx-wrap-multilines.md) | Disallow missing parentheses around multiline JSX |
226226
<!-- AUTO-GENERATED-CONTENT:END -->
227227

228-
## Other useful plugins
228+
### Other useful plugins
229229

230230
- Rules of Hooks: [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks)
231231
- JSX accessibility: [eslint-plugin-jsx-a11y](https://github.com/evcohen/eslint-plugin-jsx-a11y)
232232
- React Native: [eslint-plugin-react-native](https://github.com/Intellicode/eslint-plugin-react-native)
233233

234-
# Shareable configurations
234+
## Shareable configurations
235235

236-
## Recommended
236+
### Recommended
237237

238238
This plugin exports a `recommended` configuration that enforces React good practices.
239239

@@ -247,7 +247,7 @@ To enable this configuration use the `extends` property in your `.eslintrc` conf
247247

248248
See [`eslint` documentation](https://eslint.org/docs/user-guide/configuring/configuration-files#extending-configuration-files) for more information about extending configuration files.
249249

250-
## All
250+
### All
251251

252252
This plugin also exports an `all` configuration that includes every available rule.
253253
This pairs well with the `eslint:all` rule.
@@ -263,11 +263,10 @@ This pairs well with the `eslint:all` rule.
263263

264264
**Note**: These configurations will import `eslint-plugin-react` and enable JSX in [parser options](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options).
265265

266-
# License
266+
## License
267267

268268
`eslint-plugin-react` is licensed under the [MIT License](https://opensource.org/licenses/mit-license.php).
269269

270-
271270
[npm-url]: https://npmjs.org/package/eslint-plugin-react
272271
[npm-image]: https://img.shields.io/npm/v/eslint-plugin-react.svg
273272

SECURITY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ This is the list of versions of `eslint-plugin-react` which are currently being
99
| 7.x | :white_check_mark: |
1010
| < 7.x | :x: |
1111

12-
1312
## Reporting a Vulnerability
1413

1514
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

docs/rules/boolean-prop-naming.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ var Hello = createReactClass({
3636
render: function() { return <div />; };
3737
});
3838
```
39+
3940
```jsx
4041
type Props = {
4142
isEnabled: boolean
@@ -94,8 +95,8 @@ The custom message to display upon failure to match the rule. This overrides the
9495

9596
If you choose to use a custom message, you have access to two template variables.
9697

97-
* `propName` – the name of the prop that does not match the pattern
98-
* `pattern` – the pattern against which all prop names are tested
98+
- `propName` – the name of the prop that does not match the pattern
99+
- `pattern` – the pattern against which all prop names are tested
99100

100101
For example, if a prop is named `something`, and if the rule's pattern is set to `"^(is|has)[A-Z]([A-Za-z0-9]?)+"`, you could set the custom message as follows:
101102

@@ -105,7 +106,7 @@ message: 'It is better if your prop ({{ propName }}) matches this pattern: ({{ p
105106

106107
And the failure would look like so:
107108

108-
```
109+
```plaintext
109110
It is better if your prop (something) matches this pattern: (^is[A-Z]([A-Za-z0-9]?)+)
110111
```
111112

docs/rules/default-props-match-prop-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ If you don't care about stray `defaultsProps` in your components, you can disabl
192192

193193
- [require-default-props](./require-default-props.md)
194194

195-
# Resources
195+
## Resources
196196

197197
- [Official React documentation on defaultProps](https://facebook.github.io/react/docs/typechecking-with-proptypes.html#default-prop-values)
198198

docs/rules/destructuring-assignment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.
44

55
Rule can be set to either of `always` or `never`;
6+
67
```js
78
"react/destructuring-assignment": [<enabled>, 'always']
89
```

docs/rules/display-name.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ For this rule to work we need to detect React components, this could be very har
130130

131131
For now we should detect components created with:
132132

133-
* `createReactClass()`
134-
* an ES6 class that inherit from `React.Component` or `Component`
135-
* a stateless function that return JSX or the result of a `React.createElement` call.
133+
- `createReactClass()`
134+
- an ES6 class that inherit from `React.Component` or `Component`
135+
- a stateless function that return JSX or the result of a `React.createElement` call.

docs/rules/forbid-elements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ This rule checks all JSX elements and `React.createElement` calls and verifies t
1818

1919
An array of strings and/or objects. An object in this array may have the following properties:
2020

21-
* `element` (required): the name of the forbidden element (e.g. `'button'`, `'Modal'`)
22-
* `message`: additional message that gets reported
21+
- `element` (required): the name of the forbidden element (e.g. `'button'`, `'Modal'`)
22+
- `message`: additional message that gets reported
2323

2424
A string item in the array is a shorthand for `{ element: string }`.
2525

0 commit comments

Comments
 (0)
0