Skip to content

Commit

Permalink
Remove references to fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Sutton committed Nov 23, 2019
1 parent 01238e9 commit 333ab65
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions lib/rules/sort-prop-types.js
Expand Up @@ -8,7 +8,6 @@ const variableUtil = require('../util/variable');
const propsUtil = require('../util/props');
const docsUrl = require('../util/docsUrl');
const propWrapperUtil = require('../util/propWrapper');
const propTypesSortUtil = require('../util/propTypesSort');

// ------------------------------------------------------------------------------
// Rule Definition
Expand Down Expand Up @@ -96,18 +95,6 @@ module.exports = {
return;
}

function fix(fixer) {
return propTypesSortUtil.fixPropTypesSort(
fixer,
context,
declarations,
ignoreCase,
requiredFirst,
callbacksLast,
sortShapeProp
);
}

declarations.reduce((prev, curr, idx, decls) => {
if (curr.type === 'ExperimentalSpreadProperty' || curr.type === 'SpreadElement') {
return decls[idx + 1];
Expand All @@ -134,8 +121,7 @@ module.exports = {
// Encountered a non-required prop after a required prop
context.report({
node: curr,
message: 'Required prop types must be listed before all other prop types',
fix
message: 'Required prop types must be listed before all other prop types'
});
return curr;
}
Expand All @@ -150,8 +136,7 @@ module.exports = {
// Encountered a non-callback prop after a callback prop
context.report({
node: prev,
message: 'Callback prop types must be listed after all other prop types',
fix
message: 'Callback prop types must be listed after all other prop types'
});
return prev;
}
Expand All @@ -160,8 +145,7 @@ module.exports = {
if (!noSortAlphabetically && currentPropName < prevPropName) {
context.report({
node: curr,
message: 'Prop types declarations should be sorted alphabetically',
fix
message: 'Prop types declarations should be sorted alphabetically'
});
return prev;
}
Expand Down

0 comments on commit 333ab65

Please sign in to comment.