6
6
'use strict' ;
7
7
8
8
const propName = require ( 'jsx-ast-utils/propName' ) ;
9
- //const astUtils = require(".node_modules\eslint\lib\rules\utils\ast-utils.js");
10
9
const includes = require ( 'array-includes' ) ;
11
10
const docsUrl = require ( '../util/docsUrl' ) ;
12
11
const jsxUtil = require ( '../util/jsx' ) ;
@@ -29,7 +28,7 @@ const messages = {
29
28
listIsEmpty : 'A customized reserved first list must not be empty' ,
30
29
listReservedPropsFirst : 'Reserved props must be listed before all other props' ,
31
30
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' ,
33
32
listShorthandLast : 'Shorthand props must be listed after all other props' ,
34
33
listMultilineFirst : 'Multiline props must be listed before all other props' ,
35
34
listMultilineLast : 'Multiline props must be listed after all other props' ,
@@ -236,7 +235,7 @@ const generateFixerFunction = (node, context, reservedList) => {
236
235
const sortableAttributeGroups = getGroupsOfSortableAttributes ( attributes , context ) ;
237
236
const sortedAttributeGroups = sortableAttributeGroups
238
237
. 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 ) ) ) ;
240
239
241
240
return function fixFunction ( fixer ) {
242
241
const fixers = [ ] ;
@@ -257,7 +256,7 @@ const generateFixerFunction = (node, context, reservedList) => {
257
256
fixers . sort ( ( a , b ) => b . range [ 0 ] - a . range [ 0 ] ) ;
258
257
259
258
const rangeStart = fixers [ fixers . length - 1 ] . range [ 0 ] ;
260
- const rangeEnd = fixers [ 0 ] . range [ 1 ] ;
259
+ const rangeEnd = fixers [ 0 ] . range [ 1 ] ;
261
260
262
261
fixers . forEach ( ( fix ) => {
263
262
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
329
328
report ( context , messages [ errorType ] , errorType , {
330
329
node : nodeAttribute . name ,
331
330
fix : generateFixerFunction ( node , context , reservedList ) ,
332
-
333
331
} ) ;
334
332
}
335
333
0 commit comments