We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5680a2b commit 7bf5911Copy full SHA for 7bf5911
lib/rules/sort-prop-types.js
@@ -57,9 +57,10 @@ module.exports = {
57
const propWrapperFunctions = new Set(context.settings.propWrapperFunctions || []);
58
59
function getKey(node) {
60
- const key = sourceCode.getText(node.key || node.argument);
61
- const hasLeadingQuote = /['"]/.test(key[0]);
62
- return hasLeadingQuote ? key.substring(1, key.length - 1) : key;
+ if (node.key && node.key.value) {
+ return node.key.value;
+ }
63
+ return sourceCode.getText(node.key || node.argument);
64
}
65
66
function getValueName(node) {
0 commit comments