Skip to main content
Module

x/graphql_ts/.eslintrc.yml

A reference implementation of GraphQL for JavaScript
Go to Latest
File
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
parser: babel-eslintparserOptions: sourceType: moduleenv: es6: true node: truereportUnusedDisableDirectives: trueplugins: - flowtype - import
rules: no-dir-import: error
############################################################################## # `eslint-plugin-flowtype` rule list based on `v4.6.x` # https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype ##############################################################################
flowtype/array-style-complex-type: error flowtype/array-style-simple-type: error flowtype/define-flow-type: error flowtype/newline-after-flow-annotation: error flowtype/no-dupe-keys: error flowtype/no-existential-type: off # checked by Flow flowtype/no-flow-fix-me-comments: off 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 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/arrow-parens: off 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-plugin-import` rule list based on `v2.20.x` ##############################################################################
# Static analysis # https://github.com/benmosher/eslint-plugin-import#static-analysis import/no-unresolved: error import/named: error import/default: error import/namespace: error import/no-restricted-paths: off import/no-absolute-path: error import/no-dynamic-require: error import/no-internal-modules: off import/no-webpack-loader-syntax: error import/no-self-import: error import/no-cycle: error import/no-useless-path-segments: error import/no-relative-parent-imports: off
# Helpful warnings # https://github.com/benmosher/eslint-plugin-import#helpful-warnings import/export: error import/no-named-as-default: error import/no-named-as-default-member: error import/no-deprecated: error import/no-extraneous-dependencies: [error, { devDependencies: false }] import/no-mutable-exports: error import/no-unused-modules: error
# Module systems # https://github.com/benmosher/eslint-plugin-import#module-systems import/unambiguous: error import/no-commonjs: error import/no-amd: error import/no-nodejs-modules: error
# Style guide # https://github.com/benmosher/eslint-plugin-import#style-guide import/first: error import/exports-last: off import/no-duplicates: error import/no-namespace: error import/extensions: [error, never] # TODO: switch to ignorePackages import/order: [error, { newlines-between: always-and-inside-groups }] import/newline-after-import: error import/prefer-default-export: off import/max-dependencies: off import/no-unassigned-import: error import/no-named-default: error import/no-default-export: off import/no-named-export: off import/no-anonymous-default-export: error import/group-exports: off import/dynamic-import-chunkname: off
############################################################################## # ESLint builtin rules list based on `v6.8.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-else-if: 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-import-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-setter-return: 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 block-scoped-var: error class-methods-use-this: off complexity: off consistent-return: off curly: error default-case: off default-param-last: error dot-notation: off eqeqeq: [error, smart] grouped-accessor-pairs: error guard-for-in: error max-classes-per-file: off no-alert: error no-caller: error no-case-declarations: error no-constructor-return: error no-div-regex: error no-else-return: error no-empty-function: error 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 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 prefer-regex-literals: error radix: error require-await: error 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: all, 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 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 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 padding-line-between-statements: off prefer-exponentiation-operator: error prefer-object-spread: error quotes: [error, single, { avoidEscape: true }] sort-keys: off sort-vars: off spaced-comment: error
# 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 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: error 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: off 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-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: '**/*.ts' parser: '@typescript-eslint/parser' parserOptions: tsconfigRootDir: './src/' project: ['tsconfig.json'] plugins: - '@typescript-eslint' rules: flowtype/require-valid-file-annotation: off import/named: off import/namespace: off import/default: off import/no-named-as-default-member: off import/no-named-as-default: off import/no-cycle: off import/no-unused-modules: off import/no-deprecated: off import/no-unresolved: off
########################################################################## # `@typescript-eslint/eslint-plugin` rule list based on `v2.17.x` ##########################################################################
# Supported Rules # https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules '@typescript-eslint/adjacent-overload-signatures': error '@typescript-eslint/array-type': [error, { default: generic }] '@typescript-eslint/await-thenable': error '@typescript-eslint/ban-ts-comment': error '@typescript-eslint/ban-types': error '@typescript-eslint/consistent-type-assertions': [error, { assertionStyle: as, objectLiteralTypeAssertions: never }] '@typescript-eslint/consistent-type-definitions': off # TODO consider '@typescript-eslint/explicit-function-return-type': off # TODO consider '@typescript-eslint/explicit-member-accessibility': off # TODO consider '@typescript-eslint/explicit-module-boundary-types': off # TODO consider '@typescript-eslint/member-ordering': off # TODO consider '@typescript-eslint/naming-convention': off # TODO consider '@typescript-eslint/no-dynamic-delete': off '@typescript-eslint/no-empty-interface': error '@typescript-eslint/no-explicit-any': off # TODO error '@typescript-eslint/no-extra-non-null-assertion': error '@typescript-eslint/no-extraneous-class': off # TODO consider '@typescript-eslint/no-floating-promises': error '@typescript-eslint/no-for-in-array': error '@typescript-eslint/no-implied-eval': error '@typescript-eslint/no-inferrable-types': [error, { ignoreParameters: true, ignoreProperties: true }] '@typescript-eslint/no-misused-new': error '@typescript-eslint/no-misused-promises': error '@typescript-eslint/no-namespace': error '@typescript-eslint/no-non-null-asserted-optional-chain': error '@typescript-eslint/no-non-null-assertion': error '@typescript-eslint/no-parameter-properties': error '@typescript-eslint/no-require-imports': error '@typescript-eslint/no-this-alias': error '@typescript-eslint/no-throw-literal': error '@typescript-eslint/no-type-alias': off # TODO consider '@typescript-eslint/no-unnecessary-boolean-literal-compare': error '@typescript-eslint/no-unnecessary-condition': error '@typescript-eslint/no-unnecessary-qualifier': error '@typescript-eslint/no-unnecessary-type-arguments': error '@typescript-eslint/no-unnecessary-type-assertion': error '@typescript-eslint/no-unused-vars-experimental': off '@typescript-eslint/no-var-requires': error '@typescript-eslint/prefer-as-const': off # TODO consider '@typescript-eslint/prefer-for-of': off # TODO switch to error after TS migration '@typescript-eslint/prefer-function-type': error '@typescript-eslint/prefer-includes': off # TODO switch to error after IE11 drop '@typescript-eslint/prefer-namespace-keyword': error '@typescript-eslint/prefer-nullish-coalescing': error '@typescript-eslint/prefer-optional-chain': error '@typescript-eslint/prefer-readonly': error '@typescript-eslint/prefer-regexp-exec': error '@typescript-eslint/prefer-string-starts-ends-with': off # TODO switch to error after IE11 drop '@typescript-eslint/promise-function-async': off '@typescript-eslint/require-array-sort-compare': error '@typescript-eslint/restrict-plus-operands': [error, { checkCompoundAssignments: true }] '@typescript-eslint/restrict-template-expressions': error '@typescript-eslint/strict-boolean-expressions': off # TODO consider '@typescript-eslint/switch-exhaustiveness-check': error '@typescript-eslint/triple-slash-reference': error '@typescript-eslint/typedef': off '@typescript-eslint/unbound-method': off # TODO consider '@typescript-eslint/unified-signatures': error
# Extension Rules # https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#extension-rules
# Disable conflicting ESLint rules and enable TS-compatible ones default-param-last: off no-array-constructor: off no-dupe-class-members: off no-empty-function: off no-unused-expressions: off no-unused-vars: off no-useless-constructor: off require-await: off no-return-await: off '@typescript-eslint/default-param-last': error '@typescript-eslint/no-dupe-class-members': error '@typescript-eslint/no-array-constructor': error '@typescript-eslint/no-empty-function': error '@typescript-eslint/no-unused-expressions': error '@typescript-eslint/no-unused-vars': [error, { vars: all, args: all, argsIgnorePattern: '^_' }] '@typescript-eslint/no-useless-constructor': error '@typescript-eslint/require-await': error '@typescript-eslint/return-await': error
# Disable for JS, Flow and TS '@typescript-eslint/no-magic-numbers': off '@typescript-eslint/no-use-before-define': off
# Bellow rules are disabled because coflicts with Prettier, see: # https://github.com/prettier/eslint-config-prettier/blob/master/%40typescript-eslint.js '@typescript-eslint/quotes': off '@typescript-eslint/brace-style': off '@typescript-eslint/comma-spacing': off '@typescript-eslint/func-call-spacing': off '@typescript-eslint/indent': off '@typescript-eslint/member-delimiter-style': off '@typescript-eslint/no-extra-parens': off '@typescript-eslint/no-extra-semi': off '@typescript-eslint/semi': off '@typescript-eslint/space-before-function-paren': off '@typescript-eslint/type-annotation-spacing': off - files: '**/__*__/**' rules: import/no-extraneous-dependencies: off import/no-nodejs-modules: off no-restricted-syntax: off - files: 'resources/**' parserOptions: sourceType: script rules: import/no-dynamic-require: off import/no-extraneous-dependencies: off import/no-nodejs-modules: off import/no-commonjs: off no-await-in-loop: off no-restricted-syntax: off no-console: off no-sync: off global-require: off