Skip to content

[FEAT] Accept a glob pattern for options.project #803

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

Closed
teoxoy opened this issue Aug 5, 2019 · 5 comments · Fixed by #806
Closed

[FEAT] Accept a glob pattern for options.project #803

teoxoy opened this issue Aug 5, 2019 · 5 comments · Fixed by #806
Labels
enhancement New feature or request package: typescript-estree Issues related to @typescript-eslint/typescript-estree

Comments

@teoxoy
Copy link
Contributor

teoxoy commented Aug 5, 2019

Original discussion started here: #624 (comment)

@teoxoy teoxoy added package: typescript-estree Issues related to @typescript-eslint/typescript-estree triage Waiting for team members to take a look labels Aug 5, 2019
@teoxoy
Copy link
Contributor Author

teoxoy commented Aug 5, 2019

Following up from #624 (comment)

If you provide project, then it requires node because of the typescript compiler.
Otherwise it doesn't require node.
Hence astexplorer.net works without a project.
We'd have to do some work to make it work fine in the browser with a project.

@bradzacher
@uniqueiniquity

Should the glob functionality therefore go in the parser package because typescript-estree is independent of Node?

@bradzacher bradzacher added enhancement New feature or request and removed triage Waiting for team members to take a look labels Aug 5, 2019
@bradzacher
Copy link
Member

Unless I'm mistaken, parser doesn't actually care about the tsconfig, and just passes it down to typescript-estree.

I would put it into typescript-estree so that both packages can take advantage of the functionality.

@teoxoy
Copy link
Contributor Author

teoxoy commented Aug 5, 2019

Hence astexplorer.net works without a project.

I understood this wrong, I thought astexplorer.net uses typescript-estree but it uses acorn hence I asked the question.

We'd have to do some work to make it work fine in the browser with a project.

Now this makes sense lol
I need some sleep


So the bottom line is that Node independence might be something to be dealt with in the future and for now I will go ahead and add the glob pattern functionality in typescript-estree

@bradzacher
Copy link
Member

I thought astexplorer.net uses typescript-estree but it uses acorn hence I asked the question.

astexplorer.net does in fact use typescript-estree, though it is intrinsically via parser when you select our parser from the list.

it doesn't pass project in to parser, so parser/typescript-estree just parses the source code as given, as opposed to trying to use typescript to read the file from disk.

@teoxoy
Copy link
Contributor Author

teoxoy commented Aug 5, 2019

Oh, I see. I overlooked the fact that the parser could be changed (I expected the place where it mentions the parser name to be a dropdown)

/**
* Generate a full ts.Program in order to be able to provide parser
* services, such as type-checking
*/
const shouldProvideParserServices =
extra.projects && extra.projects.length > 0;

I should have looked at the code.
Although shouldProvideParserServices means something else in my head. 😆

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants