Skip to content

chore: add vscode shared config files #126

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

Merged
merged 4 commits into from
Jan 23, 2019
Merged

chore: add vscode shared config files #126

merged 4 commits into from
Jan 23, 2019

Conversation

bradzacher
Copy link
Member

  • add a launch config for debugging the plugin: runs the test for the currently opened file.
  • add shared config to make sure everyone's eslint plugin works correctly, and to correctly setup the typescript env
  • add extension config to help tell users about what extensions work well with this codebase:
    • recommend plugins:
      • eslint
      • editorconfig
      • prettier
    • advise against:
      • beautify
      • jshint

@JamesHenry
Copy link
Member

The launch.json is really cool and I haven't actually used that feature in VSCode yet.

Thinking about it, is there any reason why we can't expand this out to be generic across the project? If it works by configuring jest to work on the current file, and all the packages use jest, the same could apply to them right?

@bradzacher
Copy link
Member Author

Yeah launch.json is suuuper powerful. All you need to do with this config is hit F5, and it'll pickup and run the tests for the open rule. So nice!

I'm not sure if we can have a single launch config across the entire repo because

  1. Each package has its own jest.config.js, so we need to switch the CWD at launch time to make sure jest runs the correct things.

This is easily solvable if we standardise into a single root jest.config.js across our packages.
This would also make it so you can run yarn jest in the root and have it automatically run all of the tests in the repo.

  1. Each package has its own folder structure.

I don't think that vscode's variables system supports transforms. This means that you can't arbitrarily transform the current path into a test path for the given package.
Notice how I've hardcoded the rules test folder? We'd probably have to setup 4 launch rules which does this for each of the packages

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

Successfully merging this pull request may close these issues.

2 participants