@graphql-eslint/eslint-plugin 2.3.2-alpha-6695e95.0 → 2.3.2-alpha-5f59ef8.0
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.
- package/index.js +9 -12
- package/index.mjs +9 -12
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1126,7 +1126,7 @@ const rule$5 = {
|
|
1126
1126
|
'[description.type="StringValue"]': node => {
|
1127
1127
|
if (node.description.block !== (style === 'block')) {
|
1128
1128
|
context.report({
|
1129
|
-
|
1129
|
+
loc: getLocation(node.description.loc),
|
1130
1130
|
message: `Unexpected ${wrongDescriptionType} description`,
|
1131
1131
|
});
|
1132
1132
|
}
|
@@ -2415,10 +2415,10 @@ const rule$g = {
|
|
2415
2415
|
],
|
2416
2416
|
},
|
2417
2417
|
messages: {
|
2418
|
-
[MESSAGE_REQUIRE_DATE]: 'Directive "@deprecated" must have a deletion date',
|
2419
|
-
[MESSAGE_INVALID_FORMAT]: 'Deletion date must be in format "DD/MM/YYYY"',
|
2420
|
-
[MESSAGE_INVALID_DATE]: 'Invalid "{{ deletionDate }}" deletion date',
|
2421
|
-
[MESSAGE_CAN_BE_REMOVED]: '"{{ nodeName }}" сan be removed',
|
2418
|
+
[MESSAGE_REQUIRE_DATE]: 'Directive "@deprecated" must have a deletion date.',
|
2419
|
+
[MESSAGE_INVALID_FORMAT]: 'Deletion date must be in format "DD/MM/YYYY".',
|
2420
|
+
[MESSAGE_INVALID_DATE]: 'Invalid "{{ deletionDate }}" deletion date.',
|
2421
|
+
[MESSAGE_CAN_BE_REMOVED]: '"{{ nodeName }}" сan be removed.',
|
2422
2422
|
},
|
2423
2423
|
schema: [
|
2424
2424
|
{
|
@@ -2439,16 +2439,13 @@ const rule$g = {
|
|
2439
2439
|
const argName = ((_a = context.options[0]) === null || _a === void 0 ? void 0 : _a.argumentName) || 'deletionDate';
|
2440
2440
|
const deletionDateNode = node.arguments.find(arg => arg.name.value === argName);
|
2441
2441
|
if (!deletionDateNode) {
|
2442
|
-
context.report({
|
2443
|
-
loc: getLocation(node.loc, node.name.value, { offsetEnd: 0 }),
|
2444
|
-
messageId: MESSAGE_REQUIRE_DATE,
|
2445
|
-
});
|
2442
|
+
context.report({ node: node.name, messageId: MESSAGE_REQUIRE_DATE });
|
2446
2443
|
return;
|
2447
2444
|
}
|
2448
2445
|
const deletionDate = valueFromNode(deletionDateNode.value);
|
2449
2446
|
const isValidDate = DATE_REGEX.test(deletionDate);
|
2450
2447
|
if (!isValidDate) {
|
2451
|
-
context.report({ node:
|
2448
|
+
context.report({ node: node.name, messageId: MESSAGE_INVALID_FORMAT });
|
2452
2449
|
return;
|
2453
2450
|
}
|
2454
2451
|
let [day, month, year] = deletionDate.split('/');
|
@@ -2457,7 +2454,7 @@ const rule$g = {
|
|
2457
2454
|
const deletionDateInMS = Date.parse(`${year}-${month}-${day}`);
|
2458
2455
|
if (Number.isNaN(deletionDateInMS)) {
|
2459
2456
|
context.report({
|
2460
|
-
node:
|
2457
|
+
node: node.name,
|
2461
2458
|
messageId: MESSAGE_INVALID_DATE,
|
2462
2459
|
data: {
|
2463
2460
|
deletionDate,
|
@@ -2468,7 +2465,7 @@ const rule$g = {
|
|
2468
2465
|
const canRemove = Date.now() > deletionDateInMS;
|
2469
2466
|
if (canRemove) {
|
2470
2467
|
context.report({
|
2471
|
-
node,
|
2468
|
+
node: node.name,
|
2472
2469
|
messageId: MESSAGE_CAN_BE_REMOVED,
|
2473
2470
|
data: {
|
2474
2471
|
nodeName: node.parent.name.value,
|
package/index.mjs
CHANGED
@@ -1120,7 +1120,7 @@ const rule$5 = {
|
|
1120
1120
|
'[description.type="StringValue"]': node => {
|
1121
1121
|
if (node.description.block !== (style === 'block')) {
|
1122
1122
|
context.report({
|
1123
|
-
|
1123
|
+
loc: getLocation(node.description.loc),
|
1124
1124
|
message: `Unexpected ${wrongDescriptionType} description`,
|
1125
1125
|
});
|
1126
1126
|
}
|
@@ -2409,10 +2409,10 @@ const rule$g = {
|
|
2409
2409
|
],
|
2410
2410
|
},
|
2411
2411
|
messages: {
|
2412
|
-
[MESSAGE_REQUIRE_DATE]: 'Directive "@deprecated" must have a deletion date',
|
2413
|
-
[MESSAGE_INVALID_FORMAT]: 'Deletion date must be in format "DD/MM/YYYY"',
|
2414
|
-
[MESSAGE_INVALID_DATE]: 'Invalid "{{ deletionDate }}" deletion date',
|
2415
|
-
[MESSAGE_CAN_BE_REMOVED]: '"{{ nodeName }}" сan be removed',
|
2412
|
+
[MESSAGE_REQUIRE_DATE]: 'Directive "@deprecated" must have a deletion date.',
|
2413
|
+
[MESSAGE_INVALID_FORMAT]: 'Deletion date must be in format "DD/MM/YYYY".',
|
2414
|
+
[MESSAGE_INVALID_DATE]: 'Invalid "{{ deletionDate }}" deletion date.',
|
2415
|
+
[MESSAGE_CAN_BE_REMOVED]: '"{{ nodeName }}" сan be removed.',
|
2416
2416
|
},
|
2417
2417
|
schema: [
|
2418
2418
|
{
|
@@ -2433,16 +2433,13 @@ const rule$g = {
|
|
2433
2433
|
const argName = ((_a = context.options[0]) === null || _a === void 0 ? void 0 : _a.argumentName) || 'deletionDate';
|
2434
2434
|
const deletionDateNode = node.arguments.find(arg => arg.name.value === argName);
|
2435
2435
|
if (!deletionDateNode) {
|
2436
|
-
context.report({
|
2437
|
-
loc: getLocation(node.loc, node.name.value, { offsetEnd: 0 }),
|
2438
|
-
messageId: MESSAGE_REQUIRE_DATE,
|
2439
|
-
});
|
2436
|
+
context.report({ node: node.name, messageId: MESSAGE_REQUIRE_DATE });
|
2440
2437
|
return;
|
2441
2438
|
}
|
2442
2439
|
const deletionDate = valueFromNode(deletionDateNode.value);
|
2443
2440
|
const isValidDate = DATE_REGEX.test(deletionDate);
|
2444
2441
|
if (!isValidDate) {
|
2445
|
-
context.report({ node:
|
2442
|
+
context.report({ node: node.name, messageId: MESSAGE_INVALID_FORMAT });
|
2446
2443
|
return;
|
2447
2444
|
}
|
2448
2445
|
let [day, month, year] = deletionDate.split('/');
|
@@ -2451,7 +2448,7 @@ const rule$g = {
|
|
2451
2448
|
const deletionDateInMS = Date.parse(`${year}-${month}-${day}`);
|
2452
2449
|
if (Number.isNaN(deletionDateInMS)) {
|
2453
2450
|
context.report({
|
2454
|
-
node:
|
2451
|
+
node: node.name,
|
2455
2452
|
messageId: MESSAGE_INVALID_DATE,
|
2456
2453
|
data: {
|
2457
2454
|
deletionDate,
|
@@ -2462,7 +2459,7 @@ const rule$g = {
|
|
2462
2459
|
const canRemove = Date.now() > deletionDateInMS;
|
2463
2460
|
if (canRemove) {
|
2464
2461
|
context.report({
|
2465
|
-
node,
|
2462
|
+
node: node.name,
|
2466
2463
|
messageId: MESSAGE_CAN_BE_REMOVED,
|
2467
2464
|
data: {
|
2468
2465
|
nodeName: node.parent.name.value,
|
package/package.json
CHANGED