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
Enhance TokenStore methods with includeComments option #8068
Closed
kaicataldo opened this issue
Feb 12, 2017
· 2 comments
· Fixed by renovatebot/renovate#111 · May be fixed by iamhunter/teammates#4
Closed
Enhance TokenStore methods with includeComments option #8068
kaicataldo opened this issue
Feb 12, 2017
· 2 comments
· Fixed by renovatebot/renovate#111 · May be fixed by iamhunter/teammates#4
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
Comments
kaicataldo
added
breaking
This change is backwards-incompatible
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
tsc agenda
This issue will be discussed by ESLint's TSC at the next meeting
and removed
triage
An ESLint team member will look at this issue soon
labels
Feb 12, 2017
Actually, interface CountOptions {
includeComments?: boolean
filter?: (token: Token|Comment) => boolean
count?: number
}
interface TokenStore {
//...
getTokens(node: Node): Token[]
getTokens(node: Node, beforeCount: number, afterCount: number): Token[]
getTokens(node: Node, filter: (token: Token) => boolean): Token[]
getTokens(node: Node, options: CountOptions): (Token|Comment)[]
getTokensBetween(left: Node|Token|Comment, right: Node|Token|Comment): Token[]
getTokensBetween(left: Node|Token|Comment, right: Node|Token|Comment, padding: number): Token[]
getTokensBetween(left: Node|Token|Comment, right: Node|Token|Comment, filter: (token: Token) => boolean): Token[]
getTokensBetween(left: Node|Token|Comment, right: Node|Token|Comment, options: CountOptions): (Token|Comment)[]
} |
kaicataldo
removed
breaking
This change is backwards-incompatible
tsc agenda
This issue will be discussed by ESLint's TSC at the next meeting
labels
Feb 12, 2017
@mysticatea Ah, sorry then - thanks for the explanation. I'd still like to propose the change to |
kaicataldo
added a commit
that referenced
this issue
Feb 12, 2017
kaicataldo
added a commit
that referenced
this issue
Feb 14, 2017
kaicataldo
added a commit
that referenced
this issue
Feb 14, 2017
This was referenced Feb 20, 2017
pantosha
pushed a commit
to pantosha/eslint
that referenced
this issue
Feb 21, 2017
… (eslint#8069) * Update: Add includeComments to getTokenByRangeStart (fixes eslint#8068) * Remove @Private from public methods
eslint-deprecated
bot
added
the
archived due to age
This issue has been archived; please open a new issue for any further discussion
label
Feb 6, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
core
Relates to ESLint's core APIs and features
enhancement
This change enhances an existing feature of ESLint
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
Having used the new TokenStore token traversal methods this week (while working on this PR), I think we should add an
includeComments
option to the following:getTokenByRangeStart()
,getTokens()
, andgetTokensBetween()
.The API I'm envisioning is:
The proposed change to
getTokenByRangeStart()
is not a breaking change, but the other two are (though I suppose we could do this in a backwards compatible manner still). I'd ideally like to usegetTokens
in the aforementioned PR here.Also wanted to note that the
beforeCount
,afterCount
, andpadding
options are all undocumented and look like they were included to avoid a breaking change.cc @mysticatea
The text was updated successfully, but these errors were encountered: