File tree 1 file changed +6
-1
lines changed
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ module.exports = {
34
34
ignoreCase : {
35
35
type : 'boolean'
36
36
} ,
37
+ // Whether alphabetical sorting should be enforced
38
+ noSortAlphabetically : {
39
+ type : 'boolean'
40
+ } ,
37
41
sortShapeProp : {
38
42
type : 'boolean'
39
43
}
@@ -48,6 +52,7 @@ module.exports = {
48
52
const requiredFirst = configuration . requiredFirst || false ;
49
53
const callbacksLast = configuration . callbacksLast || false ;
50
54
const ignoreCase = configuration . ignoreCase || false ;
55
+ const noSortAlphabetically = configuration . noSortAlphabetically || false ;
51
56
const sortShapeProp = configuration . sortShapeProp || false ;
52
57
const propWrapperFunctions = new Set ( context . settings . propWrapperFunctions || [ ] ) ;
53
58
@@ -216,7 +221,7 @@ module.exports = {
216
221
}
217
222
}
218
223
219
- if ( currentPropName < prevPropName ) {
224
+ if ( ! noSortAlphabetically && currentPropName < prevPropName ) {
220
225
context . report ( {
221
226
node : curr ,
222
227
message : 'Prop types declarations should be sorted alphabetically' ,
You can’t perform that action at this time.
0 commit comments