Skip to content

Commit

Permalink
[Refactor] boolean-prop-naming, jsx-indent: avoid assigning to ar…
Browse files Browse the repository at this point in the history
…guments
  • Loading branch information
caroline223 authored and ljharb committed Jun 29, 2022
1 parent 5769b53 commit 5919660
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -16,10 +16,12 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
### Changed
* [Refactor] [`jsx-indent-props`]: improved readability of the checkNodesIndent function ([#3315][] @caroline223)
* [Tests] [`jsx-indent`], [`jsx-one-expression-per-line`]: add passing test cases ([#3314][] @ROSSROSALES)
* [Refactor] `boolean-prop-naming`, `jsx-indent`: avoid assigning to arguments ([#3316][] @caroline223)

[#3321]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3321
[#3320]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3320
[#3317]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3317
[#3316]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3316
[#3315]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3315
[#3314]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3314
[#3311]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3311
Expand Down
4 changes: 1 addition & 3 deletions lib/rules/boolean-prop-naming.js
Expand Up @@ -172,9 +172,7 @@ module.exports = {
* @param {Function} addInvalidProp callback to run for each error
*/
function runCheck(proptypes, addInvalidProp) {
proptypes = proptypes || [];

proptypes.forEach((prop) => {
(proptypes || []).forEach((prop) => {
if (config.validateNested && nestedPropTypes(prop)) {
runCheck(prop.value.arguments[0].properties, addInvalidProp);
return;
Expand Down
3 changes: 0 additions & 3 deletions lib/rules/jsx-indent.js
Expand Up @@ -168,9 +168,6 @@ module.exports = {
* @return {Number} Indent
*/
function getNodeIndent(node, byLastLine, excludeCommas) {
byLastLine = byLastLine || false;
excludeCommas = excludeCommas || false;

let src = context.getSourceCode().getText(node, node.loc.start.column + extraColumnStart);
const lines = src.split('\n');
if (byLastLine) {
Expand Down

0 comments on commit 5919660

Please sign in to comment.