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

Make it easier for trial and error to apply user scripts #262

Open
mizdra opened this issue Feb 5, 2023 · 1 comment
Open

Make it easier for trial and error to apply user scripts #262

mizdra opened this issue Feb 5, 2023 · 1 comment
Labels
Type: Feature New Feature

Comments

@mizdra
Copy link
Owner

mizdra commented Feb 5, 2023

  • eslint-interactive has several actions to fix problems using user scripts (e.g. "Apply suggestions", "Make forcibly fixable and run eslint --fix").
  • The operation flow of these actions is as follows
    1. When the user launches an action, a temporary file is opened in the editor for writing the user script.
    2. The user edits the temporary file
    3. When the temporary file is closed in the editor, eslint-interactive uses the user script to fix the problem.
  • If the behavior of the user script is not as expected, the flow must be redone from the beginning.
    • This makes trial-and-error difficult.
  • So we would like to make trial-and-error easier.
@mizdra mizdra added the Type: Feature New Feature label Feb 5, 2023
@mizdra
Copy link
Owner Author

mizdra commented Feb 5, 2023

My idea:

  • Apply user script when the file is saved, not when the file is closed
    • When the file is saved again, undo and re-execute the user script.
    • This allows the user to quickly repeat the loop of checking the behavior of user script and modifying it.
  • Write the stdout of user script to a temporary file (e.g. node_modules/.cache/eslint-interactive/x.y.z/user-script-output.txt).
    • This allows users to easily see the debug output of user script using tail -f node_modules/.cache/eslint-interactive/x.y.z/user-script-output.txt.

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

No branches or pull requests

1 participant