File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ module.exports = {
3434 ignoreCase : {
3535 type : 'boolean'
3636 } ,
37+ // Whether alphabetical sorting should be enforced
38+ noSortAlphabetically : {
39+ type : 'boolean'
40+ } ,
3741 sortShapeProp : {
3842 type : 'boolean'
3943 }
@@ -48,6 +52,7 @@ module.exports = {
4852 const requiredFirst = configuration . requiredFirst || false ;
4953 const callbacksLast = configuration . callbacksLast || false ;
5054 const ignoreCase = configuration . ignoreCase || false ;
55+ const noSortAlphabetically = configuration . noSortAlphabetically || false ;
5156 const sortShapeProp = configuration . sortShapeProp || false ;
5257 const propWrapperFunctions = new Set ( context . settings . propWrapperFunctions || [ ] ) ;
5358
@@ -216,7 +221,7 @@ module.exports = {
216221 }
217222 }
218223
219- if ( currentPropName < prevPropName ) {
224+ if ( ! noSortAlphabetically && currentPropName < prevPropName ) {
220225 context . report ( {
221226 node : curr ,
222227 message : 'Prop types declarations should be sorted alphabetically' ,
You can’t perform that action at this time.
0 commit comments