feature: add tooling config#42
Conversation
…o source files can use absolute imports instead of relative imports
| @@ -1,6 +1,6 @@ | |||
| { | |||
| "compilerOptions": { | |||
| "module": "commonjs", | |||
There was a problem hiding this comment.
As we talked about earlier, I don't think we can change this without first verifying its impact on older browsers. I'm not sure if/how esbuild will transpile esnext modules for the browser.
| options: { | ||
| tabWidth: 2, | ||
| }, | ||
| }, |
There was a problem hiding this comment.
Is the yaml override necessary?
There was a problem hiding this comment.
It's not necessary since 2 is the default. Nice catch 👍
| }, | ||
| ]; | ||
|
|
||
| module.exports = { |
There was a problem hiding this comment.
When you ran prettier, where any of the source files significantly changed?
There was a problem hiding this comment.
I didn't - it's bad practice to commit formatting changes along with a PR that introduces actual changes; applying formatting would be a future PR.
| "paths": { | ||
| "*": ["types/*"] | ||
| "*": ["types/*"], | ||
| "@/*": ["./*"] |
There was a problem hiding this comment.
Does this work for nested source files with relative imports from sibling or cousin directories?
There was a problem hiding this comment.
It works in any ts or js files in the source tree.
| }, | ||
| ]; | ||
|
|
||
| module.exports = { |
There was a problem hiding this comment.
Are these settings consistent with the airbnb styles enforced by eslint? (Is there an airbnb plugin for prettier? [Are there plugins for prettier? 😅])
There was a problem hiding this comment.
I don't know, honestly. However, the format npm script runs eslint after prettier, so the airbnb rules would be enforced afaik. And yes, prettier does have plugins 😄
This PR adds a more robust tooling configuration:
formatfor runningprettierfolowed byeslintfor optimal formattingESNext(it's 2024, commonJS is so 2023)@as a typescript path reference to allow for absolute imports within source filesimport * from @/...in one typescript file to start