Skip to content

Commit c36ef7a

Browse files
authored
shared eslint setup (#1902)
* guild eslint config * trigger ci * eslint * do not break * not sure what to do with types cause it should work
1 parent 0c896e2 commit c36ef7a

File tree

75 files changed

+839
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+839
-139
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/generated/**

.eslintrc.cjs

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,52 @@
11
module.exports = {
2-
root: true,
3-
env: {
4-
es2020: true,
5-
},
6-
parser: '@typescript-eslint/parser',
7-
plugins: ['@typescript-eslint'],
8-
rules: {
9-
'no-else-return': ['error', { allowElseIf: false }],
10-
'object-shorthand': ['error', 'always'],
11-
},
2+
extends: ['@theguild'],
3+
overrides: [
4+
{
5+
files: ['packages/graphql-yoga/src/plugins/**/*.ts'],
6+
rules: {
7+
'unicorn/filename-case': 'off',
8+
},
9+
},
10+
{
11+
files: ['website/**'],
12+
rules: { 'import/no-default-export': 'off' },
13+
},
14+
{
15+
files: ['examples/**'],
16+
rules: {
17+
'import/extensions': 'off',
18+
'unicorn/filename-case': 'off',
19+
'no-console': 'off',
20+
'import/no-default-export': 'off',
21+
},
22+
},
23+
{
24+
files: [
25+
'**/__tests__/**',
26+
'**/*.spec.ts',
27+
'**/*.test.ts',
28+
'e2e/**',
29+
'**/__integration-tests__/**',
30+
],
31+
rules: {
32+
'@typescript-eslint/no-non-null-assertion': 'off',
33+
'import/extensions': 'off',
34+
'unicorn/filename-case': 'off',
35+
},
36+
},
37+
{
38+
files: ['e2e/**'],
39+
rules: {
40+
'no-console': 'off',
41+
},
42+
},
43+
{
44+
files: ['packages/graphiql/**', 'packages/render-graphiql/**'],
45+
rules: {
46+
'unicorn/filename-case': 'off',
47+
'import/extensions': 'off',
48+
'import/no-default-export': 'off',
49+
},
50+
},
51+
],
1252
}

benchmark/hello-world/check-server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable no-undef */
2+
/* eslint-disable no-console */
3+
/* eslint-disable @typescript-eslint/no-var-requires */
14
require('@whatwg-node/fetch')
25
.fetch(
36
`http://localhost:4000/graphql?query=${encodeURIComponent(

benchmark/hello-world/k6.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
import { check } from 'k6'
23
import http from 'k6/http'
34
import { textSummary } from 'https://jslib.k6.io/k6-summary/0.0.1/index.js'

benchmark/hello-world/start-server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
const { createServer } = require('http')
23
const { createYoga, createSchema } = require('graphql-yoga')
34

e2e/tests/aws-lambda.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Stack } from '@pulumi/pulumi/automation'
2-
import { DeploymentConfiguration } from '../types'
2+
import type { DeploymentConfiguration } from '../types'
33
import { assertGraphiQL, assertQuery, env, execPromise } from '../utils'
44
import * as pulumi from '@pulumi/pulumi'
55
import * as aws from '@pulumi/aws'

e2e/tests/docker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '../utils'
88
import * as docker from '@pulumi/docker'
99
import { interpolate } from '@pulumi/pulumi'
10-
import { join, resolve } from 'path'
10+
import { resolve } from 'path'
1111

1212
export const dockerDeployment = (
1313
image: string,

e2e/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Output } from '@pulumi/pulumi'
22
import { OutputValue, Stack } from '@pulumi/pulumi/automation'
33

4+
// eslint-disable-next-line @typescript-eslint/ban-types
45
export type DeploymentConfiguration<TProgramOutput = {}> = {
56
prerequisites?: (stack: Stack) => Promise<void>
67
config?: (stack: Stack) => Promise<void>

e2e/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export async function getCommitId() {
1313
export async function waitForEndpoint(
1414
endpoint: string,
1515
retries: number,
16-
timeout: number = 10000,
16+
timeout = 10000,
1717
): Promise<boolean> {
1818
for (let attempt = 1; attempt <= retries; attempt++) {
1919
console.info(

examples/apollo-federation/gateway/gateway.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
const { createYoga } = require('graphql-yoga')
23
const { ApolloGateway, RemoteGraphQLDataSource } = require('@apollo/gateway')
34
const { useApolloFederation } = require('@envelop/apollo-federation')

0 commit comments

Comments
 (0)