Skip to content
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

chore/Issue-51: Refactor lint-staged config #112

Merged
merged 8 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
"*.js": ["npm run lint:js --"],
"*.css": "npm run lint:css --",
"*.*": ["npm run lint:ls --", "npm run format --"],
};
41 changes: 16 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,10 @@
"storybook": "^8.0.6",
"storybook-addon-fetch-mock": "^2.0.1",
"stylelint": "^16.4.0",
"stylelint-prettier": "^5.0.0",
"stylelint-config-recommended": "^14.0.1",
"vite": "^5.2.8"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.17.2"
},
"lint-staged": {
"*.js": "npm run lint:js",
"*.css": "npm run lint:css",
"**/*": "npm run lint:ls && npm run format"
}
}
17 changes: 4 additions & 13 deletions src/components/capabilities/capabilities.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,10 @@
font-size: var(--font-size-1);
}

.heading {
font-family: var(--font-primary-bold);
font-size: var(--font-size-6);
}

.container {
padding: var(--size-fluid-2);
}

.sections {
overflow-x: auto;
scrollbar-width: thin;
scrollbar-color: var(--color-gray) transparent;
}

.section {
display: inline-block;
border-radius: var(--radius-5);
Expand All @@ -40,8 +29,8 @@
border: 2px dotted var(--color-accent);
}

.section:hover strong,
.active strong {
.active strong,
.section:hover strong {
font-family: var(--font-primary-bold);
color: var(--color-white);
}
Expand Down Expand Up @@ -91,6 +80,8 @@
border-top: 1px solid var(--color-accent);
border-bottom: 1px solid var(--color-accent);
margin: var(--font-size-1) 0;
scrollbar-width: thin;
scrollbar-color: var(--color-gray) transparent;
}

.sections-list {
Expand Down
1 change: 0 additions & 1 deletion src/components/copy-to-clipboard/copy-to-clipboard.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#icon {
background-color: transparent;
padding: var(--size-2);
border: none;
cursor: pointer;
Expand Down
1 change: 0 additions & 1 deletion src/components/footer/footer.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
padding-left: var(--size-fluid-1);
display: flex;
flex-direction: column;
flex-basis: 100%;
flex: 1;
justify-content: center;
color: var(--color-gray);
Expand Down
10 changes: 5 additions & 5 deletions src/components/header/header.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
color: var(--color-black);
}

.mobileMenuListItem a {
color: var(--color-black);
text-decoration: none;
}

.navBarMenuItem a:hover {
text-decoration: underline;
}
Expand Down Expand Up @@ -108,11 +113,6 @@
font-size: var(--font-size-5);
}

.mobileMenuListItem a {
color: var(--color-black);
text-decoration: none;
}

@media screen and (min-width: 480px) {
.container {
justify-content: space-between;
Expand Down
2 changes: 0 additions & 2 deletions src/components/hero-banner/hero-banner.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@

.snippet pre {
font-size: 16px;
display: inline-block;
height: 46px;
align-content: center;
display: inline;
vertical-align: text-top;
background-color: transparent;
color: var(--color-black);
vertical-align: middle;
Expand Down
33 changes: 14 additions & 19 deletions src/components/side-nav/side-nav.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
color: var(--color-black);
text-decoration: none;
}

& a:hover {
opacity: 0.7;
}
}

.compactMenuCloseButton {
Expand Down Expand Up @@ -54,18 +50,30 @@
height: auto;
}

.compactMenuSectionListItemActive {
& a {
border-left: var(--size-1) solid black;
border-radius: var(--radius-2);
background-color: white;
padding: 0 var(--size-2);
min-width: 200px;
display: inline-block;
box-shadow: var(--shadow-3);
margin-left: -16px;
}
}

.compactMenuSectionHeading {
margin: 0 0 var(--size-2) 0;

& a {
font-family: var(--font-primary-bold);
}
}

.compactMenuSectionHeading {
& a.active,
& a:hover {
text-decoration: underline;
opacity: 0.7;
}

& a.active::before {
Expand All @@ -82,19 +90,6 @@
}
}

.compactMenuSectionListItemActive {
& a {
border-left: var(--size-1) solid black;
border-radius: var(--radius-2);
background-color: white;
padding: 0 var(--size-2);
min-width: 200px;
display: inline-block;
box-shadow: var(--shadow-3);
margin-left: -16px;
}
}

.compactMenuSectionListItem {
margin: var(--size-1);
}
Expand Down
5 changes: 1 addition & 4 deletions stylelint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export default {
// no stylelint 16 support yet
// https://github.com/developer-stylechain/stylelint-a11y/issues/4
// plugins: ['stylelint-a11y'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know have access to the a11y rules? otherwise, we can should leave this comment in as a reminder, or maybe its just time to make a formal issue for tracking.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah I can revert this, or update to include our own issue, if you prefer.

As for the support, it looks like the issue that you have linked above is (now) closed and has a comment with a resolution of using 2 other libraries instead of the developer-stylechain project.

Styleline v15 -> https://www.npmjs.com/package/@ronilaukkarinen/stylelint-a11y
Styleline v16 -> https://www.npmjs.com/package/@double-great/stylelint-a11y

Did you want me to attempt to include that plugin here in this PR? Happy to try, and could spin off a new PR if things got messy, if that's cool.

extends: ["stylelint-prettier/recommended"],
extends: ["stylelint-config-recommended"],
};