File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,10 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
3333* [ Docs] [ ` jsx-boolean-value ` ] : add jsdoc types for helper functions ([ #3344 ] [ ] @caroline223 )
3434* [ readme] remove dead codeclimate badge, add actions badge (@ljharb )
3535* [ readme] Remove dead david-dm badge ([ #3262 ] [ ] @ddzz )
36+ * [ Refactor] [ ` jsx-closing-bracket-location ` ] , [ ` jsx-no-bind ` ] : fix eslint issues ([ #3351 ] [ ] @caroline223 )
3637
3738[ #3353 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3353
39+ [ #3351 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3351
3840[ #3350 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3350
3941[ #3349 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3349
4042[ #3347 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3347
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ module.exports = {
165165 * @return {String } The characters used for indentation
166166 */
167167 function getIndentation ( tokens , expectedLocation , correctColumn ) {
168- correctColumn = correctColumn || 0 ;
168+ const newColumn = correctColumn || 0 ;
169169 let indentation ;
170170 let spaces = [ ] ;
171171 switch ( expectedLocation ) {
@@ -179,7 +179,7 @@ module.exports = {
179179 default :
180180 indentation = '' ;
181181 }
182- if ( indentation . length + 1 < correctColumn ) {
182+ if ( indentation . length + 1 < newColumn ) {
183183 // Non-whitespace characters were included in the column offset
184184 spaces = new Array ( + correctColumn + 1 - indentation . length ) ;
185185 }
Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ module.exports = {
6969 // bind expression or an arrow function in different block statements
7070 const blockVariableNameSets = { } ;
7171
72+ /**
73+ * @param {string | number } blockStart
74+ */
7275 function setBlockVariableNameSet ( blockStart ) {
7376 blockVariableNameSets [ blockStart ] = {
7477 arrowFunc : new Set ( ) ,
@@ -80,7 +83,6 @@ module.exports = {
8083
8184 function getNodeViolationType ( node ) {
8285 const nodeType = node . type ;
83-
8486 if (
8587 ! configuration . allowBind
8688 && nodeType === 'CallExpression'
@@ -111,6 +113,11 @@ module.exports = {
111113 return null ;
112114 }
113115
116+ /**
117+ * @param {string | number } violationType
118+ * @param {any } variableName
119+ * @param {string | number } blockStart
120+ */
114121 function addVariableNameToSet ( violationType , variableName , blockStart ) {
115122 blockVariableNameSets [ blockStart ] [ violationType ] . add ( variableName ) ;
116123 }
You can’t perform that action at this time.
0 commit comments