Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat(typescript-estree): added allowInvalidAST option to not throw on invalid tokens#6247
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat(typescript-estree): added allowInvalidAST option to not throw on invalid tokens#6247
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Thanks for the PR,@JoshuaKGoldberg! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint. |
nx-cloudbot commentedDec 18, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
netlifybot commentedDec 18, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview fortypescript-eslint ready!
To edit notification comments on pull requests, go to yourNetlify site settings. |
codecovbot commentedDec 23, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@## v6 #6247 +/- ##==========================================- Coverage 87.81% 87.72% -0.09%========================================== Files 365 365 Lines 12455 12479 +24 Branches 3669 3679 +10 ==========================================+ Hits 10937 10947 +10- Misses 1158 1170 +12- Partials 360 362 +2
Flags with carried forward coverage won't be shown.Click here to find out more.
|
JoshuaKGoldberg commentedDec 23, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I'm not so sure this is the right approach to fixing the issue. It'd be hard to add branching logic forevery possible syntactic issue not reported as such by TypeScript. Instead, I'll look at using our isolated program to catch them. Let this PR serve as a reference for what this logiccould look like. 🙂 Edit: the isolated program is too slow. We're going with this! 🚀 |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
...ges/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/config.ts OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
PR Checklist
Overview
Adds an opt-in
allowInvalidAST
option to@typescript-eslint/typescript-estree
and@typescript-eslint/parser
. It enables checks for some known cases where TypeScript reports a syntactic issue as semantic:no-restricted-exports
: Cannot read property 'name' of null eslint/eslint#15384)indent
throws TypeError: Cannot read property 'loc' of undefined eslint/eslint#14538)Note that some previously reported cases seem to now be reported as syntactic issues by TypeScript:
export
(Results of weekly scheduled smoke test jsx-eslint/eslint-plugin-react#3178)import
(Parsing: strictly enforce the produced AST matches the spec and enforce most "error recovery" parsing errors #1852 (comment))throw
(Handle throw with no arguments in no-throw-literal eslint/eslint#13143)Does not tackle more difficult cases:
async
inside a non-async function ([Bug]await
on non-async function does not throw an error #2997)abstract
members markedasync
(TypeScript 4.1 Syntax Support #2583 (comment))in
on a primitive (TypeScript 4.2 Syntax Support #2935 (comment))MethodDefinition
(readonly
anddeclare
invalid property forMethodDefinition
. #2908 (comment))