Skip to content

Commit 11306e1

Browse files
bmishljharb
authored andcommitted
[Docs] Fix typos
1 parent 9836d3a commit 11306e1

23 files changed

+41
-39
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
3939
* [Docs] document which rules provide suggestions ([#3359][], [#3365][] @bmish)
4040
* [Docs] Consistent rule descriptions and doc sections ([#3361][] @bmish)
4141
* [Docs] Standardize deprecated rule notice ([#3364][] @bmish)
42+
* [Docs] Fix typos ([#3366][] @bmish)
4243

44+
[#3366]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3366
4345
[#3365]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3365
4446
[#3364]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3364
4547
[#3361]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3361

docs/rules/jsx-pascal-case.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Examples of **correct** code for this rule, when `allowLeadingUnderscore` is `tr
7979
</_AllowedComponent>
8080
```
8181

82-
**WARNING:** Adding a leading underscore to the name of a component does **NOT** affect the visibilty or accessibility of that component. Attempting to use leading underscores to enforce privacy of your components is an error.
82+
**WARNING:** Adding a leading underscore to the name of a component does **NOT** affect the visibility or accessibility of that component. Attempting to use leading underscores to enforce privacy of your components is an error.
8383

8484
## When Not To Use It
8585

docs/rules/jsx-props-no-spreading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Examples of **incorrect** code for this rule, when `custom` is set to `ignore`:
6868

6969
### explicitSpread
7070

71-
`explicitSpread` set to `ignore` will ignore spread operators that are explicilty listing all object properties within that spread. Default is set to `enforce`.
71+
`explicitSpread` set to `ignore` will ignore spread operators that are explicitly listing all object properties within that spread. Default is set to `enforce`.
7272

7373
Examples of **correct** code for this rule, when `explicitSpread` is set to `ignore`:
7474

docs/rules/no-arrow-function-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
It is not neccessary to use arrow function for lifecycle methods. This makes things harder to test, conceptually less performant (although in practice, performance will not be affected, since most engines will optimize efficiently), and can break hot reloading patterns.
5+
It is not necessary to use arrow function for lifecycle methods. This makes things harder to test, conceptually less performant (although in practice, performance will not be affected, since most engines will optimize efficiently), and can break hot reloading patterns.
66

77
## Rule Details
88

docs/rules/no-unstable-nested-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Creating components inside components without memoization leads to unstable components. The nested component and all its children are recreated during each re-render. Given stateful children of the nested component will lose their state on each re-render.
44

5-
React reconcilation performs element type comparison with [reference equality](https://github.com/facebook/react/blob/v16.13.1/packages/react-reconciler/src/ReactChildFiber.js#L407). The reference to the same element changes on each re-render when defining components inside the render block. This leads to complete recreation of the current node and all its children. As a result the virtual DOM has to do extra unnecessary work and [possible bugs are introduced](https://codepen.io/ariperkkio/pen/vYLodLB).
5+
React reconciliation performs element type comparison with [reference equality](https://github.com/facebook/react/blob/v16.13.1/packages/react-reconciler/src/ReactChildFiber.js#L407). The reference to the same element changes on each re-render when defining components inside the render block. This leads to complete recreation of the current node and all its children. As a result the virtual DOM has to do extra unnecessary work and [possible bugs are introduced](https://codepen.io/ariperkkio/pen/vYLodLB).
66

77
## Rule Details
88

docs/rules/sort-prop-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Enforce propTypes declarations alphabetical sorting (react/sort-prop-types)
22

3-
Some developers prefer to sort prop type declaratioms alphabetically to be able to find necessary declaration easier at the later time. Others feel that it adds complexity and becomes burden to maintain.
3+
Some developers prefer to sort prop type declarations alphabetically to be able to find necessary declaration easier at the later time. Others feel that it adds complexity and becomes burden to maintain.
44

55
## Rule Details
66

lib/rules/jsx-curly-brace-presence.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ module.exports = {
138138
)).join(HTML_ENTITY);
139139

140140
const htmlEntities = text.match(HTML_ENTITY_REGEX());
141-
return htmlEntities.reduce((acc, htmlEntitiy) => (
142-
acc.replace(HTML_ENTITY, htmlEntitiy)
141+
return htmlEntities.reduce((acc, htmlEntity) => (
142+
acc.replace(HTML_ENTITY, htmlEntity)
143143
), withCurlyBraces);
144144
}
145145

@@ -244,8 +244,8 @@ module.exports = {
244244
}
245245

246246
// Bail out if there is any character that needs to be escaped in JSX
247-
// because escaping decreases readiblity and the original code may be more
248-
// readible anyway or intentional for other specific reasons
247+
// because escaping decreases readability and the original code may be more
248+
// readable anyway or intentional for other specific reasons
249249
function lintUnnecessaryCurly(JSXExpressionNode) {
250250
const expression = JSXExpressionNode.expression;
251251
const expressionType = expression.type;

lib/rules/no-access-state-in-setstate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ module.exports = {
130130
break;
131131
}
132132

133-
// Storing all variables containg this.state
133+
// Storing all variables containing this.state
134134
if (current.type === 'VariableDeclarator') {
135135
vars.push({
136136
node,

lib/rules/no-danger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const DANGEROUS_PROPERTIES = fromEntries(DANGEROUS_PROPERTY_NAMES.map((prop) =>
2929
/**
3030
* Checks if a JSX attribute is dangerous.
3131
* @param {String} name - Name of the attribute to check.
32-
* @returns {boolean} Whether or not the attribute is dnagerous.
32+
* @returns {boolean} Whether or not the attribute is dangerous.
3333
*/
3434
function isDangerous(name) {
3535
return has(DANGEROUS_PROPERTIES, name);

lib/rules/no-direct-mutation-state.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = {
5656
}
5757

5858
/**
59-
* Walks throughs the MemberExpression to the top-most property.
59+
* Walks through the MemberExpression to the top-most property.
6060
* @param {Object} node The node to process
6161
* @returns {Object} The outer-most MemberExpression
6262
*/

0 commit comments

Comments
 (0)