Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off eslint no-use-before-define #1522

Conversation

enisdenjo
Copy link
Collaborator

eslint's no-use-before-define raises false positives for types:

type A = B; // error: 'B' was used before it was defined.
type B = any;

Since TypeScript itself disallows usage of variables before declaration, it makes sense to disable all matching eslint rules.

In essence:

{
  "no-use-before-define": "off",
  "typescript-eslint/no-use-before-define": "off"
}

@vercel
Copy link

vercel bot commented Sep 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
envelop ✅ Ready (Inspect) Visit Preview Sep 13, 2022 at 9:38AM (UTC)

@changeset-bot
Copy link

changeset-bot bot commented Sep 13, 2022

🦋 Changeset detected

Latest commit: 68dc3bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 36 packages
Name Type
@envelop/apollo-tracing Major
@envelop/auth0 Major
@envelop/core Major
@envelop/dataloader Major
@envelop/opentelemetry Major
@envelop/preload-assets Major
@envelop/prometheus Major
@envelop/rate-limiter Major
@envelop/statsd Major
@envelop/types Patch
@envelop/on-resolve Major
@envelop/testing Major
@envelop/apollo-datasources Major
@envelop/apollo-federation Major
@envelop/apollo-server-errors Major
@envelop/depth-limit Major
@envelop/disable-introspection Major
@envelop/execute-subscription-event Major
@envelop/extended-validation Major
@envelop/filter-operation-type Major
@envelop/fragment-arguments Major
@envelop/generic-auth Major
@envelop/graphql-jit Major
@envelop/graphql-middleware Major
@envelop/graphql-modules Major
@envelop/immediate-introspection Major
@envelop/live-query Major
@envelop/newrelic Major
@envelop/operation-field-permissions Major
@envelop/parser-cache Major
@envelop/persisted-operations Major
@envelop/resource-limitations Major
@envelop/response-cache Major
@envelop/sentry Major
@envelop/validation-cache Major
@envelop/response-cache-redis Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@enisdenjo enisdenjo changed the base branch from main to saihaj/engine-agnostic-non-breaking September 13, 2022 09:38
@dimaMachina dimaMachina merged commit 7bc6412 into saihaj/engine-agnostic-non-breaking Sep 13, 2022
@github-actions
Copy link
Contributor

diff --git a/website/algolia-lockfile.json b/website/algolia-lockfile.json
index 9e359f52..d5281857 100644
--- a/website/algolia-lockfile.json
+++ b/website/algolia-lockfile.json
@@ -361,11 +361,6 @@
                 "children": [],
                 "title": "`onSchemaChange(api)`",
                 "anchor": "onschemachangeapi"
-              },
-              {
-                "children": [],
-                "title": "`onResolverCalled(api)`",
-                "anchor": "onresolvercalledapi"
               }
             ],
             "title": "`onPluginInit(api)`",

@theguild-bot
Copy link
Collaborator

❌ Benchmark Failed

Failed assertions detected: some GraphQL operations included in the loadtest are failing.

If the performance regression is expected, please increase the failing threshold.

     ✓ no_errors
     ✗ expected_result
      ↳  0% — ✓ 0 / ✗ 321828

     checks.............................................: 50.00%  ✓ 321828      ✗ 321828
     data_received......................................: 89 MB   596 kB/s
     data_sent..........................................: 139 MB  929 kB/s
     envelop_total......................................: avg=0s      min=0s      med=0s     max=0s       p(90)=0s     p(95)=0s     
     ✓ { mode:envelop-cache-jit }.......................: avg=0s      min=0s      med=0s     max=0s       p(90)=0s     p(95)=0s     
     ✓ { mode:envelop-just-cache }......................: avg=0s      min=0s      med=0s     max=0s       p(90)=0s     p(95)=0s     
     ✓ { mode:graphql-js }..............................: avg=0s      min=0s      med=0s     max=0s       p(90)=0s     p(95)=0s     
     ✓ { mode:prom-tracing }............................: avg=0s      min=0s      med=0s     max=0s       p(90)=0s     p(95)=0s     
     http_req_blocked...................................: avg=2.49µs  min=700ns   med=1.5µs  max=9.82ms   p(90)=2µs    p(95)=2.5µs  
     http_req_connecting................................: avg=376ns   min=0s      med=0s     max=9.76ms   p(90)=0s     p(95)=0s     
     http_req_duration..................................: avg=3.38ms  min=122µs   med=3.47ms max=216.37ms p(90)=5.26ms p(95)=6.43ms 
     ✓ { mode:envelop-cache-and-no-internal-tracing }...: avg=3.1ms   min=122µs   med=3.04ms max=45.63ms  p(90)=4.61ms p(95)=5.85ms 
     ✓ { mode:envelop-cache-jit }.......................: avg=3.2ms   min=132.9µs med=3.34ms max=35.13ms  p(90)=4.65ms p(95)=6.08ms 
     ✓ { mode:envelop-just-cache }......................: avg=3.16ms  min=142.9µs med=3.16ms max=216.37ms p(90)=4.65ms p(95)=5.99ms 
     ✓ { mode:graphql-js }..............................: avg=4.73ms  min=229.3µs med=4.95ms max=38.67ms  p(90)=6.31ms p(95)=8.05ms 
     ✓ { mode:prom-tracing }............................: avg=2.97ms  min=126.5µs med=2.86ms max=27ms     p(90)=4.64ms p(95)=5.94ms 
     http_req_failed....................................: 100.00% ✓ 321828      ✗ 0     
     http_req_receiving.................................: avg=36.81µs min=7.8µs   med=24.4µs max=30.12ms  p(90)=30.6µs p(95)=35.29µs
     http_req_sending...................................: avg=20.64µs min=4.59µs  med=8.8µs  max=36.73ms  p(90)=11.8µs p(95)=15.8µs 
     http_req_tls_handshaking...........................: avg=0s      min=0s      med=0s     max=0s       p(90)=0s     p(95)=0s     
     http_req_waiting...................................: avg=3.33ms  min=99.9µs  med=3.41ms max=216.35ms p(90)=5.2ms  p(95)=6.31ms 
     http_reqs..........................................: 321828  2145.366702/s
     iteration_duration.................................: avg=4.65ms  min=226.8µs med=3.8ms  max=997.28ms p(90)=5.56ms p(95)=7.08ms 
     iterations.........................................: 321828  2145.366702/s
     vus................................................: 10      min=9         max=20  
     vus_max............................................: 20      min=20        max=20  

@github-actions
Copy link
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@envelop/core 3.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/apollo-datasources 2.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/apollo-federation 3.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/apollo-server-errors 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/apollo-tracing 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/auth0 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/dataloader 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/depth-limit 2.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/disable-introspection 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/execute-subscription-event 3.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/extended-validation 2.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/filter-operation-type 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/fragment-arguments 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/generic-auth 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/graphql-jit 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/graphql-middleware 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/graphql-modules 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/immediate-introspection 1.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/live-query 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/newrelic 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/on-resolve 2.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/opentelemetry 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/operation-field-permissions 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/parser-cache 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/persisted-operations 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/preload-assets 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/prometheus 7.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/rate-limiter 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/resource-limitations 3.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/response-cache 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/response-cache-redis 2.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/sentry 4.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/statsd 3.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/validation-cache 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/testing 5.0.0-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎
@envelop/types 2.4.1-alpha-20220913094304-9b2d5c2a npm ↗︎ unpkg ↗︎

saihaj added a commit that referenced this pull request Oct 12, 2022
* feat: non-breaking GraphQL Engine

* feat: make envelop take in engine functions

* structural typings

* remove grapqhl as peer dep from types pkg

* make core more agnostic

* chore(dependencies): updated changesets for modified dependencies

* remove traced schema

* remove traced orchestrator

* make plugin agnostic

* drop EnvelopError

* remove more graphql import

* Drop useTiming

* make core completely free of graphql-js

* add eslint rule

* eslint disallow in types too

* more agnostic packages

* remove introspection util

* chore(dependencies): updated changesets for modified dependencies

* prettier

* TEMP: make bot calm down

* update all docs

* test matrix for core

* experimenting traced schema (#1501)

* experimenting traced schema

* Fix

* remove comment

* do optional chaining since we are not strongly typing

* document

* cleanup

Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>

* feat: drop node 12 (#1505)

* feat: remove `enableIf` utility (#1504)

* feat: remove enableIf utility

* make types happpy

* make types happy

* add changeset

* feat: remove async schema plugin and rename lazy loaded schema plugin (#1506)

* remove useAsyncSchema

* rename to useSchemaByContext

* add eslint rule (#1509)

* feat: `@envelop/on-resolve` plugin for hooking into schema resolvers (#1500)

* on resolve plugin

* changeset

* no more onResolverCalled

* unused import

* args is a record

* integrate and useOnResolve

* resolversHooksSymbol does not exist

* plugincontext for OnPluginInit

* on-resolve uses addPlugin

* onresolvercalled is no more

* refactor for new on-resolve

* fix open-telemetry tests

* fix newrelic

* opentelemetry graphql as peer dep

* tests

* addPlugin doesnt need to be used

* reorder

* respects onPluginInit context

* drop unused import

* fixes false positive eslint warnings

Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>

* docs: order of plugins matter (#1513)

* feat: remove handler for validation and parse errors (#1510)

* feat: remove hanlder for validation and parse errors

* tests

* make it work

* Add docs

* Fix serialization issue

* Go

* ..

* update docs

* update test

* make it work

* feat: add originalError in dev mode (#1514)

* remove Fn appendix

* name graphql error

* make ts happy

* make toJSON required

Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
Co-authored-by: Laurin Quast <laurinquast@googlemail.com>

* add changeset

* Update .changeset/nervous-seas-own.md

* Update .changeset/rude-cats-peel.md

* no-use-before-define (#1522)

* feat: trigger on context, validate and parse errors (#1511)

* feat: trigger on context, validate and parse errors

* trying

* make it work

* pass in phase

* add phase details

* feedback

* docs: migration guide (#1520)

* docs: migration guide

* remove slashes

* Update website/docs/guides/migrating-from-v2-to-v3.mdx

Co-authored-by: Denis Badurina <badurinadenis@gmail.com>

* feedback

* document removing of orchestrated tracer

* more feedback

* update docs

* update examples

* async schema example

Co-authored-by: Denis Badurina <badurinadenis@gmail.com>

* Add redirects

* remove deafult skip error from sentry plugin

* export masked error plugin

* sentry plugin default skip GraphQLError

* sentry: og error is not graphql error then send to sentry

* doc: drop introspection utils

* should fix ts issues on v15

* test: stack error we should not match the error name since it can be different across impl

* feat: use engine plugin (#1535)

* feat: use engine plugin

* remove assertion

* make useEngine plugin the only way to pass engine functions (#1536)

* make useEngine plugin the only way to pass engine fns

* update types

* update docs

* Update packages/plugins/apollo-datasources/README.md

Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>

* prettier:

Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>

Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>

* fix

* versioned docs with v3 default

* fix build

* fix

* feat this is cool

* docs reword schema tracing

* docs add graphql error example

* docs restructuring, fix typos

* chore remove autogenerated changeset

* cleanup changeset

* docs sycn patch

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Arda TANRIKULU <ardatanrikulu@gmail.com>
Co-authored-by: Denis Badurina <denis@domonda.com>
Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
Co-authored-by: Laurin Quast <laurinquast@googlemail.com>
Co-authored-by: Denis Badurina <badurinadenis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants