-
Notifications
You must be signed in to change notification settings - Fork 72
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
Replace sass-lint
with stylelint
#949
base: main
Are you sure you want to change the base?
Changes from all commits
f557ebb
7a9de5e
62460ed
b6366ab
a3b0e4c
7d80460
b226e9c
4bb9391
ae29559
60a5680
ba7f671
417dda4
d06bbaa
e3b0ff6
222f61b
c725ad3
6d6e6f7
5154f25
b120590
0e5ba98
945d2cb
16e2dad
870a9db
8f0d289
ec4765c
0904cb9
d2eb2e1
b07f171
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build | ||
target | ||
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
extends: | ||
- stylelint-config-standard-scss | ||
rules: | ||
# while we still use node-sass, only legacy rgb() notation is allowed | ||
color-function-notation: "legacy" | ||
Comment on lines
+4
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will need to followup on this for #1001 |
||
# recommended to turn off descending specificity since we use a lot of nesting: | ||
# https://stylelint.io/user-guide/rules/list/no-descending-specificity/ | ||
no-descending-specificity: null | ||
Comment on lines
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might be nice to have a selector ordering rule. We should look into this further to see how much work it would be and if we should do it in the first place There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could handle it as separate task |
||
# need to use global function/value names from EUI | ||
function-name-case: null | ||
value-keyword-case: null | ||
scss/no-global-function-names: null | ||
# camelCase names | ||
keyframes-name-pattern: "^[a-z][a-zA-Z0-9_-]+$" | ||
selector-class-pattern: "^[a-z][a-zA-Z0-9_-]+$" | ||
selector-id-pattern: "^[a-z][a-zA-Z0-9_-]+$" | ||
scss/at-mixin-pattern: "^[a-z][a-zA-Z0-9_-]+$" | ||
scss/at-function-pattern: "^[a-z][a-zA-Z0-9_-]+$" | ||
scss/dollar-variable-pattern: "^[a-z][a-zA-Z0-9_-]+$" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ | |
- [CVE-2023-26115] Bump word-wrap from 1.2.3 to 1.2.4 ([#891](https://github.com/opensearch-project/oui/pull/891)) | ||
- Bump Node version to 18.16.0 ([#900](https://github.com/opensearch-project/oui/pull/900)) | ||
- Bump `node-sass` to a patched version based on `[email protected]` ([#977](https://github.com/opensearch-project/oui/pull/977)); see [patch commit](https://github.com/AMoo-Miki/node-sass/commit/43c74c0966b05c1e21a1e5e20a0c467ec8e669b4) for details. | ||
- Replace `sass-lint` with `stylelint` ([#949](https://github.com/opensearch-project/oui/pull/949)) | ||
|
||
### 🪛 Refactoring | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,12 @@ | |
"clean": "node ./scripts/compile-clean.js", | ||
"compile-icons": "node ./scripts/compile-icons.js && prettier --write --loglevel=warn \"./src/components/icon/assets/**/*.js\"", | ||
"extract-i18n-strings": "node ./scripts/babel/fetch-i18n-strings", | ||
"lint": "yarn tsc --noEmit && yarn lint-es && yarn lint-sass", | ||
"lint": "yarn tsc --noEmit && yarn lint-es && yarn lint-style", | ||
"lint-fix": "yarn lint-es-fix", | ||
"lint-es": "eslint --cache \"{src,src-docs}/**/*.{ts,tsx,js}\" --max-warnings 0", | ||
"lint-es-fix": "yarn lint-es --fix", | ||
"lint-sass": "sass-lint -v --max-warnings 0", | ||
"lint-sass-fix": "sass-lint-auto-fix -c ./.sass-lint-fix.yml", | ||
"lint-style": "stylelint \"{src,src-docs}/**/*.scss\" --max-warnings 0", | ||
"lint-style-fix": "yarn lint-style --fix", | ||
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious if this will cause anything unintended to break. All CI passes, but I wonder if anyone else is using these commands that we don't know about. Either way, I don't think it's something we really need to worry about for breaking things ~ this is more meant for dev anyway |
||
"test": "yarn lint && yarn test-unit", | ||
"test-unit": "cross-env NODE_ENV=test jest --config ./scripts/jest/config.json", | ||
"test-a11y": "node ./scripts/a11y-testing", | ||
|
@@ -74,12 +74,6 @@ | |
"react-view/**/minimist": "^1.2.6", | ||
"react-view/@miksu/prettier/minimatch": "^3.0.8", | ||
"remark-parse/trim": "0.0.3", | ||
"sass-lint-auto-fix/**/minimist": "^1.2.6", | ||
"sass-lint-auto-fix/merge": "^2.1.1", | ||
"sass-lint/**/minimist": "^1.2.6", | ||
"sass-lint/eslint": "^7.10.0", | ||
"sass-lint/front-matter": "^4.0.2", | ||
"sass-lint/merge": "^2.1.1", | ||
"start-server-and-test/**/minimist": "^1.2.6", | ||
"webpack-dev-server/**/ansi-regex": "^5.0.1", | ||
"webpack-dev-server/chokidar/glob-parent": "^6.0.1", | ||
|
@@ -216,6 +210,7 @@ | |
"moment-timezone": "^0.5.41", | ||
"node-sass": "npm:@amoo-miki/[email protected]", | ||
"pegjs": "^0.10.0", | ||
"postcss": "^8.4.28", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am astonished that we were using |
||
"postcss-cli": "^7.1.2", | ||
"postcss-inline-svg": "^4.1.0", | ||
"postcss-loader": "^4.0.1", | ||
|
@@ -237,13 +232,13 @@ | |
"resolve": "^1.22.1", | ||
"rimraf": "^5.0.1", | ||
"sass-extract": "^2.1.0", | ||
"sass-lint": "^1.13.1", | ||
"sass-lint-auto-fix": "^0.21.2", | ||
"sass-loader": "npm:@bsfishy/sass-loader@node-sass-9", | ||
"sass-vars-to-js-loader": "^2.1.1", | ||
"shelljs": "^0.8.5", | ||
"start-server-and-test": "^2.0.0", | ||
"style-loader": "^1.2.1", | ||
"stylelint": "^15.10.3", | ||
"stylelint-config-standard-scss": "^10.0.0", | ||
"terser-webpack-plugin": "^4.1.0", | ||
"typescript": "4.0.5", | ||
"url-loader": "^4.1.0", | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ $guideZLevelHighest: $ouiZLevel9 + 1000; | |||||
$elasticLogoTextLight: #FFF; | ||||||
$elasticLogoTextDark: #1C1E23; | ||||||
|
||||||
#guide { // sass-lint:disable-line no-ids | ||||||
#guide { | ||||||
display: flex; | ||||||
flex-direction: column; | ||||||
min-height: 100vh; | ||||||
|
@@ -33,7 +33,7 @@ body { | |||||
.ouiBody--headerIsFixed--double { | ||||||
@include ouiHeaderAffordForFixed($ouiHeaderHeightCompensation * 2); | ||||||
|
||||||
#guide { // sass-lint:disable-line no-ids | ||||||
#guide { | ||||||
min-height: calc(100vh - #{$ouiHeaderHeightCompensation * 2}); | ||||||
} | ||||||
|
||||||
|
@@ -46,11 +46,13 @@ body { | |||||
|
||||||
.guideSideNav { | ||||||
@include ouiSideNavEmbellish; | ||||||
|
||||||
min-width: $guideSideNavWidth; | ||||||
} | ||||||
|
||||||
.guideSideNav__content { | ||||||
@include ouiYScroll; | ||||||
|
||||||
padding: 0 $ouiSizeL $ouiSizeL; | ||||||
} | ||||||
|
||||||
|
@@ -100,7 +102,7 @@ body { | |||||
.guideDemo__highlightLayout--playground > div:not(.ouiPage) { | ||||||
height: 100%; | ||||||
width: 100%; | ||||||
padding: 0 !important; // sass-lint:disable-line no-important | ||||||
padding: 0 !important; | ||||||
|
||||||
> .ouiPage--grow { | ||||||
height: 100%; | ||||||
|
@@ -137,14 +139,12 @@ body { | |||||
padding: $ouiSize; | ||||||
} | ||||||
|
||||||
// sass-lint:disable no-important | ||||||
.guideDemo__textLines { | ||||||
background-image: linear-gradient($ouiFocusBackgroundColor 1px, transparent 1px) !important; | ||||||
background-size: 100% 8px !important; | ||||||
background-position-y: 2px; | ||||||
} | ||||||
|
||||||
// sass-lint:disable no-important | ||||||
.guideDemo__textLines--s { | ||||||
background-image: linear-gradient($ouiFocusBackgroundColor 1px, transparent 1px) !important; | ||||||
background-size: 100% 7px !important; | ||||||
|
@@ -179,7 +179,7 @@ body { | |||||
} | ||||||
|
||||||
.guideDemo__ghostBackground { | ||||||
@if (lightness($ouiTextColor) < 50) { | ||||||
@if lightness($ouiTextColor) < 50 { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the extra space here? There seem to be a lot of these? Is it just an artifact of
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is artifact from I tend to avoid manual intervention and keep it as is for now. Prettier would reformat it later |
||||||
color: $ouiColorGhost; | ||||||
background: $ouiColorDarkestShade !important; // Override OuiPanel specificity | ||||||
} | ||||||
|
@@ -247,6 +247,7 @@ body { | |||||
|
||||||
.guideDemo__notificationEvent { | ||||||
@include ouiFontSizeS; | ||||||
|
||||||
display: flex; | ||||||
flex-direction: column; | ||||||
|
||||||
|
@@ -324,10 +325,11 @@ body { | |||||
color: $ouiColorAccentText; | ||||||
} | ||||||
|
||||||
|
||||||
/* stylelint-disable no-invalid-position-at-import-rule */ | ||||||
@import '../views/guidelines/index'; | ||||||
@import 'guide_section/index'; | ||||||
@import 'guide_rule/index'; | ||||||
/* stylelint-enable no-invalid-position-at-import-rule */ | ||||||
|
||||||
@include ouiBreakpoint('xs', 's') { | ||||||
.guideSideNav { | ||||||
|
@@ -348,17 +350,16 @@ body { | |||||
min-width: 200px; | ||||||
flex-basis: 100% !important; | ||||||
|
||||||
// sass-lint:disable-block mixins-before-declarations | ||||||
@include ouiBreakpoint('s', 'm') { | ||||||
flex-basis: 45% !important; // sass-lint:disable-line no-important | ||||||
flex-basis: 45% !important; | ||||||
} | ||||||
|
||||||
@include ouiBreakpoint('l') { | ||||||
flex-basis: 30% !important; // sass-lint:disable-line no-important | ||||||
flex-basis: 30% !important; | ||||||
} | ||||||
|
||||||
@include ouiBreakpoint('xl') { | ||||||
flex-basis: 22% !important; // sass-lint:disable-line no-important | ||||||
flex-basis: 22% !important; | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -383,7 +384,7 @@ body { | |||||
width: 100%; | ||||||
height: auto; | ||||||
|
||||||
&:before { | ||||||
&::before { | ||||||
content: ''; | ||||||
display: block; | ||||||
position: absolute; | ||||||
|
@@ -458,7 +459,6 @@ body { | |||||
} | ||||||
|
||||||
.guideHome__footerLogo { | ||||||
// sass-lint:disable-block no-important | ||||||
vertical-align: middle; | ||||||
display: inline-block !important; | ||||||
margin-bottom: 0 !important; | ||||||
|
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.
We have a few artifact directories:
Additionally, would
node_modules
be a good choice to be here?