-
Notifications
You must be signed in to change notification settings - Fork 923
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
USWDS - Dependencies: Update eslint, prettier, stylelint and dependencies #5782
Conversation
Thanks for submitting this! Adding to 3.9.0 milestone and noting that |
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.
Thanks for your work here @anselmbradford! Do you have any availability to pull the latest from USWDS devlop and resolve the merge conflicts?
Additionally, I see the following message when running the lint:sass
script:
`output` is deprecated. Use `report` or `code` instead.
It looks like this could be resolved by replacing output
with report
on lintSass.js
Lines 42 to 53 in 98566ec
async function lintSass(callback) { | |
const { errored, output } = await stylelint.lint({ | |
files: [ | |
`${PROJECT_SASS_SRC}/**/*.scss`, | |
`!${PROJECT_SASS_SRC}/uswds/**/*.scss`, | |
`!${PROJECT_SASS_SRC}/uswds-elements/lib/**/*.scss`, | |
], | |
formatter: "string", | |
}); | |
callback(errored ? new Error(output) : null); | |
} |
If you could make those changes it'd help us get this into the design system quicker! But if not, let us know and we'll create a new PR with your contribution 👍
Adding trailing commas to all multi-line statementsThe new version of prettier updates the This blog post is a quick and easy read that outlines the benefit of adding these trailing commas. After reading it, I'm lean towards keeping the new standard for our code styles. If we decide we don't want to keep the trailing commas for all lines, we can create a |
@mahoneycm I'll aim to update this soon. May not be able to get to it today though. |
@anselmbradford no immediate rush! I appreciate your work and the response 👍 |
f2408c3
to
5c95774
Compare
@mahoneycm I've updated this. There seems to be a circle ci failure that looks unrelated to this PR? ![]() EDIT: actually, I regenerated the package-lock.json and there are changes, so let's see how 8f0d5b2 fares. EDIT2: Hmm, nope didn't help. Do you see what I am missing? |
Hey there @anselmbradford, This was tricky but it looks like it can be resolved by installing Lines 25373 to 25382 in 519108c
I was able to confirm that we have the You can add it to your
After this, I was able to install, build, and start the project without error 👍 |
@mahoneycm Thanks! Updated the PR (and also ran some Prettier fixes I missed) |
Thanks for these updates @anselmbradford ! Planning to discuss our position on the trailing commas on all lines today and will be able to update this PR with our decision by EOD |
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.
Question on the decision behind the stylelint config change, otherwise LGTM.
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.
Lgtm! Thanks for your effort here and the quick respones @anselmbradford
Testing checklist
-
npm install
runs without error - Linters run without error
- Prettier runs without error
- New
trailingComma
Prettier default adds value to code styles
Note
Stylelint CommonJS Node.js API is deprecated
This isn't an issue for this version of Stylelint (16.5.0
) but will prevent us from updating to the next major version unless we migrate to ESM. 1
Footnotes
Thanks @mahoneycm - What happens now, in terms of getting this merged? |
@anselmbradford We'll get one more peer review and then move it onto our Final Fed review to be included in the upcoming release. We have this slated for |
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.
Looks good to me! Thanks for submitting this PR.
I performed the following tests:
- Run
npm install
without error - Run
npm run prettier
without error and without changes in files - Run
npm run lint
without error and without changes in files - Run
npm run start
without error and confirm it builds - Review file changes
- Merge in the changes from POAM April 24 and confirm no conflicts or issues
- Install on uswds-site and confirm no issues
@mahoneycm @amyleadem I noticed the |
@anselmbradford it sounds like our best option would be to flush out the cache once all of the dependency updates from this PR and our monthly POAM updates are merged into Thank you for the detailed explanation and additional links! For this PR, I'd say let's leave it as isolated as we can and avoid any additional dependency bumps if possible. I've created #5929 to keep track of this! I'll complete the steps when all dependency updates are merged 👍 |
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.
Sure are a lot of commas to check... but beyond that, there's one formatting rule I don't really understand, which seems to be expanding the the last function in a multifiunction expression? What's that meant to do?
font-size($theme-form-font-family, $theme-body-font-size) - units( | ||
$theme-input-select-size | ||
), |
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.
This type of formatting rule doesn't make sense to me
font-size($theme-form-font-family, $theme-body-font-size) - units( | ||
$theme-input-select-size | ||
) |
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 understand this formatting rule
left: units(5) - units($input-select-margin-right) - units( | ||
$theme-input-select-size | ||
); |
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 understand this formatting rule
Looks like those reformats above are coming from an 80-char max line-length rule. We can leave as-is. |
Summary
Dependency updates