Skip to content

Commit

Permalink
example fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotansimha committed Oct 1, 2020
1 parent d46608e commit 77abdfa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
24 changes: 22 additions & 2 deletions example/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,28 @@
},
"plugins": ["@graphql-eslint"],
"rules": {
"@graphql-eslint/description-style": ["error", { "style": "block" }]
}
"@graphql-eslint/require-id-when-available": [
"error",
{
"fieldName": "_id"
}
],
"@graphql-eslint/validate-against-schema": "error",
"@graphql-eslint/no-anonymous-operations": "warn",
"@graphql-eslint/no-operation-name-suffix": "error",
"@graphql-eslint/avoid-operation-name-prefix": [
"error",
{
"keywords": ["get"]
}
],
"@graphql-eslint/no-case-insensitive-enum-values-duplicates": ["error"],
"@graphql-eslint/require-description": [
"warn",
{
"on": ["SchemaDefinition", "FieldDefinition"]
}
] }
}
]
}
6 changes: 4 additions & 2 deletions packages/plugin/src/processors/code-files.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { extname } from 'path';
import { parseCode } from '@graphql-tools/graphql-tag-pluck';
import {} from 'eslint';

const EXTRACTABLE_FILES_EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx'];
const RELEVANT_KEYWORDS = ['gql', 'graphql', '/* GraphQL */'];
Expand All @@ -10,7 +11,8 @@ type Block = {
lineOffset?: number;
};

export const createGraphqlProcessor = () => {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export function createGraphqlProcessor() {
const blocksMap = new Map<string, Block[]>();

return {
Expand Down Expand Up @@ -71,4 +73,4 @@ export const createGraphqlProcessor = () => {
return [].concat(...messageLists);
},
};
};
}

0 comments on commit 77abdfa

Please sign in to comment.