Skip to content

Commit 8b9beb1

Browse files
kassenstyao1
authored andcommitted
Remove RelayCompat support
The `graphql_DEPRECATED` tag was used for RelayCompat which was long deleted in OSS as well as internally. Cleans up a bit of code from the linter.
1 parent a15ccaa commit 8b9beb1

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

src/rule-graphql-naming.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const getLoc = utils.getLoc;
1313
const getModuleName = utils.getModuleName;
1414
const getRange = utils.getRange;
1515
const isGraphQLTag = utils.isGraphQLTag;
16-
const isGraphQLDeprecatedTag = utils.isGraphQLDeprecatedTag;
1716
const shouldLint = utils.shouldLint;
1817

1918
const CREATE_CONTAINER_FUNCTIONS = new Set([
@@ -148,10 +147,7 @@ module.exports = {
148147
property.computed === false &&
149148
property.value.type === 'TaggedTemplateExpression'
150149
) {
151-
if (
152-
!isGraphQLTag(property.value.tag) &&
153-
!isGraphQLDeprecatedTag(property.value.tag)
154-
) {
150+
if (!isGraphQLTag(property.value.tag)) {
155151
context.report({
156152
node: property.value.tag,
157153
message:

src/utils.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,6 @@ function isGraphQLTag(tag) {
104104
return tag.type === 'Identifier' && tag.name === 'graphql';
105105
}
106106

107-
function isGraphQLDeprecatedTag(tag) {
108-
return tag.type === 'Identifier' && tag.name === 'graphql_DEPRECATED';
109-
}
110-
111107
function shouldLint(context) {
112108
return /graphql|relay/i.test(context.getSourceCode().text);
113109
}
@@ -126,6 +122,5 @@ module.exports = {
126122
getRange: getRange,
127123
hasPrecedingEslintDisableComment: hasPrecedingEslintDisableComment,
128124
isGraphQLTag: isGraphQLTag,
129-
isGraphQLDeprecatedTag: isGraphQLDeprecatedTag,
130125
shouldLint: shouldLint
131126
};

test/test.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ const valid = [
4747
code: `createFragmentContainer(Component, {
4848
user: graphql\`fragment MyComponent_user on User {id}\`,
4949
});`
50-
},
51-
{
52-
filename: 'path/to/MyDeprecatedComponent.jsx',
53-
code: `createFragmentContainer(Component, {
54-
user: graphql_DEPRECATED\`fragment MyComponent_user on User {id}\`,
55-
});`
5650
}
5751
];
5852

0 commit comments

Comments
 (0)