-
Notifications
You must be signed in to change notification settings - Fork 27
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
Port the eslint config from UDR and next-hashicorp #2704
Conversation
Porting the linting setup from UDR was deemed to be easier and faster than attempting to modify `hashicorp-next`, republish and then try to integrate the new package version. The eslint config from UDR was written as an esmodule in order to use things like import - so a straight copy and paste wasn't possible. But with a little massaging (i.e: swapping out `import` for require) it seems to work in a rudimentary sense. Additionally, some tweaks had to be made to package.json to uninstall `hashicorp-next` and remove references to it in pre-commit hooks(in order to be able to commit) Finally the old rules from next-hashicorp were ported over in attempt to resolve lint issues and bring the lint rules in line with the current code style in devdot
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
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.
Overall this LGTM, just added a few comments about ignored directories in the eslint config file
eslint.config.js
Outdated
'.next', | ||
'**/dist', | ||
'eslint.config.js', | ||
'content', |
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.
dev-portal doesn't have a content
directory so I think this can be removed
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.
Good point! I guess my rip was more shameless than I thought :p
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.
Fixed that in d3d638b
eslint.config.js
Outdated
'eslint.config.js', | ||
'content', | ||
'public', | ||
'vitest.config.mjs', |
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.
The vitest config file in dev-portal ends in mts
instead of mjs
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.
Fixed in a2b1e45
Devdot does not have a content directory, so there's no need to have it in the ignore list
The vitest config file has an extension of `.mts`, not `.mjs`
π Relevant links
ποΈ What
This PR is the first of several aimed to rectify the broken linting setup in devdot which has been the cause of at least one incident recently. The intent is to bring together multiple PRs (starting with this one) on to an assembly branch (
rm/fix-linting
) and then PR from there intomain
. This helps to reduce the size of each PR as well as getting multiple eyes and reviews on the changes being made.π€· Why
This is an initial attempt to rectify the broken linting on dev dot by first bringing in the eslint config.
π οΈ How
Porting the linting setup from UDR was deemed to be easier and faster than attempting to modify
hashicorp-next
, republish and then try to integrate the new package version.The eslint config from UDR was written as an esmodule in order to use things like import - so a straight copy and paste wasn't possible. But with a little massaging (i.e: swapping out
import
for require) it seems to work in a rudimentary sense.Additionally, some tweaks had to be made to package.json to uninstall
hashicorp-next
and remove references to it in pre-commit hooks(in order to be able to commit)Finally the old rules from next-hashicorp were ported over in attempt to resolve lint issues and bring the lint rules in line with the current code style in devdot