@graphql-eslint/eslint-plugin 3.8.0-alpha-c1d1797.0 → 3.8.0-alpha-998ffa8.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.
@@ -131,7 +131,7 @@ The schema defines the following additional types:
|
|
131
131
|
|
132
132
|
## `asString` (enum)
|
133
133
|
|
134
|
-
One of: `camelCase`, `PascalCase`, `snake_case`, `UPPER_CASE`, `kebab-case`
|
134
|
+
One of: `camelCase`, `PascalCase`, `snake_case`, `UPPER_CASE`, `kebab-case`, `documentStyle`
|
135
135
|
|
136
136
|
## `asObject` (object)
|
137
137
|
|
@@ -146,6 +146,7 @@ This element must be one of the following enum values:
|
|
146
146
|
- `snake_case`
|
147
147
|
- `UPPER_CASE`
|
148
148
|
- `kebab-case`
|
149
|
+
- `documentStyle`
|
149
150
|
|
150
151
|
### `suffix` (string)
|
151
152
|
|
package/index.js
CHANGED
@@ -1098,7 +1098,7 @@ const rule$2 = {
|
|
1098
1098
|
const MATCH_EXTENSION = 'MATCH_EXTENSION';
|
1099
1099
|
const MATCH_STYLE = 'MATCH_STYLE';
|
1100
1100
|
const ACCEPTED_EXTENSIONS = ['.gql', '.graphql'];
|
1101
|
-
const CASE_STYLES = ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE', 'kebab-case'];
|
1101
|
+
const CASE_STYLES = ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE', 'kebab-case', 'documentStyle'];
|
1102
1102
|
const schemaOption = {
|
1103
1103
|
oneOf: [{ $ref: '#/definitions/asString' }, { $ref: '#/definitions/asObject' }],
|
1104
1104
|
};
|
@@ -1272,7 +1272,14 @@ const rule$3 = {
|
|
1272
1272
|
option = { style: option };
|
1273
1273
|
}
|
1274
1274
|
const expectedExtension = options.fileExtension || fileExtension;
|
1275
|
-
|
1275
|
+
let expectedFilename;
|
1276
|
+
if (option.style) {
|
1277
|
+
expectedFilename = option.style === 'documentStyle' ? docName : convertCase(option.style, docName);
|
1278
|
+
}
|
1279
|
+
else {
|
1280
|
+
expectedFilename = filename;
|
1281
|
+
}
|
1282
|
+
expectedFilename += (option.suffix || '') + expectedExtension;
|
1276
1283
|
const filenameWithExtension = filename + expectedExtension;
|
1277
1284
|
if (expectedFilename !== filenameWithExtension) {
|
1278
1285
|
context.report({
|
package/index.mjs
CHANGED
@@ -1092,7 +1092,7 @@ const rule$2 = {
|
|
1092
1092
|
const MATCH_EXTENSION = 'MATCH_EXTENSION';
|
1093
1093
|
const MATCH_STYLE = 'MATCH_STYLE';
|
1094
1094
|
const ACCEPTED_EXTENSIONS = ['.gql', '.graphql'];
|
1095
|
-
const CASE_STYLES = ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE', 'kebab-case'];
|
1095
|
+
const CASE_STYLES = ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE', 'kebab-case', 'documentStyle'];
|
1096
1096
|
const schemaOption = {
|
1097
1097
|
oneOf: [{ $ref: '#/definitions/asString' }, { $ref: '#/definitions/asObject' }],
|
1098
1098
|
};
|
@@ -1266,7 +1266,14 @@ const rule$3 = {
|
|
1266
1266
|
option = { style: option };
|
1267
1267
|
}
|
1268
1268
|
const expectedExtension = options.fileExtension || fileExtension;
|
1269
|
-
|
1269
|
+
let expectedFilename;
|
1270
|
+
if (option.style) {
|
1271
|
+
expectedFilename = option.style === 'documentStyle' ? docName : convertCase(option.style, docName);
|
1272
|
+
}
|
1273
|
+
else {
|
1274
|
+
expectedFilename = filename;
|
1275
|
+
}
|
1276
|
+
expectedFilename += (option.suffix || '') + expectedExtension;
|
1270
1277
|
const filenameWithExtension = filename + expectedExtension;
|
1271
1278
|
if (expectedFilename !== filenameWithExtension) {
|
1272
1279
|
context.report({
|
package/package.json
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import { CaseStyle } from '../utils';
|
1
|
+
import { CaseStyle as _CaseStyle } from '../utils';
|
2
2
|
import { GraphQLESLintRule } from '../types';
|
3
|
+
declare type CaseStyle = _CaseStyle | 'documentStyle';
|
3
4
|
declare const ACCEPTED_EXTENSIONS: ['.gql', '.graphql'];
|
4
5
|
declare type PropertySchema = {
|
5
6
|
style?: CaseStyle;
|