@graphql-eslint/eslint-plugin 4.3.0-alpha-20241205065956-601947f40654914ef0effc1cdf4fe269245fc7bc → 4.3.1-alpha-20241207204625-6a4230707a78900a6339b03afe904b9dd6c31561

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.
Files changed (110) hide show
  1. package/cjs/cache.js +6 -2
  2. package/cjs/configs/operations-all.js +2 -2
  3. package/cjs/configs/schema-all.js +2 -2
  4. package/cjs/configs/schema-recommended.js +1 -1
  5. package/cjs/documents.js +13 -7
  6. package/cjs/estree-converter/converter.js +17 -8
  7. package/cjs/estree-converter/utils.js +22 -9
  8. package/cjs/graphql-config.js +13 -6
  9. package/cjs/index.d.cts +18 -4
  10. package/cjs/meta.js +1 -1
  11. package/cjs/parser.js +36 -9
  12. package/cjs/processor.js +48 -20
  13. package/cjs/rules/alphabetize/index.js +99 -47
  14. package/cjs/rules/description-style/index.js +10 -6
  15. package/cjs/rules/graphql-js-validation.js +142 -108
  16. package/cjs/rules/index.d.cts +18 -4
  17. package/cjs/rules/input-name/index.js +51 -38
  18. package/cjs/rules/lone-executable-definition/index.js +15 -6
  19. package/cjs/rules/match-document-filename/index.d.cts +4 -3
  20. package/cjs/rules/match-document-filename/index.js +63 -37
  21. package/cjs/rules/naming-convention/index.d.cts +6 -10
  22. package/cjs/rules/naming-convention/index.js +146 -57
  23. package/cjs/rules/no-anonymous-operations/index.js +8 -5
  24. package/cjs/rules/no-deprecated/index.js +27 -13
  25. package/cjs/rules/no-duplicate-fields/index.js +15 -8
  26. package/cjs/rules/no-hashtag-description/index.js +18 -10
  27. package/cjs/rules/no-one-place-fragments/index.js +17 -10
  28. package/cjs/rules/no-root-type/index.js +15 -8
  29. package/cjs/rules/no-scalar-result-type-on-mutation/index.js +20 -12
  30. package/cjs/rules/no-typename-prefix/index.js +25 -21
  31. package/cjs/rules/no-unreachable-types/index.js +34 -17
  32. package/cjs/rules/no-unused-fields/index.js +56 -30
  33. package/cjs/rules/relay-arguments/index.js +31 -13
  34. package/cjs/rules/relay-connection-types/index.js +31 -9
  35. package/cjs/rules/relay-edge-types/index.js +84 -41
  36. package/cjs/rules/relay-page-info/index.js +31 -14
  37. package/cjs/rules/require-deprecation-date/index.js +20 -9
  38. package/cjs/rules/require-deprecation-reason/index.js +8 -5
  39. package/cjs/rules/require-description/index.d.cts +79 -13
  40. package/cjs/rules/require-description/index.js +67 -49
  41. package/cjs/rules/require-field-of-type-query-in-mutation-result/index.js +21 -10
  42. package/cjs/rules/require-import-fragment/index.js +20 -11
  43. package/cjs/rules/require-nullable-fields-with-oneof/index.js +12 -5
  44. package/cjs/rules/require-nullable-result-in-root/index.js +32 -27
  45. package/cjs/rules/require-selections/index.js +88 -46
  46. package/cjs/rules/require-type-pattern-with-oneof/index.js +14 -10
  47. package/cjs/rules/selection-set-depth/index.js +19 -10
  48. package/cjs/rules/strict-id-in-types/index.js +32 -19
  49. package/cjs/rules/unique-enum-value-names/index.js +4 -3
  50. package/cjs/rules/unique-fragment-name/index.js +25 -18
  51. package/cjs/rules/unique-operation-name/index.js +5 -5
  52. package/cjs/schema.js +14 -8
  53. package/cjs/siblings.js +60 -32
  54. package/cjs/utils.js +23 -9
  55. package/esm/cache.js +6 -2
  56. package/esm/configs/operations-all.js +2 -2
  57. package/esm/configs/schema-all.js +2 -2
  58. package/esm/configs/schema-recommended.js +1 -1
  59. package/esm/documents.js +13 -7
  60. package/esm/estree-converter/converter.js +17 -8
  61. package/esm/estree-converter/utils.js +22 -9
  62. package/esm/graphql-config.js +13 -6
  63. package/esm/index.d.ts +19 -5
  64. package/esm/meta.js +1 -1
  65. package/esm/parser.js +36 -9
  66. package/esm/processor.js +48 -20
  67. package/esm/rules/alphabetize/index.js +99 -47
  68. package/esm/rules/description-style/index.js +10 -6
  69. package/esm/rules/graphql-js-validation.js +142 -108
  70. package/esm/rules/index.d.ts +19 -5
  71. package/esm/rules/input-name/index.js +51 -38
  72. package/esm/rules/lone-executable-definition/index.js +15 -6
  73. package/esm/rules/match-document-filename/index.d.ts +4 -3
  74. package/esm/rules/match-document-filename/index.js +63 -37
  75. package/esm/rules/naming-convention/index.d.ts +6 -10
  76. package/esm/rules/naming-convention/index.js +146 -57
  77. package/esm/rules/no-anonymous-operations/index.js +8 -5
  78. package/esm/rules/no-deprecated/index.js +27 -13
  79. package/esm/rules/no-duplicate-fields/index.js +15 -8
  80. package/esm/rules/no-hashtag-description/index.js +18 -10
  81. package/esm/rules/no-one-place-fragments/index.js +17 -10
  82. package/esm/rules/no-root-type/index.js +15 -8
  83. package/esm/rules/no-scalar-result-type-on-mutation/index.js +20 -12
  84. package/esm/rules/no-typename-prefix/index.js +25 -21
  85. package/esm/rules/no-unreachable-types/index.js +34 -17
  86. package/esm/rules/no-unused-fields/index.js +56 -30
  87. package/esm/rules/relay-arguments/index.js +31 -13
  88. package/esm/rules/relay-connection-types/index.js +31 -9
  89. package/esm/rules/relay-edge-types/index.js +84 -41
  90. package/esm/rules/relay-page-info/index.js +31 -14
  91. package/esm/rules/require-deprecation-date/index.js +20 -9
  92. package/esm/rules/require-deprecation-reason/index.js +8 -5
  93. package/esm/rules/require-description/index.d.ts +79 -13
  94. package/esm/rules/require-description/index.js +67 -49
  95. package/esm/rules/require-field-of-type-query-in-mutation-result/index.js +21 -10
  96. package/esm/rules/require-import-fragment/index.js +20 -11
  97. package/esm/rules/require-nullable-fields-with-oneof/index.js +12 -5
  98. package/esm/rules/require-nullable-result-in-root/index.js +32 -27
  99. package/esm/rules/require-selections/index.js +88 -46
  100. package/esm/rules/require-type-pattern-with-oneof/index.js +14 -10
  101. package/esm/rules/selection-set-depth/index.js +19 -10
  102. package/esm/rules/strict-id-in-types/index.js +32 -19
  103. package/esm/rules/unique-enum-value-names/index.js +4 -3
  104. package/esm/rules/unique-fragment-name/index.js +25 -18
  105. package/esm/rules/unique-operation-name/index.js +5 -5
  106. package/esm/schema.js +15 -8
  107. package/esm/siblings.js +60 -32
  108. package/esm/utils.js +23 -9
  109. package/index.browser.js +1838 -1135
  110. package/package.json +1 -1
@@ -6,46 +6,49 @@ const schema = {
6
6
  maxItems: 1,
7
7
  items: {
8
8
  type: "object",
9
- additionalProperties: !1,
9
+ additionalProperties: false,
10
10
  properties: {
11
11
  checkInputType: {
12
12
  type: "boolean",
13
- default: !1,
13
+ default: false,
14
14
  description: "Check that the input type name follows the convention \\<mutationName>Input"
15
15
  },
16
16
  caseSensitiveInputType: {
17
17
  type: "boolean",
18
- default: !0,
18
+ default: true,
19
19
  description: "Allow for case discrepancies in the input type name"
20
20
  },
21
21
  checkQueries: {
22
22
  type: "boolean",
23
- default: !1,
23
+ default: false,
24
24
  description: "Apply the rule to Queries"
25
25
  },
26
26
  checkMutations: {
27
27
  type: "boolean",
28
- default: !0,
28
+ default: true,
29
29
  description: "Apply the rule to Mutations"
30
30
  }
31
31
  }
32
32
  }
33
- }, isObjectType = (node) => (
33
+ };
34
+ const isObjectType = (node) => (
34
35
  // TODO: remove `as any` when drop support of graphql@15
35
36
  [_graphql.Kind.OBJECT_TYPE_DEFINITION, _graphql.Kind.OBJECT_TYPE_EXTENSION].includes(node.type)
36
- ), isQueryType = (node) => isObjectType(node) && node.name.value === "Query", isMutationType = (node) => isObjectType(node) && node.name.value === "Mutation", rule = exports.rule = {
37
+ );
38
+ const isQueryType = (node) => isObjectType(node) && node.name.value === "Query";
39
+ const isMutationType = (node) => isObjectType(node) && node.name.value === "Mutation";
40
+ const rule = {
37
41
  meta: {
38
42
  type: "suggestion",
39
- hasSuggestions: !0,
43
+ hasSuggestions: true,
40
44
  docs: {
41
- description: `Require mutation argument to be always called "input" and input type to be called Mutation name + "Input".
42
- Using the same name for all input parameters will make your schemas easier to consume and more predictable. Using the same name as mutation for InputType will make it easier to find mutations that InputType belongs to.`,
45
+ description: 'Require mutation argument to be always called "input" and input type to be called Mutation name + "Input".\nUsing the same name for all input parameters will make your schemas easier to consume and more predictable. Using the same name as mutation for InputType will make it easier to find mutations that InputType belongs to.',
43
46
  category: "Schema",
44
47
  url: "https://the-guild.dev/graphql/eslint/rules/input-name",
45
48
  examples: [
46
49
  {
47
50
  title: "Incorrect",
48
- usage: [{ checkInputType: !0 }],
51
+ usage: [{ checkInputType: true }],
49
52
  code: (
50
53
  /* GraphQL */
51
54
  `
@@ -57,7 +60,7 @@ Using the same name for all input parameters will make your schemas easier to co
57
60
  },
58
61
  {
59
62
  title: "Correct (with `checkInputType`)",
60
- usage: [{ checkInputType: !0 }],
63
+ usage: [{ checkInputType: true }],
61
64
  code: (
62
65
  /* GraphQL */
63
66
  `
@@ -69,7 +72,7 @@ Using the same name for all input parameters will make your schemas easier to co
69
72
  },
70
73
  {
71
74
  title: "Correct (without `checkInputType`)",
72
- usage: [{ checkInputType: !1 }],
75
+ usage: [{ checkInputType: false }],
73
76
  code: (
74
77
  /* GraphQL */
75
78
  `
@@ -85,11 +88,13 @@ Using the same name for all input parameters will make your schemas easier to co
85
88
  },
86
89
  create(context) {
87
90
  const options = {
88
- checkInputType: !1,
89
- caseSensitiveInputType: !0,
90
- checkMutations: !0,
91
+ checkInputType: false,
92
+ caseSensitiveInputType: true,
93
+ checkMutations: true,
91
94
  ...context.options[0]
92
- }, shouldCheckType = (node) => options.checkMutations && isMutationType(node) || options.checkQueries && isQueryType(node) || !1, listeners = {
95
+ };
96
+ const shouldCheckType = (node) => options.checkMutations && isMutationType(node) || options.checkQueries && isQueryType(node) || false;
97
+ const listeners = {
93
98
  "FieldDefinition > InputValueDefinition[name.value!=input] > Name"(node) {
94
99
  const fieldDef = node.parent.parent;
95
100
  if (shouldCheckType(fieldDef.parent)) {
@@ -107,27 +112,35 @@ Using the same name for all input parameters will make your schemas easier to co
107
112
  }
108
113
  }
109
114
  };
110
- return options.checkInputType && (listeners["FieldDefinition > InputValueDefinition NamedType"] = (node) => {
111
- const inputValueNode = ((item) => {
112
- let currentNode = item;
113
- for (; currentNode.type !== _graphql.Kind.INPUT_VALUE_DEFINITION; )
114
- currentNode = currentNode.parent;
115
- return currentNode;
116
- })(node);
117
- if (shouldCheckType(inputValueNode.parent.parent)) {
118
- const mutationName = `${inputValueNode.parent.name.value}Input`, name = node.name.value;
119
- (options.caseSensitiveInputType && node.name.value !== mutationName || name.toLowerCase() !== mutationName.toLowerCase()) && context.report({
120
- node: node.name,
121
- message: `Input type \`${name}\` name should be \`${mutationName}\`.`,
122
- suggest: [
123
- {
124
- desc: `Rename to \`${mutationName}\``,
125
- fix: (fixer) => fixer.replaceText(node, mutationName)
126
- }
127
- ]
128
- });
129
- }
130
- }), listeners;
115
+ if (options.checkInputType) {
116
+ listeners["FieldDefinition > InputValueDefinition NamedType"] = (node) => {
117
+ const findInputType = (item) => {
118
+ let currentNode = item;
119
+ while (currentNode.type !== _graphql.Kind.INPUT_VALUE_DEFINITION) {
120
+ currentNode = currentNode.parent;
121
+ }
122
+ return currentNode;
123
+ };
124
+ const inputValueNode = findInputType(node);
125
+ if (shouldCheckType(inputValueNode.parent.parent)) {
126
+ const mutationName = `${inputValueNode.parent.name.value}Input`;
127
+ const name = node.name.value;
128
+ if (options.caseSensitiveInputType && node.name.value !== mutationName || name.toLowerCase() !== mutationName.toLowerCase()) {
129
+ context.report({
130
+ node: node.name,
131
+ message: `Input type \`${name}\` name should be \`${mutationName}\`.`,
132
+ suggest: [
133
+ {
134
+ desc: `Rename to \`${mutationName}\``,
135
+ fix: (fixer) => fixer.replaceText(node, mutationName)
136
+ }
137
+ ]
138
+ });
139
+ }
140
+ }
141
+ };
142
+ }
143
+ return listeners;
131
144
  }
132
145
  };
133
146
 
@@ -1,12 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _graphql = require('graphql');
2
2
  var _utilsjs = require('../../utils.js');
3
- const RULE_ID = "lone-executable-definition", definitionTypes = ["fragment", ...Object.values(_graphql.OperationTypeNode)], schema = {
3
+ const RULE_ID = "lone-executable-definition";
4
+ const definitionTypes = ["fragment", ...Object.values(_graphql.OperationTypeNode)];
5
+ const schema = {
4
6
  type: "array",
5
7
  maxItems: 1,
6
8
  items: {
7
9
  type: "object",
8
10
  minProperties: 1,
9
- additionalProperties: !1,
11
+ additionalProperties: false,
10
12
  properties: {
11
13
  ignore: {
12
14
  ..._utilsjs.ARRAY_DEFAULT_OPTIONS,
@@ -19,7 +21,8 @@ const RULE_ID = "lone-executable-definition", definitionTypes = ["fragment", ...
19
21
  }
20
22
  }
21
23
  }
22
- }, rule = exports.rule = {
24
+ };
25
+ const rule = {
23
26
  meta: {
24
27
  type: "suggestion",
25
28
  docs: {
@@ -60,17 +63,23 @@ const RULE_ID = "lone-executable-definition", definitionTypes = ["fragment", ...
60
63
  schema
61
64
  },
62
65
  create(context) {
63
- const ignore = new Set(_optionalChain([context, 'access', _ => _.options, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.ignore]) || []), definitions = [];
66
+ const ignore = new Set(_optionalChain([context, 'access', _ => _.options, 'access', _2 => _2[0], 'optionalAccess', _3 => _3.ignore]) || []);
67
+ const definitions = [];
64
68
  return {
65
69
  ":matches(OperationDefinition, FragmentDefinition)"(node) {
66
70
  const type = "operation" in node ? node.operation : "fragment";
67
- ignore.has(type) || definitions.push({ type, node });
71
+ if (!ignore.has(type)) {
72
+ definitions.push({ type, node });
73
+ }
68
74
  },
69
75
  "Document:exit"() {
70
76
  for (const { node, type } of definitions.slice(1)) {
71
77
  let name = _utilsjs.pascalCase.call(void 0, type);
72
78
  const definitionName = _optionalChain([node, 'access', _4 => _4.name, 'optionalAccess', _5 => _5.value]);
73
- definitionName && (name += ` "${definitionName}"`), context.report({
79
+ if (definitionName) {
80
+ name += ` "${definitionName}"`;
81
+ }
82
+ context.report({
74
83
  loc: _optionalChain([node, 'access', _6 => _6.name, 'optionalAccess', _7 => _7.loc]) || _utilsjs.getLocation.call(void 0, node.loc.start, type),
75
84
  messageId: RULE_ID,
76
85
  data: { name }
@@ -13,8 +13,8 @@ type CaseStyle = CaseStyle$1 | 'matchDocumentStyle';
13
13
  declare const schema: {
14
14
  readonly definitions: {
15
15
  readonly asString: {
16
- readonly enum: CaseStyle[];
17
- readonly description: `One of: ${string}`;
16
+ enum: CaseStyle[];
17
+ description: string;
18
18
  };
19
19
  readonly asObject: {
20
20
  readonly type: "object";
@@ -22,7 +22,8 @@ declare const schema: {
22
22
  readonly minProperties: 1;
23
23
  readonly properties: {
24
24
  readonly style: {
25
- readonly enum: CaseStyle[];
25
+ enum: CaseStyle[];
26
+ description: string;
26
27
  };
27
28
  readonly suffix: {
28
29
  readonly type: "string";
@@ -5,27 +5,32 @@ var _graphql = require('graphql');
5
5
 
6
6
 
7
7
  var _utilsjs = require('../../utils.js');
8
- const MATCH_EXTENSION = "MATCH_EXTENSION", MATCH_STYLE = "MATCH_STYLE", CASE_STYLES = [
8
+ const MATCH_EXTENSION = "MATCH_EXTENSION";
9
+ const MATCH_STYLE = "MATCH_STYLE";
10
+ const CASE_STYLES = [
9
11
  "camelCase",
10
12
  "PascalCase",
11
13
  "snake_case",
12
14
  "UPPER_CASE",
13
15
  "kebab-case",
14
16
  "matchDocumentStyle"
15
- ], schemaOption = {
17
+ ];
18
+ const schemaOption = {
16
19
  oneOf: [{ $ref: "#/definitions/asString" }, { $ref: "#/definitions/asObject" }]
17
- }, schema = {
20
+ };
21
+ const caseSchema = {
22
+ enum: CASE_STYLES,
23
+ description: `One of: ${CASE_STYLES.map((t) => `\`${t}\``).join(", ")}`
24
+ };
25
+ const schema = {
18
26
  definitions: {
19
- asString: {
20
- enum: CASE_STYLES,
21
- description: `One of: ${CASE_STYLES.map((t) => `\`${t}\``).join(", ")}`
22
- },
27
+ asString: caseSchema,
23
28
  asObject: {
24
29
  type: "object",
25
- additionalProperties: !1,
30
+ additionalProperties: false,
26
31
  minProperties: 1,
27
32
  properties: {
28
- style: { enum: CASE_STYLES },
33
+ style: caseSchema,
29
34
  suffix: { type: "string" },
30
35
  prefix: { type: "string" }
31
36
  }
@@ -36,7 +41,7 @@ const MATCH_EXTENSION = "MATCH_EXTENSION", MATCH_STYLE = "MATCH_STYLE", CASE_STY
36
41
  maxItems: 1,
37
42
  items: {
38
43
  type: "object",
39
- additionalProperties: !1,
44
+ additionalProperties: false,
40
45
  minProperties: 1,
41
46
  properties: {
42
47
  fileExtension: { enum: [".gql", ".graphql"] },
@@ -46,7 +51,8 @@ const MATCH_EXTENSION = "MATCH_EXTENSION", MATCH_STYLE = "MATCH_STYLE", CASE_STY
46
51
  fragment: schemaOption
47
52
  }
48
53
  }
49
- }, rule = exports.rule = {
54
+ };
55
+ const rule = {
50
56
  meta: {
51
57
  type: "suggestion",
52
58
  docs: {
@@ -186,47 +192,67 @@ const MATCH_EXTENSION = "MATCH_EXTENSION", MATCH_STYLE = "MATCH_STYLE", CASE_STY
186
192
  create(context) {
187
193
  const options = context.options[0] || {
188
194
  fileExtension: null
189
- }, filePath = context.filename, isVirtualFile = _utilsjs.VIRTUAL_DOCUMENT_REGEX.test(filePath);
190
- if (process.env.NODE_ENV !== "test" && isVirtualFile)
195
+ };
196
+ const filePath = context.filename;
197
+ const isVirtualFile = _utilsjs.VIRTUAL_DOCUMENT_REGEX.test(filePath);
198
+ if (process.env.NODE_ENV !== "test" && isVirtualFile) {
191
199
  return {};
192
- const fileExtension = _nodepath.extname.call(void 0, filePath), filename = _nodepath.basename.call(void 0, filePath, fileExtension);
200
+ }
201
+ const fileExtension = _nodepath.extname.call(void 0, filePath);
202
+ const filename = _nodepath.basename.call(void 0, filePath, fileExtension);
193
203
  return {
194
204
  Document(documentNode) {
195
- options.fileExtension && options.fileExtension !== fileExtension && context.report({
196
- loc: _utilsjs.REPORT_ON_FIRST_CHARACTER,
197
- messageId: MATCH_EXTENSION,
198
- data: {
199
- fileExtension,
200
- expectedFileExtension: options.fileExtension
201
- }
202
- });
205
+ if (options.fileExtension && options.fileExtension !== fileExtension) {
206
+ context.report({
207
+ loc: _utilsjs.REPORT_ON_FIRST_CHARACTER,
208
+ messageId: MATCH_EXTENSION,
209
+ data: {
210
+ fileExtension,
211
+ expectedFileExtension: options.fileExtension
212
+ }
213
+ });
214
+ }
203
215
  const firstOperation = documentNode.definitions.find(
204
216
  (n) => n.kind === _graphql.Kind.OPERATION_DEFINITION
205
- ), firstFragment = documentNode.definitions.find(
217
+ );
218
+ const firstFragment = documentNode.definitions.find(
206
219
  (n) => n.kind === _graphql.Kind.FRAGMENT_DEFINITION
207
- ), node = firstOperation || firstFragment;
208
- if (!node)
220
+ );
221
+ const node = firstOperation || firstFragment;
222
+ if (!node) {
209
223
  return;
224
+ }
210
225
  const docName = _optionalChain([node, 'access', _ => _.name, 'optionalAccess', _2 => _2.value]);
211
- if (!docName)
226
+ if (!docName) {
212
227
  return;
228
+ }
213
229
  const docType = "operation" in node ? node.operation : "fragment";
214
230
  let option = options[docType];
215
- if (!option)
231
+ if (!option) {
216
232
  return;
217
- typeof option == "string" && (option = { style: option });
233
+ }
234
+ if (typeof option === "string") {
235
+ option = { style: option };
236
+ }
218
237
  const expectedExtension = options.fileExtension || fileExtension;
219
238
  let expectedFilename = option.prefix || "";
220
- option.style ? expectedFilename += option.style === "matchDocumentStyle" ? docName : _utilsjs.convertCase.call(void 0, option.style, docName) : expectedFilename += filename, expectedFilename += (option.suffix || "") + expectedExtension;
239
+ if (option.style) {
240
+ expectedFilename += option.style === "matchDocumentStyle" ? docName : _utilsjs.convertCase.call(void 0, option.style, docName);
241
+ } else {
242
+ expectedFilename += filename;
243
+ }
244
+ expectedFilename += (option.suffix || "") + expectedExtension;
221
245
  const filenameWithExtension = filename + expectedExtension;
222
- expectedFilename !== filenameWithExtension && context.report({
223
- loc: _utilsjs.REPORT_ON_FIRST_CHARACTER,
224
- messageId: MATCH_STYLE,
225
- data: {
226
- expectedFilename,
227
- filename: filenameWithExtension
228
- }
229
- });
246
+ if (expectedFilename !== filenameWithExtension) {
247
+ context.report({
248
+ loc: _utilsjs.REPORT_ON_FIRST_CHARACTER,
249
+ messageId: MATCH_STYLE,
250
+ data: {
251
+ expectedFilename,
252
+ filename: filenameWithExtension
253
+ }
254
+ });
255
+ }
230
256
  }
231
257
  };
232
258
  }
@@ -12,15 +12,16 @@ type AllowedStyle = 'camelCase' | 'PascalCase' | 'snake_case' | 'UPPER_CASE';
12
12
  declare const schema: {
13
13
  readonly definitions: {
14
14
  readonly asString: {
15
- readonly enum: AllowedStyle[];
16
- readonly description: `One of: ${string}`;
15
+ enum: AllowedStyle[];
16
+ description: string;
17
17
  };
18
18
  readonly asObject: {
19
19
  readonly type: "object";
20
20
  readonly additionalProperties: false;
21
21
  readonly properties: {
22
22
  readonly style: {
23
- readonly enum: AllowedStyle[];
23
+ enum: AllowedStyle[];
24
+ description: string;
24
25
  };
25
26
  readonly prefix: {
26
27
  readonly type: "string";
@@ -37,14 +38,9 @@ declare const schema: {
37
38
  readonly uniqueItems: true;
38
39
  readonly minItems: 1;
39
40
  };
40
- readonly requiredPatterns: {
41
- readonly items: {
42
- readonly type: "object";
43
- };
41
+ readonly requiredPattern: {
42
+ readonly type: "object";
44
43
  readonly description: "Should be of instance of `RegEx`";
45
- readonly type: "array";
46
- readonly uniqueItems: true;
47
- readonly minItems: 1;
48
44
  };
49
45
  readonly forbiddenPrefixes: {
50
46
  readonly description: string;