INNER CODE UNIT · JavaScript
Configuration
cjoudrey/graphql-schema-linter · src/configuration.js:8
export class Configuration {
/*
options:
- format: (required) `text` | `json`
- rules: [string array] whitelist rules
- rulesOptions: [string to object] configuration options for rules. Example: "rulesOptions": { "enum-values-sorted-alphabetically": { "sortOrder": "lexicographical" } }
- ignore: [string to string array object] ignore list for rules. Example: {"fields-have-descriptions": ["Obvious", "Query.obvious", "Query.something.obvious"]}
- customRulePaths: [string array] path to additional custom rules to be loaded
- commentDescriptions: [boolean] use old way of defining descriptions in GraphQL SDL
- oldImplementsSyntax: [boolean] use old way of defining implemented interfaces in GraphQL SDL
*/
constructor(schema, options = {}) {
const defaultOptions = {
format: 'text',
customRulePaths: [],
commentDescriptions: false,
oldImplementsSyntax: false,
rulesOptions: {},