Skip to content

feat(lint): add stylelint overrides and variation files #2593

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

Merged
merged 32 commits into from
Dec 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
049cf20
warn on unneeded rules
mvorisek Dec 10, 2022
14ca6e7
add stylelint for *.overrides amd *.variables and fix indentation
mvorisek Dec 10, 2022
a47fe14
TEMPORARY disable stylelint-config-standard
mvorisek Dec 10, 2022
9180b39
fix unstable lines manually (stylelint bug)
mvorisek Dec 10, 2022
b47bbdf
strictly autofix indentation (one pass)
mvorisek Dec 10, 2022
79a3e29
strictly autofix indentation (2nd pass)
mvorisek Dec 10, 2022
42ecdb0
Revert "TEMPORARY disable stylelint-config-standard"
mvorisek Dec 10, 2022
cbe8232
ignore all errors
mvorisek Dec 10, 2022
3b82cff
fix indentation manually (stylelint bug /w files with the same ext)
mvorisek Dec 10, 2022
422d6a3
strictly autofix block-closing-brace-space-before
mvorisek Dec 10, 2022
8978040
fix no-extra-semicolons manually
mvorisek Dec 10, 2022
fd2ac6e
fix CI step name
mvorisek Dec 10, 2022
1445eb1
fix comments indentation manually using regex
mvorisek Dec 10, 2022
5b4d8fb
strictly autofix comment-whitespace-inside
mvorisek Dec 10, 2022
be9f939
strictly autofix comment-empty-line-before
mvorisek Dec 10, 2022
f0fb3ad
strictly autofix max-empty-lines
mvorisek Dec 10, 2022
f43d61c
strictly autofix block-opening-brace-space-before
mvorisek Dec 10, 2022
c877b76
strictly autofix no-missing-end-of-source-newline
mvorisek Dec 10, 2022
e9be237
strictly autofix at-rule-name-space-after
mvorisek Dec 10, 2022
7be5dcc
strictly autofix media-feature-colon-space-before
mvorisek Dec 10, 2022
236d1bb
strictly autofix declaration-block-semicolon-space-before
mvorisek Dec 10, 2022
f622c61
strictly autofix selector-list-comma-newline-after
mvorisek Dec 10, 2022
e49e39b
strictly autofix block-closing-brace-empty-line-before
mvorisek Dec 10, 2022
71f581c
strictly autofix function-comma-space-before
mvorisek Dec 10, 2022
c57c379
fix block-closing-brace-newline-after manually
mvorisek Dec 10, 2022
2992150
strictly autofix function-comma-newline-after
mvorisek Dec 10, 2022
ece55eb
strictly autofix no-empty-first-line
mvorisek Dec 10, 2022
5a87454
move no-descending-specificity
mvorisek Dec 10, 2022
beda714
improve comments for ignored rules
mvorisek Dec 10, 2022
5f36065
strictly autofix declaration-empty-line-before
mvorisek Dec 10, 2022
f63694d
fix semicolon removed by no-missing-end-of-source-newline rule
mvorisek Dec 10, 2022
068b55c
disable indentation rule for now, remove stylelint disable comments
mvorisek Dec 10, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/setup-node@v3
- name: Install dependencies
run: yarn
- name: Lint JS files
- name: Lint JS and CSS/LESS files
run: npm run lint
test:
name: Test build process on node ${{ matrix.node-version }}
Expand Down
55 changes: 34 additions & 21 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,52 @@ module.exports = {
'test/coverage/**',
],
rules: {
indentation: 4,
'at-rule-empty-line-before': null,
'block-closing-brace-newline-before': null,
'declaration-block-trailing-semicolon': null, // bad formatting with "each()"
'declaration-empty-line-before': null,
'block-closing-brace-newline-before': null, // fix bad formatting with "each()"
'declaration-block-trailing-semicolon': null, // fix bad formatting with "each()"
indentation: null, // TODO change to "4" once https://github.com/fomantic/Fomantic-UI/pull/2593#discussion_r1045131096 is fixed
'max-line-length': null,
'no-descending-specificity': null,
'no-extra-semicolons': null, // fix GH-1832 - workaround for wikimedia/less.php parser
'rule-empty-line-before': null,

// TODO
'no-descending-specificity': null, // 11532 errors
'property-case': null, // 338 errors
'string-quotes': null, // 249 errors
'no-duplicate-selectors': null, // 212 errors
'string-quotes': null, // 1676 errors
'at-rule-no-unknown': null, // 1081 errors
'property-case': null, // 866 errors
'at-rule-name-case': null, // 764 errors
'no-duplicate-selectors': null, // 224 errors
'selector-not-notation': null, // 169 errors
'no-invalid-position-at-import-rule': null, // 104 errors
'at-rule-no-unknown': null, // 104 errors
'import-notation': null, // 55 errors
'function-no-unknown': null, // 43 errors
'property-no-vendor-prefix': null, // 31 errors
'function-no-unknown': null, // 67 errors
'length-zero-no-unit': null, // 64 errors
'import-notation': null, // 56 errors
'keyframes-name-pattern': null, // 50 errors
'property-no-vendor-prefix': null, // 49 errors
'number-leading-zero': null, // 49 errors
'color-function-notation': null, // 32 errors
'alpha-value-notation': null, // 32 errors
'color-hex-case': null, // 32 errors
'block-no-empty': null, // 25 errors
'selector-no-vendor-prefix': null, // 19 errors
'number-leading-zero': null, // 19 errors
'selector-class-pattern': null, // 19 errors
'number-no-trailing-zeros': null, // 16 errors
'font-family-name-quotes': null, // 13 errors
'declaration-block-no-redundant-longhand-properties': null, // 12 errors
'value-keyword-case': null, // 11 errors
'value-keyword-case': null, // 12 errors
'value-no-vendor-prefix': null, // 9 errors
'keyframes-name-pattern': null, // 9 errors
'color-function-notation': null, // 8 errors
'alpha-value-notation': null, // 8 errors
'color-hex-length': null, // 9 errors
'no-empty-source': null, // 8 errors
'font-family-no-missing-generic-family-keyword': null, // 8 errors
'number-max-precision': null, // 7 errors
'selector-attribute-quotes': null, // 7 errors
'number-no-trailing-zeros': null, // 6 errors
'shorthand-property-no-redundant-values': null, // 5 errors
'function-url-quotes': null, // 5 errors
'declaration-block-no-duplicate-properties': null, // 2 errors
'number-max-precision': null, // 2 errors
'color-hex-case': null, // 1 error
'color-hex-length': null, // 1 error
'font-family-no-duplicate-names': null, // 2 errors
'function-linear-gradient-no-nonstandard-direction': null, // 1 error
'at-rule-no-vendor-prefix': null, // 1 error
'declaration-block-no-shorthand-property-overrides': null, // 1 error
},
reportNeedlessDisables: true,
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"scripts": {
"build": "gulp build",
"changelog": "auto-changelog -p",
"lint": "eslint --ext .js . && stylelint \"**/*.{css,less}\"",
"lint-fix": "eslint --ext .js . --fix && stylelint \"**/*.{css,less}\" --fix"
"lint": "eslint --ext .js . && stylelint \"**/*.{css,less,overrides,variables}\"",
"lint-fix": "eslint --ext .js . --fix && stylelint \"**/*.{css,less,overrides,variables}\" --fix"
},
"dependencies": {
"@actions/core": "^1.6.0",
Expand Down
2 changes: 1 addition & 1 deletion src/_site/collections/menu.overrides
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*******************************
Site Overrides
*******************************/
*******************************/
4 changes: 2 additions & 2 deletions src/_site/elements/flag.variables
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*-------------------
/* -------------------
Flag Variables
--------------------*/
-------------------- */
2 changes: 1 addition & 1 deletion src/_site/globals/site.variables
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/*******************************
User Global Variables
*******************************/
*******************************/
1 change: 0 additions & 1 deletion src/definitions/collections/breadcrumb.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
display: inline-block;
opacity: @dividerOpacity;
margin: 0 @dividerSpacing 0;

font-size: @dividerSize;
color: @dividerColor;
vertical-align: @dividerVerticalAlign;
Expand Down
8 changes: 0 additions & 8 deletions src/definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,9 @@
outline: none;
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);

line-height: @inputLineHeight;
padding: @inputPadding;
font-size: @inputFontSize;

background: @inputBackground;
border: @inputBorder;
color: @inputColor;
Expand All @@ -152,7 +150,6 @@
margin: 0;
-webkit-appearance: none;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);

padding: @textAreaPadding;
background: @textAreaBackground;
border: @textAreaBorder;
Expand Down Expand Up @@ -796,15 +793,12 @@
content: '';
top: 50%;
left: 50%;

margin: @loaderMargin;
width: @loaderSize;
height: @loaderSize;

animation: loader @loaderSpeed infinite linear;
border: @loaderLineWidth solid @loaderLineColor;
border-radius: @circularRadius;

box-shadow: 0 0 0 1px transparent;
visibility: visible;
z-index: @loaderLineZIndex;
Expand Down Expand Up @@ -1119,10 +1113,8 @@
.ui.form .inline.field > select {
display: inline-block;
width: auto;

margin-top: 0;
margin-bottom: 0;

vertical-align: middle;
font-size: @inlineInputSize;
}
Expand Down
3 changes: 0 additions & 3 deletions src/definitions/collections/grid.less
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
.ui.grid > .row > .column {
position: relative;
display: inline-block;

width: @oneWide;
padding-left: (@gutterWidth / 2);
padding-right: (@gutterWidth / 2);
Expand Down Expand Up @@ -1096,10 +1095,8 @@
content: "";
top: 0;
left: 0;

width: e(%("calc(100%% - %d)", @gutterWidth));
height: 1px;

margin: 0 (@gutterWidth / 2);
box-shadow: @verticallyDividedBorder;
}
Expand Down
12 changes: 2 additions & 10 deletions src/definitions/collections/menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
-webkit-tap-highlight-color: transparent;
flex: 0 0 auto;
user-select: none;

background: @itemBackground;
padding: @itemVerticalPadding @itemHorizontalPadding;
text-transform: @itemTextTransform;
Expand All @@ -102,7 +101,6 @@
top: 0;
right: 0;
height: 100%;

width: @dividerSize;
background: @dividerBackground;
}
Expand Down Expand Up @@ -292,6 +290,7 @@
/* IE needs 0, all others support max-content to show dropdown icon inline, so keep both settings! */
min-width: 0;
}

min-width: max-content;
margin: 0 0 0 @dropdownMenuDistance;
box-shadow: @dropdownVerticalMenuBoxShadow;
Expand Down Expand Up @@ -643,7 +642,6 @@ Floated Menu / Item
.ui.tabular.menu .item {
background: transparent;
border-bottom: none;

border-left: @tabularBorderWidth solid transparent;
border-right: @tabularBorderWidth solid transparent;
border-top: @tabularOppositeBorderWidth solid transparent;
Expand Down Expand Up @@ -968,7 +966,6 @@ Floated Menu / Item
border-bottom-style: solid;
border-radius: 0;
align-self: flex-end;

margin: 0 0 -@secondaryPointingBorderWidth;
padding: @secondaryPointingItemVerticalPadding @secondaryPointingItemHorizontalPadding;
border-bottom-width: @secondaryPointingBorderWidth;
Expand Down Expand Up @@ -1094,7 +1091,6 @@ Floated Menu / Item
border-radius: 0;
box-shadow: none;
border: none;

margin: @textMenuMargin;
}
.ui.text.menu .item {
Expand Down Expand Up @@ -1596,6 +1592,7 @@ Floated Menu / Item
/* IE hack to make dropdown icons appear inline */
display: -ms-inline-flexbox !important;
}

display: inline-block;
}
}
Expand Down Expand Up @@ -1764,15 +1761,12 @@ Floated Menu / Item
left: 50%;
transform: translateX(-50%) translateY(-50%) rotate(45deg);
background: none;

margin: (@arrowBorderWidth / 2) 0 0;
width: @arrowSize;
height: @arrowSize;

border: none;
border-bottom: @arrowBorder;
border-right: @arrowBorder;

z-index: @arrowZIndex;
transition: @arrowTransition;
}
Expand All @@ -1783,10 +1777,8 @@ Floated Menu / Item
right: 0;
bottom: auto;
left: auto;

transform: translateX(50%) translateY(-50%) rotate(45deg);
margin: 0 -(@arrowBorderWidth / 2) 0 0;

border: none;
border-top: @arrowBorder;
border-right: @arrowBorder;
Expand Down
10 changes: 5 additions & 5 deletions src/definitions/collections/message.less
Original file line number Diff line number Diff line change
Expand Up @@ -296,39 +296,39 @@
text : @positiveTextColor;
invertedText : @positiveBorderColor;
};
@negative: { // stylelint-disable-line indentation
@negative: {
background : @negativeBackgroundColor;
header : @negativeHeaderColor;
boxShadow : @negativeBoxShadow;
boxFloatShadow : @negativeBoxFloatingShadow;
text : @negativeTextColor;
invertedText : @negativeBorderColor;
};
@info: { // stylelint-disable-line indentation
@info: {
background : @infoBackgroundColor;
header : @infoHeaderColor;
boxShadow : @infoBoxShadow;
boxFloatShadow : @infoBoxFloatingShadow;
text : @infoTextColor;
invertedText : @formInfoLabelBackground;
};
@warning: { // stylelint-disable-line indentation
@warning: {
background : @warningBackgroundColor;
header : @warningHeaderColor;
boxShadow : @warningBoxShadow;
boxFloatShadow : @warningBoxFloatingShadow;
text : @warningTextColor;
invertedText : @formWarningLabelBackground;
};
@error: { // stylelint-disable-line indentation
@error: {
background : @errorBackgroundColor;
header : @errorHeaderColor;
boxShadow : @errorBoxShadow;
boxFloatShadow : @errorBoxFloatingShadow;
text : @errorTextColor;
invertedText : @formErrorLabelBackground;
};
@success: { // stylelint-disable-line indentation
@success: {
background : @successBackgroundColor;
header : @successHeaderColor;
boxShadow : @successBoxShadow;
Expand Down
Loading