Skip to content
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

[Feature Request] Restart server on config change #143

Closed
lachieh opened this issue Mar 21, 2024 · 3 comments
Closed

[Feature Request] Restart server on config change #143

lachieh opened this issue Mar 21, 2024 · 3 comments

Comments

@lachieh
Copy link

lachieh commented Mar 21, 2024

I've noticed that changing settings in the config means a restart of the server is required to see the changes. It would be good to watch the following files in all subfolders and restart the server automatically on save:

  • package.json
  • tsconfig.json
  • .xo-config
  • xo-config.json
  • .xo-config.js
  • xo.config.js
  • .xo-config.cjs
  • xo.config.cjs

This would also have the benefit of resolving #140 because a change to the the dependencies in the package.json would also trigger a refresh.

@spence-s
Copy link
Collaborator

spence-s commented Mar 22, 2024

@lachieh thanks for this, this is already planned for an upcoming release due to findings #142 and #140

I've been slow to make this change because restarting the server is very slow compared to just re-loading xo/eslint (which is what we do now) but with all the caching issues it is seeming like this is probably the most reliable way.

@lachieh
Copy link
Author

lachieh commented Mar 22, 2024

Understood. Thanks for the insight. Feel free to close this issue and track on one of the others 👍🏻 thanks again.

Perhaps a setting to change the watch behavior would be beneficial. i.e. restart server, reload config or manual/off. That way users who have slower machines can select one of the lighter options if they experience performance issues.

@spence-s
Copy link
Collaborator

spence-s commented Mar 25, 2024

Ok in v3.20.0 we restart the server and that should fix all of these problems. If it ends up being a performance problem well add the option back in for faster restarts for at least the json configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants