Skip to content

Commit

Permalink
feat(lint): adjust LESS whitespaces to match prettier format
Browse files Browse the repository at this point in the history
This PR fixes whitespaces unfixed/undetected in GH-2610 and major whitespace changes required for future Prettier integration.

Double quotes and lowecased hex colors are required by Prettier - prettier/prettier#5158 - and there is no config to change it. As long as we want to use Prettier, we must accept opinionated formatting by Prettier.
  • Loading branch information
mvorisek authored Dec 16, 2022
1 parent 1084e98 commit 2ec6af4
Show file tree
Hide file tree
Showing 167 changed files with 7,023 additions and 4,577 deletions.
19 changes: 18 additions & 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 && yarn add -D eslint-config-airbnb-base eslint-plugin-unicorn eslint-plugin-jest@^26.9.0 @typescript-eslint/eslint-plugin @typescript-eslint/parser typescript
- name: Lint JS and CSS/LESS files
- name: Lint JS and LESS files
run: npm run lint
test:
name: Test build process on node ${{ matrix.node-version }}
Expand All @@ -33,3 +33,20 @@ jobs:
run: yarn
- name: pre fomantic install & gulp build
run: yarn gulp install
codeql:
name: CodeQL
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v3
- uses: github/codeql-action/init@v2
with:
languages: 'javascript'
config-file: ./.github/codeql/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
68 changes: 0 additions & 68 deletions .github/workflows/codeql.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
'at-rule-no-unknown': null,
'block-closing-brace-newline-before': null, // fix bad formatting with "each()"
'color-function-notation': 'legacy',
'color-hex-case': 'lower',
'declaration-block-trailing-semicolon': null, // fix bad formatting with "each()"
'function-no-unknown': null,
indentation: null, // TODO change to "4" once https://github.com/fomantic/Fomantic-UI/pull/2593#discussion_r1045131096 is fixed
Expand All @@ -24,7 +25,7 @@ module.exports = {
'number-max-precision': 5,
'property-case': null,
'rule-empty-line-before': null,
'string-quotes': null,
'string-quotes': 'double',
'value-keyword-case': null,

// TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
Expand All @@ -41,9 +42,7 @@ module.exports = {
'declaration-block-no-redundant-longhand-properties': null, // 12 errors
'value-no-vendor-prefix': null, // 9 errors
'font-family-no-missing-generic-family-keyword': null, // 8 errors
'selector-attribute-quotes': null, // 7 errors
'shorthand-property-no-redundant-values': null, // 5 errors
'function-url-quotes': null, // 5 errors
'declaration-block-no-duplicate-properties': null, // 2 errors
'font-family-no-duplicate-names': null, // 2 errors
'function-linear-gradient-no-nonstandard-direction': null, // 1 error
Expand Down
2 changes: 1 addition & 1 deletion examples/components/sticky-context.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<style type="text/css">

body {
background-color: #FFFFFF;
background-color: #fff;
}
.text.container {
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion examples/fixed.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<style type="text/css">
body {
background-color: #FFFFFF;
background-color: #fff;
}
.ui.menu .item img.logo {
margin-right: 1.5em;
Expand Down
6 changes: 3 additions & 3 deletions examples/grid.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ <h3>Specifying Device Visibility</h3>

/* Some basic formatting */
code {
background-color: #E0E0E0;
background-color: #e0e0e0;
padding: 0.25em 0.3em;
font-family: 'Lato';
font-weight: bold;
Expand Down Expand Up @@ -375,11 +375,11 @@ <h3>Specifying Device Visibility</h3>
position: absolute;
top: 1rem;
left: 1rem;
background-color: #F0F0F0;
background-color: #f0f0f0;
content: '';
width: calc(100% - 2rem);
height: calc(100% - 2rem);
box-shadow: 0px 0px 0px 1px #DDDDDD inset;
box-shadow: 0px 0px 0px 1px #ddd inset;
}
.ui.divided.grid:before,
.celled.grid:before {
Expand Down
2 changes: 1 addition & 1 deletion examples/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<style type="text/css">
body {
background-color: #DADADA;
background-color: #dadada;
}
body > .grid {
height: 100%;
Expand Down
6 changes: 3 additions & 3 deletions examples/sticky.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<style type="text/css">

body {
background-color: #FFFFFF;
background-color: #fff;
}
.main.container {
margin-top: 2em;
Expand Down Expand Up @@ -91,8 +91,8 @@
}

.main.menu.fixed {
background-color: #FFFFFF;
border: 1px solid #DDD;
background-color: #fff;
border: 1px solid #ddd;
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
}
.overlay.fixed .menu {
Expand Down
8 changes: 4 additions & 4 deletions src/definitions/collections/breadcrumb.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
Theme
*******************************/

@type: 'collection';
@element: 'breadcrumb';
@type: "collection";
@element: "breadcrumb";

@import (multiple) '../../theme.config';
@import (multiple) "../../theme.config";

/*******************************
Breadcrumb
Expand Down Expand Up @@ -112,7 +112,7 @@
.ui.@{value}.breadcrumb {
font-size: @s;
}
})
});
}

.loadUIOverrides();
38 changes: 19 additions & 19 deletions src/definitions/collections/form.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
Theme
*******************************/

@type: 'collection';
@element: 'form';
@type: "collection";
@element: "form";

@import (multiple) '../../theme.config';
@import (multiple) "../../theme.config";

/*******************************
Elements
Expand Down Expand Up @@ -98,8 +98,8 @@
}

/* Set max height on unusual input */
.ui.form::-webkit-datetime-edit,
.ui.form::-webkit-inner-spin-button {
.ui.form ::-webkit-datetime-edit,
.ui.form ::-webkit-inner-spin-button {
height: @inputLineHeight;
}

Expand Down Expand Up @@ -281,7 +281,7 @@
}

& when (@variationFormInline) {
/* Inline */
/* Inline */
.ui.form .inline.fields .field:not(.wide) .ui.input,
.ui.form .inline.field:not(.wide) .ui.input {
width: auto;
Expand Down Expand Up @@ -322,7 +322,7 @@
.ui.form .@{state}.message:empty {
display: none;
}
})
});
}

/* Assumptions */
Expand Down Expand Up @@ -383,24 +383,24 @@
--------------------- */

/* browsers require these rules separate */
.ui.form::-webkit-input-placeholder {
.ui.form ::-webkit-input-placeholder {
color: @inputPlaceholderColor;
}
.ui.form:-ms-input-placeholder when (@supportIE) {
.ui.form :-ms-input-placeholder when (@supportIE) {
color: @inputPlaceholderColor !important;
}
.ui.form::-moz-placeholder {
.ui.form ::-moz-placeholder {
color: @inputPlaceholderColor;
opacity: 1;
}

.ui.form:focus::-webkit-input-placeholder {
.ui.form :focus::-webkit-input-placeholder {
color: @inputPlaceholderFocusColor;
}
.ui.form:focus:-ms-input-placeholder when (@supportIE) {
.ui.form :focus:-ms-input-placeholder when (@supportIE) {
color: @inputPlaceholderFocusColor !important;
}
.ui.form:focus::-moz-placeholder {
.ui.form :focus::-moz-placeholder {
color: @inputPlaceholderFocusColor;
}

Expand Down Expand Up @@ -740,7 +740,7 @@
color: @lbg;
}
}
})
});
}

& when (@variationFormDisabled) {
Expand All @@ -750,15 +750,15 @@

.ui.form .disabled.fields .field,
.ui.form .disabled.field,
.ui.form .field:disabled {
.ui.form .field :disabled {
pointer-events: @disabledPointerEvents;
opacity: @disabledOpacity;
}
.ui.form .field.disabled > label,
.ui.form .fields.disabled > label {
opacity: @disabledLabelOpacity;
}
.ui.form .field.disabled:disabled {
.ui.form .field.disabled :disabled {
opacity: 1;
}
}
Expand All @@ -775,7 +775,7 @@
}
.ui.loading.form::before {
position: absolute;
content: '';
content: "";
top: 0;
left: 0;
background: @loaderDimmerColor;
Expand All @@ -790,7 +790,7 @@

.ui.loading.form::after {
position: absolute;
content: '';
content: "";
top: 50%;
left: 50%;
margin: @loaderMargin;
Expand Down Expand Up @@ -1167,7 +1167,7 @@
.ui.@{value}.form .field .dropdown .menu > .item {
font-size: @s;
}
})
});
}

.loadUIOverrides();
Loading

0 comments on commit 2ec6af4

Please sign in to comment.