Skip to content

ensure js/ts codeblocks in markdown doesn't contain syntax errors + lint them with ESLint #356

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dimaMachina
Copy link
Contributor

No description provided.

fixes

fixes

fixes

import sort

prefer const

ban types

no var

eqeqeq

no array constructor

prefer const

fixes

fixes

fixes

import sort

prefer const

last fixes

prettier
@dimaMachina dimaMachina requested a review from a team as a code owner April 26, 2023 15:30
id: Bytes
logs: string[]
receiptIds: Bytes[]
tokensBurnt: bigint
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript-eslint suggests replacing BigInt with bigint
image

"test": "graph test",
...
"test": "graph test"
//...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//...
// ...


beforeEach(() => {
let gravatar = new Gravatar("0x0")
gravatar.displayName = “First Gravatar”
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no more illegal

Comment on lines -837 to +853
assert.equals(ethereum.Value.fromString("hello"); ethereum.Value.fromString("hello"));
assert.equals(ethereum.Value.fromString('hello'), ethereum.Value.fromString('hello'))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be ,

@@ -89,36 +90,38 @@ async function getDomainNames() {

// The first query will get the first page of results and also get the block
// hash so that the remainder of the queries are consistent with the first.
const listDomainsQuery = `
const listDomainsQuery = /* GraphQL */ `
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it always better adds special comment /* GraphQL */ for graphql documents, so prettier will prettify them and graphql-eslint could validate even in markdown

@github-actions
Copy link

📦 Next.js Bundle Analysis for @graphprotocol/docs

This analysis was generated by the Next.js Bundle Analysis action. 🤖

Eight Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/en/cookbook/near 9.49 KB 600.51 KB 171.57% (+/- <0.01%)
/en/cookbook/subgraph-debug-forking 6.95 KB 597.97 KB 170.85% (+/- <0.01%)
/en/developing/assemblyscript-api 16.09 KB 607.11 KB 173.46% (🟡 +0.01%)
/en/developing/creating-a-subgraph 24.77 KB 615.79 KB 175.94% (+/- <0.01%)
/en/developing/unit-testing-framework 16.62 KB 607.64 KB 173.61% (🟢 -0.05%)
/en/querying/distributed-systems 6.8 KB 597.82 KB 170.81% (+/- <0.01%)
/en/querying/querying-from-an-application 7.17 KB 598.19 KB 170.91% (+/- <0.01%)
/en/release-notes/assemblyscript-migration-guide 10.35 KB 601.37 KB 171.82% (🟡 +0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.


x + y // give compile time error about nullability
console.log(x + y) // give compile time error about nullability
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added console.log to omit eslint error about unused expression

Comment on lines -562 to +569
newGravatarEvent.parameters = new Array()
let idParam = new ethereum.EventParam('id', ethereum.Value.fromI32(id))
let addressParam = new ethereum.EventParam(
newGravatarEvent.parameters = []
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replaced new Array() with []

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is AssemblyScript and I think we need to declare it like that https://www.assemblyscript.org/stdlib/array.html#array

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.

2 participants