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: upgrade Stylelint from v13 to v15 #1995

Merged
merged 4 commits into from
Feb 20, 2023
Merged
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
3 changes: 0 additions & 3 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -30,9 +30,6 @@ packageExtensions:
jest-tobetype@*:
dependencies:
eslint-import-resolver-node: "*"
stylelint@*:
dependencies:
postcss-scss: "*"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
10 changes: 1 addition & 9 deletions packages/dnb-design-system-portal/.ncurc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{
"reject": [
"eslint",
"ora",
"stylelint",
"stylelint-config-prettier",
"stylelint-config-recommended",
"stylelint-config-standard",
"stylelint-scss"
]
"reject": ["ora"]
}
19 changes: 4 additions & 15 deletions packages/dnb-design-system-portal/.stylelintrc
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
{
"extends": [
"stylelint-config-recommended",
"stylelint-config-standard",
"stylelint-config-prettier"
],
"plugins": ["stylelint-scss"],
"extends": ["@dnb/eufemia/.stylelintrc"],
"rules": {
"declaration-empty-line-before": null,
"at-rule-no-unknown": null,
"no-invalid-position-at-import-rule": null,
"selector-pseudo-class-no-unknown": [
true,
{
"ignorePseudoClasses": ["global"]
}
]
"selector-pseudo-class-no-unknown": null,
"scss/no-global-function-names": null,
"shorthand-property-no-redundant-values": null
}
}
12 changes: 5 additions & 7 deletions packages/dnb-design-system-portal/package.json
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@
"lint:ci": "NODE_ENV=test yarn lint:js && yarn lint:styles",
"lint:js": "yarn lint --fix",
"lint:js:staged": "eslint --quiet --fix",
"lint:styles": "stylelint './src/**/{Examples.*,*.scss}'",
"lint:styles:staged": "stylelint './src/**/{Examples.*,*.scss}'",
"lint:styles": "stylelint './src/**/*.scss'",
"lint:styles:staged": "stylelint './src/**/*.scss'",
"reset": "yarn clean && rm -rf ./node_modules",
"serve": "NODE_NO_WARNINGS=1 gatsby serve -p 8000",
"start": "NODE_NO_WARNINGS=1 cross-env gatsby develop",
@@ -110,11 +110,9 @@
"sass": "1.43.4",
"start-server-and-test": "1.14.0",
"storybook-utils": "workspace:*",
"stylelint": "13.13.1",
"stylelint-config-prettier": "8.0.2",
"stylelint-config-recommended": "5.0.0",
"stylelint-config-standard": "22.0.0",
"stylelint-scss": "3.21.0",
"stylelint": "15.1.0",
"stylelint-config-recommended": "10.0.1",
"stylelint-config-standard-scss": "7.0.1",
"svg-react-loader": "0.4.6",
"typescript": "4.5.5"
},
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
:global {
.dnb-dev-grid {
z-index: 1;

@include gridStyle(rgb(220, 220, 220), 0.8);
}
}
@@ -13,7 +14,7 @@
}

color: var(--color-sky-blue);
background-color: rgba(164, 255, 255, 0.3);
background-color: rgb(164 255 255 / 30%);
}

.LegacyCodeExample {
@@ -33,7 +34,7 @@

:global {
.show-pixel-bounding {
background-color: rgba(255, 255, 255, 0.5);
background-color: rgb(255 255 255 / 50%);
}
}
}
@@ -44,7 +45,7 @@

:global {
.show-pixel-bounding {
background-color: rgba(255, 255, 255, 0.5);
background-color: rgb(255 255 255 / 50%);
}
}
}
Original file line number Diff line number Diff line change
@@ -8,15 +8,17 @@
margin: 0.5rem;
padding: 0;

box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.1);
box-shadow: 0 0 2px 2px rgb(0 0 0 / 10%);

&,
a {
border-radius: 0.5rem;
}

&.is-selected a {
background-color: var(--color-mint-green);
}

a:focus,
a:hover {
background-color: var(--color-mint-green-50);
@@ -39,9 +41,11 @@
opacity: 0;
transform: scale3d(0.9, 0.9, 1) translate3d(0, -8%, 0);
}

40% {
opacity: 1;
}

100% {
opacity: 1;
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
@@ -53,6 +57,7 @@
opacity: 1;
transform: scale3d(1, 1, 1) translate3d(0, 0, 0);
}

100% {
opacity: 0;
transform: scale3d(0.9, 0.9, 1) translate3d(0, -8%, 0);
@@ -67,7 +72,7 @@

height: 100%;

color: rgba(0, 0, 0, 0.75);
color: rgb(0 0 0 / 75%);
text-decoration: none;
text-align: center;
font-weight: var(--font-weight-basis);
@@ -78,6 +83,7 @@
&:focus {
outline: none;
}

html[data-whatinput='keyboard'] &:focus {
@include focusRing();
}
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
.autocompleteStyle {
:global {
margin-right: 1rem;

@include allBelow(small) {
margin-right: 0.5rem;
}
@@ -11,11 +12,13 @@
&,
input {
width: 40vw;

@include allBelow(small) {
width: 50vw;
}
}
}

.dnb-form-label {
color: white; /* only for axe-core */
}
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@
}

.image-box {
@include gridStyle(rgb(40, 180, 130), 0.4);
@include gridStyle(rgb(40 180 130), 0.4);

position: relative;

@@ -56,7 +56,7 @@

text-align: center;

background-color: rgba(255, 255, 255, 0.6);
background-color: rgba(255 255 255 / 60%);

figcaption {
padding-top: 0.938rem; /* 15/16 because of the border */
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ html[show-dev-grid] .dev-grid > .dnb-h--xx-large {
position: relative;
z-index: 2;
}

html[show-dev-grid] .dev-grid {
@include gridStyle(rgb(220, 220, 220), 0.8);

@@ -62,9 +63,10 @@ html[show-dev-grid] .dev-grid {
p > a,
p > code,
p > small {
background-color: rgba(255, 255, 122, 0.35);
background-color: rgb(255 255 122 / 35%);

:only-child {
background-color: rgba(0, 200, 200, 0.25);
background-color: rgb(0 200 200 / 25%);
}
}
/* stylelint-enable */
@@ -78,18 +80,23 @@ html[show-dev-grid] .dev-grid {
.lh-12 {
line-height: calc(var(--line-height-basis) - 0.25rem); /* 0.75rem */
}

.lh-16 {
line-height: var(--line-height-basis); /* 1rem */
}

.lh-20 {
line-height: calc(var(--line-height-basis) + 0.25rem); /* 1.25rem */
}

.lh-24 {
line-height: var(--line-height-basis); /* 1rem */
}

.lh-28 {
line-height: calc(var(--line-height-basis) + 0.75rem); /* 1.75rem */
}

.lh-32 {
line-height: calc(var(--line-height-basis) + 1rem); /* 2rem */
}
Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@
list-style: none;

display: flex;
flex-wrap: wrap;
flex-direction: row;
flex-flow: row wrap;
align-items: flex-end;

padding: 0;
@@ -15,7 +14,7 @@
margin: 0.5rem;

border-radius: 0.25rem;
box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 4px rgb(0 0 0 / 20%);
}

.listItemInnerStyle {
@@ -38,6 +37,7 @@
margin: 0;
white-space: nowrap;
}

.dnb-p,
.dnb-spacing & .dnb-p {
margin: 0;
Original file line number Diff line number Diff line change
@@ -22,14 +22,19 @@
color: var(--color-sea-green);
background-color: transparent;
}

35% {
color: var(--color-white);
background-color: var(--color-sea-green);
}

// stylelint-disable-next-line
0%,
80% {
opacity: 1;
}

// stylelint-disable-next-line
100% {
opacity: 0;
}
@@ -45,16 +50,18 @@
@keyframes parent-attention-focus {
0%,
100% {
color: currentColor;
color: currentcolor;
background-color: transparent;
}

35% {
color: var(--color-white);
background-color: var(--color-sea-green);
}
}

animation: parent-attention-focus 2.2s ease-in-out 1 10ms;

* {
animation: parent-attention-focus 3s ease-in-out 1 150ms;
}
Original file line number Diff line number Diff line change
@@ -58,7 +58,7 @@

border-style: solid;
border-width: 0 0.75rem 0.75rem;
border-color: transparent transparent #222 transparent;
border-color: transparent transparent #222;

opacity: 1;
transition: opacity 0.2s ease-out, border-width 0.2s ease-out;
Original file line number Diff line number Diff line change
@@ -5,15 +5,18 @@
.dnb-tabs__tabs {
justify-content: space-between;
}

.dnb-tabs__tabs .dnb-modal__close-button {
position: relative;
top: auto; /* to force the button to center */
right: auto;
}

.dnb-tabs__tabs .dnb-button.dnb-modal__close-button,
.dnb-tabs__tabs .dnb-button.fullscreen {
margin-left: 1rem;
}

.dnb-tabs__tabs .dnb-button--secondary {
box-shadow: none;
background-color: transparent;
@@ -30,6 +33,7 @@
}
*/
}

.dnb-tabs__tabs .dnb-button.fullscreen {
display: none;
}
12 changes: 1 addition & 11 deletions packages/dnb-eufemia/.ncurc.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
{
"reject": [
"globby",
"ora",
"react",
"react-dom",
"stylelint",
"stylelint-config-prettier",
"stylelint-config-recommended",
"stylelint-config-standard",
"stylelint-scss"
]
"reject": ["globby", "ora", "react", "react-dom"]
}
4 changes: 3 additions & 1 deletion packages/dnb-eufemia/.stylelintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*__tests__*
*not_in_use*
/src/components/slider/Slider.js
/scripts
/stories
*.cjs
*.js
*.ts
*.tsx
Loading