Conversation
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
| matrix: | ||
| dependencyStartsWith: | ||
| - spark-evaluate | ||
| - '@checkernetwork/prettier-config' |
There was a problem hiding this comment.
Should be added to ..-auto-approve-minor.yml, as we don't want to auto approve breaking changes
There was a problem hiding this comment.
Let's discuss in CheckerNetwork/spark-checker#133 (comment)
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
| const providers = /** | ||
| * @type {{ | ||
| * AddrInfo: { | ||
| * ID: string | ||
| * Addrs: string[] | ||
| * } | ||
| * LastAdvertisement: { | ||
| * '/': string | ||
| * } | ||
| * LastAdvertisementTime: string | ||
| * Publisher: { | ||
| * ID: string | ||
| * Addrs: string[] | ||
| * } | ||
| * // Ignored: ExtendedProviders, FrozenAt | ||
| * }[]} | ||
| */ (await res.json()) |
There was a problem hiding this comment.
TypeScript does not recognise this syntax; it parses the type definition as a singular object, not as an array of objects. This is most likely a bug in prettier-plugin-jsdoc.
I am going to check if this can be fixed via tsdoc: true config - https://github.com/hosseinmd/prettier-plugin-jsdoc?tab=readme-ov-file#tsdoc
There was a problem hiding this comment.
I could not find any relevant configuration for prettier-plugin-jsdoc to fix this problem.
In 8af003f, I added prettier-ignore comment.
I am not sure which of these two options is better - move the type definition to typings.d.ts (535d54f) or disable prettier formatting (8af003f).
@juliangruber WDTY?
There was a problem hiding this comment.
Could we have a file indexer/lib/ipni-watcher.d.ts, just like there's C header and implementation files? I'm not the biggest fan of a central types definition. But if what I proposed isn't an option, I'd vote for moving the type to typings.d.ts
There was a problem hiding this comment.
AFAIK, you cannot have a .d.ts file with the same name as another .js file. How about creating a dedicated typing file for the IPNI API? That way we can eventually extract this typings file into a package we can share among many repositories.
See f7ee4bb
| }) | ||
|
|
||
| it('handles Fetch errors and explains the problem in the status', async () => { | ||
| it.skip('handles Fetch errors and explains the problem in the status', async () => { |
There was a problem hiding this comment.
This test is failing on my machine, and I could not find any quick fix. I'd like to investigate the problem after I land this PR.
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
| }) | ||
|
|
||
| it('handles timeout errors and explains the problem in the status', async () => { | ||
| it.skip('handles timeout errors and explains the problem in the status', async () => { |
There was a problem hiding this comment.
This test is failing on my machine, and I could not find any quick fix. I'd like to investigate the problem after I land this PR.
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
|
@juliangruber LGTY now? |
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Adopt the new neostandard & prettier configuration.
I split the changes into multiple commits to make this pull request easier to review. The second commit contains linting fixes automatically generated by eslint and prettier:
npm run lint:fixParent issue: