Mirror: The spec-compliant minimum of client-side GraphQL.
1module.exports = { 2 parserOptions: { 3 ecmaVersion: 9, 4 sourceType: 'module', 5 ecmaFeatures: { 6 modules: true, 7 }, 8 }, 9 extends: ['prettier'], 10 plugins: ['prettier', 'tsdoc'], 11 ignorePatterns: ['node_modules/', 'dist/', 'coverage/', 'perf/'], 12 rules: { 13 'no-undef': 'off', 14 'no-empty': 'off', 15 'sort-keys': 'off', 16 'no-console': ['error', { allow: ['warn', 'error'] }], 17 'prefer-arrow/prefer-arrow-functions': 'off', 18 'prefer-rest-params': 'off', 19 20 'prettier/prettier': [ 21 'error', 22 { 23 singleQuote: true, 24 tabWidth: 2, 25 printWidth: 100, 26 trailingComma: 'es5', 27 }, 28 ], 29 }, 30 31 overrides: [ 32 { 33 files: ['*.ts'], 34 parser: '@typescript-eslint/parser', 35 extends: ['plugin:@typescript-eslint/recommended', 'prettier'], 36 rules: { 37 '@typescript-eslint/explicit-module-boundary-types': 'off', 38 '@typescript-eslint/no-use-before-define': 'off', 39 '@typescript-eslint/ban-types': 'off', 40 '@typescript-eslint/ban-ts-comment': 'off', 41 '@typescript-eslint/member-ordering': 'off', 42 '@typescript-eslint/explicit-member-accessibility': 'off', 43 '@typescript-eslint/no-object-literal-type-assertion': 'off', 44 '@typescript-eslint/explicit-function-return-type': 'off', 45 '@typescript-eslint/interface-name-prefix': 'off', 46 '@typescript-eslint/no-non-null-assertion': 'off', 47 '@typescript-eslint/no-misused-new': 'off', 48 '@typescript-eslint/no-explicit-any': 'off', 49 '@typescript-eslint/no-unused-vars': 'off', 50 '@typescript-eslint/no-namespace': 'off', 51 '@typescript-eslint/array-type': 'off', 52 'tsdoc/syntax': 'error', 53 54 'no-restricted-syntax': [ 55 'error', 56 { 57 selector: 'PropertyDefinition[value]', 58 message: 'Property definitions with value initializers aren’t transpiled', 59 }, 60 { 61 selector: 'MemberExpression[optional=true]', 62 message: 'Optional chaining (?.) operator is outside of specified browser support', 63 }, 64 { 65 selector: 'LogicalExpression[operator="??"]', 66 message: 'Nullish coalescing (??) operator is outside of specified browser support', 67 }, 68 { 69 selector: 'AssignmentExpression[operator="??="]', 70 message: 'Nullish coalescing assignment (??=) is outside of specified browser support', 71 }, 72 { 73 selector: 'SequenceExpression', 74 message: 'Sequence expressions are to be avoided since they can be confusing', 75 }, 76 { 77 selector: ':not(ForStatement) > VariableDeclaration[declarations.length>1]', 78 message: 'Only one variable declarator per variable declaration is preferred', 79 }, 80 ], 81 82 '@typescript-eslint/no-import-type-side-effects': 'error', 83 '@typescript-eslint/consistent-type-imports': [ 84 'error', 85 { 86 disallowTypeAnnotations: false, 87 fixStyle: 'separate-type-imports', 88 }, 89 ], 90 }, 91 }, 92 93 { 94 files: ['src/**/__tests__/**/*.ts'], 95 rules: { 96 'no-restricted-syntax': 'off', 97 'prefer-rest-params': 'off', 98 }, 99 }, 100 101 { 102 files: ['**/*.d.ts'], 103 rules: { 104 '@typescript-eslint/triple-slash-reference': 'off', 105 }, 106 }, 107 ], 108};