Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
| node?: Ranged | null | undefined, | ||
| beforeCount?: number | null | undefined, | ||
| afterCount?: number | null | undefined, | ||
| node?: Ranged, | ||
| beforeCount?: number, | ||
| afterCount?: number, |
There was a problem hiding this comment.
This may just be my lack of TS knowledge, but without | null | undefined doesn't that make things like this illegal:
sourceCode.getText(null);
sourceCode.getText(null, null, null);
sourceCode.getText(undefined);Accepting these can be useful in cases like:
const node = someCondition ? someNode : null;
const text = sourceCode.getText(node);Currently I think we haven't enabled "strict" TS check, but I think we want to in future (and even if we don't, presumably user may enable strict option, and we want our types to support that).
There was a problem hiding this comment.
sourceCode.getText(null);
sourceCode.getText(null, null, null);
sourceCode.getText(undefined);
Yes this wouldn't be allowed, but you could just pass in undefined e.g.
sourceCode.getText(undefined)
sourceCode.getText(undefined, undefined, undefined);
This change also makes it closer to eslint's exact api
There was a problem hiding this comment.
I would prefer a closer solution to the eslint API.
But maybe you want to introduce a helper type to make it cleaner, something like:
type NullishAble<T> = T | null | undefined;
32edd39 to
6f5e182
Compare
40dd640 to
e8fc078
Compare
54947e0 to
d07da8e
Compare
d07da8e to
9e54002
Compare
6f5e182 to
d838d5e
Compare
d838d5e to
633d9d2
Compare
|
Please can we hold off on this until I'm back in "office" after break? I'm unsure about the removal of |
|
Closing in favour of #15887. |
2nd try at #14573. Run oxlint on oxlint. Linter inception.
2nd try at #14573. Run oxlint on oxlint. Linter inception.
2nd try at oxc-project#14573. Run oxlint on oxlint. Linter inception.

No description provided.