@graphql-eslint/eslint-plugin 3.14.0-alpha-20221220160018-ba4832c → 3.14.0-alpha-20221220171818-aa4bda7

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -1353,6 +1353,7 @@ const schema$4 = {
1353
1353
  properties: {
1354
1354
  style: { enum: CASE_STYLES },
1355
1355
  suffix: { type: 'string' },
1356
+ prefix: { type: 'string' },
1356
1357
  },
1357
1358
  },
1358
1359
  },
@@ -1447,6 +1448,26 @@ const rule$4 = {
1447
1448
  fullName
1448
1449
  }
1449
1450
  }
1451
+ `,
1452
+ },
1453
+ {
1454
+ title: 'Correct',
1455
+ usage: [{ fragment: { style: 'kebab-case', prefix: 'mutation.' } }],
1456
+ code: /* GraphQL */ `
1457
+ # mutation.add-alert.graphql
1458
+ mutation addAlert {
1459
+ foo
1460
+ }
1461
+ `,
1462
+ },
1463
+ {
1464
+ title: 'Correct',
1465
+ usage: [{ fragment: { prefix: 'query.' } }],
1466
+ code: /* GraphQL */ `
1467
+ # query.me.graphql
1468
+ query me {
1469
+ foo
1470
+ }
1450
1471
  `,
1451
1472
  },
1452
1473
  ],
@@ -1510,13 +1531,13 @@ const rule$4 = {
1510
1531
  option = { style: option };
1511
1532
  }
1512
1533
  const expectedExtension = options.fileExtension || fileExtension;
1513
- let expectedFilename;
1534
+ let expectedFilename = option.prefix || '';
1514
1535
  if (option.style) {
1515
- expectedFilename =
1536
+ expectedFilename +=
1516
1537
  option.style === 'matchDocumentStyle' ? docName : convertCase(option.style, docName);
1517
1538
  }
1518
1539
  else {
1519
- expectedFilename = filename;
1540
+ expectedFilename += filename;
1520
1541
  }
1521
1542
  expectedFilename += (option.suffix || '') + expectedExtension;
1522
1543
  const filenameWithExtension = filename + expectedExtension;
package/index.mjs CHANGED
@@ -1347,6 +1347,7 @@ const schema$4 = {
1347
1347
  properties: {
1348
1348
  style: { enum: CASE_STYLES },
1349
1349
  suffix: { type: 'string' },
1350
+ prefix: { type: 'string' },
1350
1351
  },
1351
1352
  },
1352
1353
  },
@@ -1441,6 +1442,26 @@ const rule$4 = {
1441
1442
  fullName
1442
1443
  }
1443
1444
  }
1445
+ `,
1446
+ },
1447
+ {
1448
+ title: 'Correct',
1449
+ usage: [{ fragment: { style: 'kebab-case', prefix: 'mutation.' } }],
1450
+ code: /* GraphQL */ `
1451
+ # mutation.add-alert.graphql
1452
+ mutation addAlert {
1453
+ foo
1454
+ }
1455
+ `,
1456
+ },
1457
+ {
1458
+ title: 'Correct',
1459
+ usage: [{ fragment: { prefix: 'query.' } }],
1460
+ code: /* GraphQL */ `
1461
+ # query.me.graphql
1462
+ query me {
1463
+ foo
1464
+ }
1444
1465
  `,
1445
1466
  },
1446
1467
  ],
@@ -1504,13 +1525,13 @@ const rule$4 = {
1504
1525
  option = { style: option };
1505
1526
  }
1506
1527
  const expectedExtension = options.fileExtension || fileExtension;
1507
- let expectedFilename;
1528
+ let expectedFilename = option.prefix || '';
1508
1529
  if (option.style) {
1509
- expectedFilename =
1530
+ expectedFilename +=
1510
1531
  option.style === 'matchDocumentStyle' ? docName : convertCase(option.style, docName);
1511
1532
  }
1512
1533
  else {
1513
- expectedFilename = filename;
1534
+ expectedFilename += filename;
1514
1535
  }
1515
1536
  expectedFilename += (option.suffix || '') + expectedExtension;
1516
1537
  const filenameWithExtension = filename + expectedExtension;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-eslint/eslint-plugin",
3
- "version": "3.14.0-alpha-20221220160018-ba4832c",
3
+ "version": "3.14.0-alpha-20221220171818-aa4bda7",
4
4
  "description": "GraphQL plugin for ESLint",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
package/rules/index.d.ts CHANGED
@@ -23,18 +23,22 @@ export declare const rules: {
23
23
  fragment?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle"> | {
24
24
  style?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle">;
25
25
  suffix?: string;
26
+ prefix?: string;
26
27
  };
27
28
  query?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle"> | {
28
29
  style?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle">;
29
30
  suffix?: string;
31
+ prefix?: string;
30
32
  };
31
33
  mutation?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle"> | {
32
34
  style?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle">;
33
35
  suffix?: string;
36
+ prefix?: string;
34
37
  };
35
38
  subscription?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle"> | {
36
39
  style?: import("json-schema-to-ts/lib/types/type-utils").Writable<import("../utils").CaseStyle | "matchDocumentStyle">;
37
40
  suffix?: string;
41
+ prefix?: string;
38
42
  };
39
43
  fileExtension?: ".gql" | ".graphql";
40
44
  }[], false>;
@@ -19,6 +19,9 @@ declare const schema: {
19
19
  readonly suffix: {
20
20
  readonly type: "string";
21
21
  };
22
+ readonly prefix: {
23
+ readonly type: "string";
24
+ };
22
25
  };
23
26
  };
24
27
  };