Linkta-org / core

Core Repo for MVP
MIT License
5 stars 10 forks source link

Create contribution guidelines #232

Closed ejwoods closed 2 months ago

ejwoods commented 3 months ago

Description

Open Source repositories often have guidelines for how contributors can work on the project. We should create a CONTRIBUTING.md file that outlines this process for any potential or current Linkta contributors. See more here: https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors

More detail

The specific impetus for this issue is that @relandboyle and I tracked down an issue I was having post-app-split where my ESLint extension was false-flagging the error: Parsing error: Cannot read file '/absolute/path/to/Core/tsconfig.json' at the first import statement in basically every file. Essentially, the problem was that although we had correctly set up our separate ESLint configs in the server and client directories - which allowed ESLint to run correctly without hitting this error - the extension was unaware of this and falsely alerting me that this error would occur when I ran ESLint.

The solution is to configure the eslint.workingDirectories setting in VS Code settings. I set this in my workspace settings for the Core repo by adding the following line to my .vscode/settings.json at the root of the repository:

"eslint.workingDirectories": [ "./client", "./server" ]

This informs the extension of our app’s file structure so that it can properly anticipate the behavior of the ESLint module itself.

While the experience of figuring this out was extremely enlightening, it took us a while to reach this conclusion and I think it warrants a mention in our contribution guidelines.

Acceptance Criteria

Subtasks

relandboyle commented 3 months ago

Strongly agree. Thank you for writing this up.

ejwoods commented 3 months ago

Potential for an added setting here - might need to add changeProcessCWD to options:

  "eslint.workingDirectories": [
    { "directory": "./client", "changeProcessCWD": true },
    { "directory": "./server", "changeProcessCWD": true }
  ],

Related issue here: https://github.com/microsoft/vscode-eslint/issues/656

ejwoods commented 3 months ago

Looks like since version 2.0.4, 'the extension now changes the working directory by default.' So explicitly setting changeProcessCWD is probably no longer necessary. Release notes here.