Skip to content

fix(typescript-estree): adds project service watch to add new files to project #9353

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

Conversation

higherorderfunctor
Copy link
Contributor

@higherorderfunctor higherorderfunctor commented Jun 14, 2024

PR Checklist

Overview

Currently extracting MVP solution from combined solution for multiple issues.

Current implementation is really basic: index watch request and trigger most specific. Some things I need to dig into:

  • recursive flags on directories
  • can watch options be used to optimize
  • index pruning
  • reduce nodes/search by collapsing nested dirs with watches
  • Verify delete handling.
  • verify what multiple requests for some resource with diff or same options looks like.
  • what am i getting for watch request? Just source? Package.json or tsconfigs?
  • What do i get from eslint as cli or lsp? Just sources?
  • can i send straight to inferred as optimization if i know the project structure?
  • Without actually watching tsconfigs I could end up with a bad project structure?
  • without actually watching node_modules or package.jsons/.locks i could also end up with a bad project structure?

Would be nice to hook into tsserver lsp some how since its duplicating a lot of work.

JoshuaKGoldberg and others added 30 commits April 22, 2024 16:23
…typescript-eslint#8834)

* feat(typescript-estree): remove slow deprecated and isolated programs

* Update packages/typescript-estree/src/create-program/createProjectProgram.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
typescript-eslint#8920)

* fix(typescript-estree): add TSEnumBody node for TSEnumDeclaration body

* Fixed up tests and their snapshots

* More about enums

* Indent too

* Update packages/ast-spec/src/special/TSEnumBody/spec.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* parent types touchups

* Update packages/visitor-keys/src/visitor-keys.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
…aint and key (typescript-eslint#7065)

* feat(typescript-estree): split TSMappedType typeParameter into constraint and key

* Aha, refactor to deduplicate - and fix property references

* Updated scope-manager snapshots

* Fixed snapshots, though not the bug

* Remove comment, oops

* Switch TSMappedType type visiting to be more manual

* Lint fixes

* Update packages/scope-manager/src/referencer/TypeVisitor.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* Avoided node.parent as directed

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
…t#8833)

* feat(eslint-plugin): remove formatting/layout rules

* Remove "layout"

* feat(typescript-estree): add defaultProject for project service (typescript-eslint#8815)

* feat(typescript-estree): add defaultProject for project service

* Thanks Jake, service.setCompilerOptionsForInferredProjects

* Cleaned up a bit and added happy path testing

* Update packages/typescript-estree/src/parser-options.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* feat(eslint-plugin): replace `no-new-symbol` with `no-new-native-nonconstructor` (typescript-eslint#8895)

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* Add tombstones

* 'deprecated' typo

* Let's mention both issues

* Fix unused variable issue

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
Co-authored-by: Dave <reduckted@outlook.com>
…ypescript-eslint#8832)

* feat(eslint-plugin): deprecate no-loss-of-precision extension rule

* baseRule.create, nice Kirk
* feat(typescript-estree): remove slow deprecated and isolated programs (typescript-eslint#8834)

* feat(typescript-estree): remove slow deprecated and isolated programs

* Update packages/typescript-estree/src/create-program/createProjectProgram.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* fix(typescript-estree): add TSEnumBody node for TSEnumDeclaration body (typescript-eslint#8920)

* fix(typescript-estree): add TSEnumBody node for TSEnumDeclaration body

* Fixed up tests and their snapshots

* More about enums

* Indent too

* Update packages/ast-spec/src/special/TSEnumBody/spec.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* parent types touchups

* Update packages/visitor-keys/src/visitor-keys.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* remove getTypeArguments

* one lil '

---------

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
…t-eslint#8934)

* feat(typescript-estree): remove slow deprecated and isolated programs (typescript-eslint#8834)

* feat(typescript-estree): remove slow deprecated and isolated programs

* Update packages/typescript-estree/src/create-program/createProjectProgram.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* fix(typescript-estree): add TSEnumBody node for TSEnumDeclaration body (typescript-eslint#8920)

* fix(typescript-estree): add TSEnumBody node for TSEnumDeclaration body

* Fixed up tests and their snapshots

* More about enums

* Indent too

* Update packages/ast-spec/src/special/TSEnumBody/spec.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* parent types touchups

* Update packages/visitor-keys/src/visitor-keys.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

---------

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* chore(type-utils)!: remove IsNullableTypeOptions interface

---------

Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
…owAutomaticSingleRunInference (typescript-eslint#8922)

* feat(typescript-estree): disallowAutomaticSingleRunInference, off (fast) by default

* Unnecessary Infinity cache lifetime too

* disallowAutomaticSingleRunInference in RuleTester

* Add more explicit disallowAutomaticSingleRunInference: true,s

* Fixed for parse.test.ts

* Fixed persistentParse.test.ts and semanticInfo.test.ts

* disallowAutomaticSingleRunInference in docs.test.ts

* Reset plugin .shot files

* Fix unit tests for Windows

* lint
…slint#8617)

* feat!(parser): always enable comment, loc, range, tokens

* fix: tests

* Smooth out the Object.assign

* test: added some more for parser, why not
…ypescript-eslint#8972)

* feat(utils): swap LegacyESLint out for FlatESLint as ESLint export

* eslint@v10 comment
…nt#9029)

* chore: fix v8 branch snapshots for flat-config-types

* Check in the rest of them too
typescript-eslint#9025)

* feat(utils): [RuleCreator] require specifying additional rule meta.docs

* test fix

* Explicit start and end types

* Fix lint failures

* lil more linting
…d no-empty-interfaces (typescript-eslint#8977)

* feat(eslint-plugin): split no-empty-object-type rule out from ban-types rule

* Mention no-props

* Update packages/eslint-plugin/docs/rules/no-empty-object-type.mdx

Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com>

* Update packages/eslint-plugin/docs/rules/no-empty-object-type.mdx

Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com>

* Allow in intersections, and touch up docs per suggestions

* Update packages/eslint-plugin/docs/rules/no-empty-object-type.mdx

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

* Trimming

* Update snapshots

* Finish removing Record

* Correct phrasing on Object

* Merge with no-empty-interface

* nit the tip

* Explicit report message for interfaces

* Add in-type-alias-with-name

* Switched to more general allowWithName

* snapshot -u

* snapshot -u

* Fixed up unit tests

* Update packages/eslint-plugin/docs/rules/no-empty-object-type.mdx

Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>

* docs touchups from Kirk

* replacedBy too

---------

Co-authored-by: Kirk Waiblinger <53019676+kirkwaiblinger@users.noreply.github.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>
* feat: support ESLint 9

* Fix some eslint-plugin tests

* Re-add v8 and remove unnecessary peerDependencies

* Fix no-unused-vars test rule

* Updated snapshots

* put back tmp@0.2.1

* Fixed linting by disabling plugins temporarily

* Update two more integration snapshots for no-unused-vars

* Ugh, missing "

* Remove legacy rule function form

* Fix legacy-config test to actually use legacy config

* Revert "Remove legacy rule function form"

This reverts commit e053179.

* Update ESLint 8/9 RuleCreateFunction comments

* Start reverting the local dev changes

* Some more reverts

* oopsies comment level

* yarn test -u the integration tests

* regenerate yarn.lock

* yarn dedupe, and undo some eslint.config changes

* Remove extra node:

* Finally revert nodeType changes

* one more deprecation fix

* Update eslint-plugin schemas snapshot

* Annoying tmp version update

* Add eslint_v9_tests

* Fix yarn.lock
JoshuaKGoldberg and others added 18 commits May 29, 2024 10:53
* fix(rule-tester): re-apply updates from main

* Undo removals

* Redo removals
…eslint#9207)

* remove no-useless-template-literals rule

* fix no-useless-template-literals docs

* revert removal

* keep as tombstone page

* fix doc

* fix docs test

* fix doc
…ls' option (typescript-eslint#9234)

* feat(eslint-plugin): [no-floating-promises] add 'allowForKnownSafePromiseReturns' option

* test: always with the snapshots

* fix unit test file relativity

* Add .then test

* Update option name: allowForKnownSafeCalls

* Add .finally test
…ParserOptions (typescript-eslint#9287)

* feat(typescript-estree): also remove projectService in withoutProjectParserOptions

* ...I could have sworn I checked in this file too
…nsafe-function-type, no-wrapper-object-types (typescript-eslint#9102)

* feat(eslint-plugin): add no-restricted-types, no-uppercase-alias-types rules

* Fix lint issues

* Apply suggestions from code review

Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>

* Kirk suggestions

* yarn test -u

* test: fix tests for useProgramFromProjectService

* Rename to no-wrapper-object-types

* excess myObject in docs

* Fix rules/index.ts

* Clarify ban-types deprecation message

* Remove ban-types altogether

* fix website build with permalink to ban-types

* Update configs

* Apply suggestions from code review

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* fix ban-types.md

* Update packages/eslint-plugin/docs/rules/no-wrapper-object-types.mdx

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

* lil nit

* remove callable type

* Split out no-unsafe-function-type too

* fix /blog link in ban-types.md

* Mention args: never

* Regenerate configs

* lil phrasing nit

* chore: fix snapshot

* fix lint complaint

* Address feedback

* Apply suggestions from code review

Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>

* Mention concepts and equality

* fix: scope analysis

* ban-types.md rule mentions

* fix no-restricted-types docs test

* wrong list, kronk

---------

Co-authored-by: Kirk Waiblinger <kirk.waiblinger@gmail.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @higherorderfunctor!

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 on https://opencollective.com/typescript-eslint.

Copy link

netlify bot commented Jun 14, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit d3c3b25
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/667762e58b59f00008f18dd7
😎 Deploy Preview https://deploy-preview-9353--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

nx-cloud bot commented Jun 14, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d3c3b25. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@JoshuaKGoldberg
Copy link
Member

Closing this out to keep the PR queue small - thanks again for all your work on this! ❤️

If it ends up we do need to add watch logic to the project service, we can always re-open.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet