-
-
Notifications
You must be signed in to change notification settings - Fork 1
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: add tooling config #42
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the yaml override necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary since 2 is the default. Nice catch 👍
}, | ||
]; | ||
|
||
module.exports = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you ran prettier, where any of the source files significantly changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -13,7 +13,8 @@ | |||
"rootDir": "./", | |||
"baseUrl": ".", | |||
"paths": { | |||
"*": ["types/*"] | |||
"*": ["types/*"], | |||
"@/*": ["./*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work for nested source files with relative imports from sibling or cousin directories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works in any ts or js files in the source tree.
}, | ||
]; | ||
|
||
module.exports = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
format
for runningprettier
folowed byeslint
for 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