Skip to main content
Module

x/graphql_ts/.eslintrc.yml

A reference implementation of GraphQL for JavaScript
Go to Latest
File
parser: babel-eslintparserOptions: sourceType: moduleenv: es6: true node: truereportUnusedDisableDirectives: trueplugins: - flowtype
rules: # `eslint-plugin-flowtype` rule list based on `v4.3.x` # https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
flowtype/array-style-complex-type: [error, verbose] flowtype/array-style-simple-type: [error, verbose] flowtype/define-flow-type: error flowtype/newline-after-flow-annotation: [error, always] flowtype/no-dupe-keys: error flowtype/no-existential-type: off # checked by Flow flowtype/no-flow-fix-me-comments: off # TODO flowtype/no-mixed: off flowtype/no-mutable-array: off flowtype/no-primitive-constructor-types: error flowtype/no-types-missing-file-annotation: error flowtype/no-unused-expressions: off flowtype/no-weak-types: [error, { any: false }] flowtype/require-compound-type-alias: off flowtype/require-exact-type: off # TODO flowtype/require-indexer-name: error flowtype/require-inexact-type: off # checked by Flow flowtype/require-parameter-type: off flowtype/require-readonly-react-props: off flowtype/require-return-type: off flowtype/require-types-at-top: off flowtype/require-valid-file-annotation: [error, always, { annotationStyle: line, strict: true }] flowtype/require-variable-type: off flowtype/sort-keys: off flowtype/spread-exact-type: off flowtype/type-id-match: [error, '^[A-Z]'] flowtype/type-import-style: [error, identifier, { ignoreTypeDefault: true }] flowtype/use-flow-type: error
# Bellow rules are disabled because coflicts with Prettier, see: # https://github.com/prettier/eslint-config-prettier/blob/master/flowtype.js flowtype/boolean-style: off flowtype/delimiter-dangle: off flowtype/generic-spacing: off flowtype/object-type-delimiter: off flowtype/semi: off flowtype/space-after-type-colon: off flowtype/space-before-generic-bracket: off flowtype/space-before-type-colon: off flowtype/union-intersection-spacing: off
################################################## # ESLint builtin rules list based on `v6.3.x` ##################################################
# Possible Errors # https://eslint.org/docs/rules/#possible-errors
for-direction: error getter-return: error no-async-promise-executor: error no-await-in-loop: error no-compare-neg-zero: error no-cond-assign: error no-console: warn no-constant-condition: error no-control-regex: error no-debugger: warn no-dupe-args: error no-dupe-keys: error no-duplicate-case: error no-empty: error no-empty-character-class: error no-ex-assign: error no-extra-boolean-cast: error no-func-assign: error no-inner-declarations: [error, both] no-invalid-regexp: error no-irregular-whitespace: error no-misleading-character-class: error no-obj-calls: error no-prototype-builtins: error no-regex-spaces: error no-sparse-arrays: error no-template-curly-in-string: error no-unreachable: error no-unsafe-finally: error no-unsafe-negation: error require-atomic-updates: error use-isnan: error valid-typeof: error
# Best Practices # https://eslint.org/docs/rules/#best-practices
accessor-pairs: error array-callback-return: [error, { allowImplicit: true }] block-scoped-var: error class-methods-use-this: off complexity: off # maybe consistent-return: off # TODO curly: [error, all] default-case: off dot-notation: off eqeqeq: [error, smart] guard-for-in: error max-classes-per-file: off no-alert: error no-caller: error no-case-declarations: error no-div-regex: error no-else-return: error no-empty-function: off # TODO no-empty-pattern: error no-eq-null: off no-eval: error no-extend-native: error no-extra-bind: error no-extra-label: error no-fallthrough: error no-global-assign: error no-implicit-coercion: error no-implicit-globals: off no-implied-eval: error no-invalid-this: off no-iterator: error no-labels: [error, { allowLoop: true }] no-lone-blocks: error no-loop-func: error no-magic-numbers: off no-multi-str: error no-new: error no-new-func: error no-new-wrappers: error no-octal: error no-octal-escape: error no-param-reassign: error no-proto: error no-redeclare: error no-restricted-properties: off no-return-assign: error no-return-await: error no-script-url: error no-self-assign: error no-self-compare: off # TODO no-sequences: error no-throw-literal: error no-unmodified-loop-condition: error no-unused-expressions: error no-unused-labels: error no-useless-call: error no-useless-catch: error no-useless-concat: error no-useless-escape: error no-useless-return: error no-void: error no-warning-comments: off no-with: error prefer-named-capture-group: off # ES2018 prefer-promise-reject-errors: error radix: error require-await: off # TODO require-unicode-regexp: off vars-on-top: error yoda: [error, never, { exceptRange: true }]
# Strict Mode # https://eslint.org/docs/rules/#strict-mode
strict: error
# Variables # https://eslint.org/docs/rules/#variables
init-declarations: off no-delete-var: error no-label-var: error no-restricted-globals: off no-shadow: error no-shadow-restricted-names: error no-undef: error no-undef-init: error no-undefined: off no-unused-vars: [error, { vars: all, args: after-used, argsIgnorePattern: '^_' }] no-use-before-define: off
# Node.js and CommonJS # https://eslint.org/docs/rules/#nodejs-and-commonjs
callback-return: error global-require: error handle-callback-err: [error, error] no-buffer-constructor: error no-mixed-requires: [error, true] no-new-require: error no-path-concat: error no-process-env: off no-process-exit: off no-restricted-modules: off no-sync: error
# Stylistic Issues # https://eslint.org/docs/rules/#stylistic-issues
camelcase: [error, { properties: always }] capitalized-comments: off # maybe consistent-this: off func-name-matching: off func-names: off func-style: off id-blacklist: off id-length: off id-match: [error, '^(?:_?[a-zA-Z0-9]*)|[_A-Z0-9]+$'] line-comment-position: off lines-around-comment: off lines-between-class-members: [error, always, { exceptAfterSingleLine: true }] max-depth: off max-lines: off max-lines-per-function: off max-nested-callbacks: off max-params: off max-statements: off max-statements-per-line: off multiline-comment-style: off new-cap: off # TODO no-array-constructor: error no-bitwise: off no-continue: off no-inline-comments: off no-lonely-if: error no-multi-assign: off no-negated-condition: off no-nested-ternary: off no-new-object: error no-plusplus: off no-restricted-syntax: - error - selector: 'FunctionDeclaration[async=true]' message: > async functions are not allowed inside package source code because older versions of NodeJS do not support them without additional runtime dependencies. Instead, use explicit Promises. no-tabs: error no-ternary: off no-underscore-dangle: off no-unneeded-ternary: error one-var: [error, never] operator-assignment: [error, always] padding-line-between-statements: off prefer-object-spread: error quotes: [error, single, { avoidEscape: true, allowTemplateLiterals: false }] sort-keys: off sort-vars: off spaced-comment: [error, always]
# ECMAScript 6 # https://eslint.org/docs/rules/#ecmascript-6
arrow-body-style: error constructor-super: error no-class-assign: error no-const-assign: error no-dupe-class-members: error no-duplicate-imports: error no-new-symbol: error no-restricted-imports: off no-this-before-super: error no-useless-computed-key: error no-useless-constructor: error no-useless-rename: error no-var: error object-shorthand: [error, always] prefer-arrow-callback: error prefer-const: error prefer-destructuring: off prefer-numeric-literals: error prefer-rest-params: off # TODO prefer-spread: error prefer-template: off require-yield: off sort-imports: off symbol-description: off
# Bellow rules are disabled because coflicts with Prettier, see: # https://github.com/prettier/eslint-config-prettier/blob/master/index.js array-bracket-newline: off array-bracket-spacing: off array-element-newline: off arrow-parens: off arrow-spacing: off block-spacing: off brace-style: off comma-dangle: off comma-spacing: off comma-style: off computed-property-spacing: off dot-location: off eol-last: off func-call-spacing: off function-call-argument-newline: off function-paren-newline: off generator-star-spacing: off implicit-arrow-linebreak: off indent: off jsx-quotes: off key-spacing: off keyword-spacing: off linebreak-style: error max-len: off multiline-ternary: off newline-per-chained-call: off new-parens: off no-confusing-arrow: off no-extra-parens: off no-extra-semi: off no-floating-decimal: off no-mixed-operators: off no-mixed-spaces-and-tabs: off no-multi-spaces: off no-multiple-empty-lines: off no-spaced-func: off no-trailing-spaces: off no-unexpected-multiline: off no-whitespace-before-property: off nonblock-statement-body-position: off object-curly-newline: off object-curly-spacing: off object-property-newline: off one-var-declaration-per-line: off operator-linebreak: off padded-blocks: off quote-props: off rest-spread-spacing: off semi: off semi-spacing: off semi-style: off space-before-blocks: off space-before-function-paren: off space-in-parens: off space-infix-ops: off space-unary-ops: off switch-colon-spacing: off template-curly-spacing: off template-tag-spacing: off unicode-bom: off wrap-iife: off wrap-regex: off yield-star-spacing: off
overrides: - files: '**/__tests__/**' rules: no-restricted-syntax: off - files: 'resources/**' parserOptions: sourceType: script rules: no-await-in-loop: off no-restricted-syntax: off no-console: off no-sync: off global-require: off