Skip to content

Commit f7447b7

Browse files
committed
chore: use checkTypes as the option name
1 parent 5955ae9 commit f7447b7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/rules/sort-prop-types.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = {
5252
sortShapeProp: {
5353
type: 'boolean',
5454
},
55-
allowTypescript: {
55+
checkTypes: {
5656
type: 'boolean',
5757
},
5858
},
@@ -67,7 +67,7 @@ module.exports = {
6767
const ignoreCase = configuration.ignoreCase || false;
6868
const noSortAlphabetically = configuration.noSortAlphabetically || false;
6969
const sortShapeProp = configuration.sortShapeProp || false;
70-
const allowTypescript = configuration.allowTypescript || false;
70+
const checkTypes = configuration.checkTypes || false;
7171

7272
const typeAnnotations = new Map();
7373

@@ -222,7 +222,7 @@ module.exports = {
222222
}
223223

224224
function handleFunctionComponent(node) {
225-
if (!allowTypescript) {
225+
if (!checkTypes) {
226226
return;
227227
}
228228
const firstArg = node.params[0].typeAnnotation && node.params[0].typeAnnotation.typeAnnotation;

tests/lib/rules/sort-prop-types.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ ruleTester.run('sort-prop-types', rule, {
492492
}
493493
`,
494494
features: ['ts', 'no-babel'],
495-
options: [{ allowTypescript: false }],
495+
options: [{ checkTypes: false }],
496496
}
497497
)),
498498
invalid: parsers.all([].concat(
@@ -2284,7 +2284,7 @@ ruleTester.run('sort-prop-types', rule, {
22842284
}
22852285
`,
22862286
features: ['ts', 'no-babel'],
2287-
options: [{ allowTypescript: true }],
2287+
options: [{ checkTypes: true }],
22882288
errors: [
22892289
{
22902290
messageId: 'propsNotSorted',
@@ -2314,7 +2314,7 @@ ruleTester.run('sort-prop-types', rule, {
23142314
}
23152315
`,
23162316
features: ['ts', 'no-babel'],
2317-
options: [{ allowTypescript: true }],
2317+
options: [{ checkTypes: true }],
23182318
errors: [
23192319
{
23202320
messageId: 'propsNotSorted',
@@ -2342,7 +2342,7 @@ ruleTester.run('sort-prop-types', rule, {
23422342
}
23432343
`,
23442344
features: ['ts', 'no-babel'],
2345-
options: [{ allowTypescript: true }],
2345+
options: [{ checkTypes: true }],
23462346
errors: [
23472347
{
23482348
messageId: 'propsNotSorted',

0 commit comments

Comments
 (0)