Create-react-app: Decide on typescript-eslint project property for 3.0

Created on 16 Mar 2019  路  4Comments  路  Source: facebook/create-react-app

It sounds like setting the project property on typescript-eslint parser options has a significant performance impact (https://github.com/typescript-eslint/typescript-eslint/issues/243). Setting this property is important to enable the use of rules that require type info.

There is one rule we have enabled that i'm not clear if it requires type info or not (@typescript-eslint/no-unused-vars). The TSLint equivalent (https://palantir.github.io/tslint/rules/no-unused-variable/) requires type info.

We should determine whether @typescript-eslint/no-unused-vars requires type info and use this info to decide whether to keep the project property set. There will likely be more rules that we will want to enable down the road that require type info, but hopefully by that time the performance issues will be sorted.

needs investigation

Most helpful comment

https://github.com/typescript-eslint/typescript-eslint/pull/367 was just merged which apparently greatly improved lint times. However I agree probably best to comment it out for now until we introduce a rule that requires type info, and hopefully by that time any performance issues remaining if any are sorted.

All 4 comments

It looks like it doesn't require type information, see this test repository I created.

This can be backed up by looking at the code too; any rules requiring type info call getParserServices to get access to the type checker, and no-unused-vars does not call this method.

This can be backed up by looking at the code too; any rules requiring type info call getParserServices to get access to the type checker

Thanks @jackwilsdon! That's a great tip to know if a given rule requires type info.

I'm hoping https://github.com/typescript-eslint/typescript-eslint/pull/360 will get merged so it's obvious in the docs.

Since none of the rules we're currently using require type info we should remove this property for the time being. We can add it back when we need it and hopefully the performance issues will be fixed by then.

https://github.com/typescript-eslint/typescript-eslint/pull/367 was just merged which apparently greatly improved lint times. However I agree probably best to comment it out for now until we introduce a rule that requires type info, and hopefully by that time any performance issues remaining if any are sorted.

Was this page helpful?
0 / 5 - 0 ratings