66'use strict' ;
77
88const propName = require ( 'jsx-ast-utils/propName' ) ;
9- //const astUtils = require(".node_modules\eslint\lib\rules\utils\ast-utils.js");
109const includes = require ( 'array-includes' ) ;
1110const docsUrl = require ( '../util/docsUrl' ) ;
1211const jsxUtil = require ( '../util/jsx' ) ;
@@ -29,7 +28,7 @@ const messages = {
2928 listIsEmpty : 'A customized reserved first list must not be empty' ,
3029 listReservedPropsFirst : 'Reserved props must be listed before all other props' ,
3130 listCallbacksLast : 'Callbacks must be listed after all other props' ,
32- listShorthandFirst : 'S horthand props must be listed before all other props' ,
31+ listShorthandFirst : 'Shorthand props must be listed before all other props' ,
3332 listShorthandLast : 'Shorthand props must be listed after all other props' ,
3433 listMultilineFirst : 'Multiline props must be listed before all other props' ,
3534 listMultilineLast : 'Multiline props must be listed after all other props' ,
@@ -236,7 +235,7 @@ const generateFixerFunction = (node, context, reservedList) => {
236235 const sortableAttributeGroups = getGroupsOfSortableAttributes ( attributes , context ) ;
237236 const sortedAttributeGroups = sortableAttributeGroups
238237 . slice ( 0 )
239- . map ( ( group ) => group . slice ( 0 ) . sort ( ( a , b ) => contextCompare ( a , b , options ) ) ) ;
238+ . map ( ( group ) => group . slice ( 0 ) . sort ( ( a , b ) => contextCompare ( a , b , options ) ) ) ;
240239
241240 return function fixFunction ( fixer ) {
242241 const fixers = [ ] ;
@@ -257,7 +256,7 @@ const generateFixerFunction = (node, context, reservedList) => {
257256 fixers . sort ( ( a , b ) => b . range [ 0 ] - a . range [ 0 ] ) ;
258257
259258 const rangeStart = fixers [ fixers . length - 1 ] . range [ 0 ] ;
260- const rangeEnd = fixers [ 0 ] . range [ 1 ] ;
259+ const rangeEnd = fixers [ 0 ] . range [ 1 ] ;
261260
262261 fixers . forEach ( ( fix ) => {
263262 source = `${ source . substr ( 0 , fix . range [ 0 ] ) } ${ fix . text } ${ source . substr ( fix . range [ 1 ] ) } ` ;
@@ -329,7 +328,6 @@ function reportNodeAttribute(nodeAttribute, errorType, node, context, reservedLi
329328 report ( context , messages [ errorType ] , errorType , {
330329 node : nodeAttribute . name ,
331330 fix : generateFixerFunction ( node , context , reservedList ) ,
332-
333331 } ) ;
334332}
335333
0 commit comments