@graphql-eslint/eslint-plugin 3.14.4-alpha-20230112071107-2ccb1e4 → 3.14.4-alpha-20230112202239-7d30366

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ function convertToken(token, type) {
18
18
  const { line, column, end, start, value } = token;
19
19
  return {
20
20
  type,
21
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
21
22
  value: value,
22
23
  /*
23
24
  * ESLint has 0-based column number
@@ -73,7 +74,7 @@ function extractComments(loc) {
73
74
  if (token.kind === graphql_1.TokenKind.COMMENT) {
74
75
  const comment = convertToken(token,
75
76
  // `eslint-disable` directive works only with `Block` type comment
76
- // TODO: remove `!` when drop support of graphql@15
77
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
77
78
  token.value.trimStart().startsWith('eslint') ? 'Block' : 'Line');
78
79
  comments.push(comment);
79
80
  }
@@ -62,7 +62,7 @@ exports.rule = {
62
62
  while (token) {
63
63
  const { kind, prev, next, value, line, column } = token;
64
64
  if (kind === graphql_1.TokenKind.COMMENT && prev && next) {
65
- // TODO: remove `!` when drop support of graphql@15
65
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
66
66
  const isEslintComment = value.trimStart().startsWith('eslint');
67
67
  const linesAfter = next.line - line;
68
68
  if (!isEslintComment &&
@@ -78,7 +78,7 @@ exports.rule = {
78
78
  suggest: ['"""', '"'].map(descriptionSyntax => ({
79
79
  desc: `Replace with \`${descriptionSyntax}\` description syntax`,
80
80
  fix: fixer => fixer.replaceTextRange([token.start, token.end],
81
- // TODO: remove `!` when drop support of graphql@15
81
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
82
82
  [descriptionSyntax, value.trim(), descriptionSyntax].join('')),
83
83
  })),
84
84
  });
@@ -168,7 +168,8 @@ exports.rule = {
168
168
  const rawNode = node.rawNode();
169
169
  const { prev, line } = rawNode.loc.startToken;
170
170
  if ((prev === null || prev === void 0 ? void 0 : prev.kind) === graphql_1.TokenKind.COMMENT) {
171
- const value = prev.value.trim(); // TODO: remove `!` when drop support of graphql@15
171
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
172
+ const value = prev.value.trim();
172
173
  const linesBefore = line - prev.line;
173
174
  if (!value.startsWith('eslint') && linesBefore === 1) {
174
175
  description = value;
@@ -15,6 +15,7 @@ export function convertToken(token, type) {
15
15
  const { line, column, end, start, value } = token;
16
16
  return {
17
17
  type,
18
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
18
19
  value: value,
19
20
  /*
20
21
  * ESLint has 0-based column number
@@ -68,7 +69,7 @@ export function extractComments(loc) {
68
69
  if (token.kind === TokenKind.COMMENT) {
69
70
  const comment = convertToken(token,
70
71
  // `eslint-disable` directive works only with `Block` type comment
71
- // TODO: remove `!` when drop support of graphql@15
72
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
72
73
  token.value.trimStart().startsWith('eslint') ? 'Block' : 'Line');
73
74
  comments.push(comment);
74
75
  }
@@ -59,7 +59,7 @@ export const rule = {
59
59
  while (token) {
60
60
  const { kind, prev, next, value, line, column } = token;
61
61
  if (kind === TokenKind.COMMENT && prev && next) {
62
- // TODO: remove `!` when drop support of graphql@15
62
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
63
63
  const isEslintComment = value.trimStart().startsWith('eslint');
64
64
  const linesAfter = next.line - line;
65
65
  if (!isEslintComment &&
@@ -75,7 +75,7 @@ export const rule = {
75
75
  suggest: ['"""', '"'].map(descriptionSyntax => ({
76
76
  desc: `Replace with \`${descriptionSyntax}\` description syntax`,
77
77
  fix: fixer => fixer.replaceTextRange([token.start, token.end],
78
- // TODO: remove `!` when drop support of graphql@15
78
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
79
79
  [descriptionSyntax, value.trim(), descriptionSyntax].join('')),
80
80
  })),
81
81
  });
@@ -165,7 +165,8 @@ export const rule = {
165
165
  const rawNode = node.rawNode();
166
166
  const { prev, line } = rawNode.loc.startToken;
167
167
  if ((prev === null || prev === void 0 ? void 0 : prev.kind) === TokenKind.COMMENT) {
168
- const value = prev.value.trim(); // TODO: remove `!` when drop support of graphql@15
168
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion -- TODO: remove `!` when drop support of graphql@15
169
+ const value = prev.value.trim();
169
170
  const linesBefore = line - prev.line;
170
171
  if (!value.startsWith('eslint') && linesBefore === 1) {
171
172
  description = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "3.14.4-alpha-20230112071107-2ccb1e4",
3
+ "version": "3.14.4-alpha-20230112202239-7d30366",
4
4
  "description": "GraphQL plugin for ESLint",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {