Skip to content

Commit 2ec6af4

Browse files
authored
feat(lint): adjust LESS whitespaces to match prettier format
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.
1 parent 1084e98 commit 2ec6af4

File tree

167 files changed

+7023
-4577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+7023
-4577
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/setup-node@v3
1313
- name: Install dependencies
1414
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
15-
- name: Lint JS and CSS/LESS files
15+
- name: Lint JS and LESS files
1616
run: npm run lint
1717
test:
1818
name: Test build process on node ${{ matrix.node-version }}
@@ -33,3 +33,20 @@ jobs:
3333
run: yarn
3434
- name: pre fomantic install & gulp build
3535
run: yarn gulp install
36+
codeql:
37+
name: CodeQL
38+
runs-on: ubuntu-latest
39+
permissions:
40+
actions: read
41+
contents: read
42+
security-events: write
43+
steps:
44+
- uses: actions/checkout@v3
45+
- uses: github/codeql-action/init@v2
46+
with:
47+
languages: 'javascript'
48+
config-file: ./.github/codeql/codeql-config.yml
49+
- name: Autobuild
50+
uses: github/codeql-action/autobuild@v2
51+
- name: Perform CodeQL Analysis
52+
uses: github/codeql-action/analyze@v2

.github/workflows/codeql.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.stylelintrc.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module.exports = {
1313
'at-rule-no-unknown': null,
1414
'block-closing-brace-newline-before': null, // fix bad formatting with "each()"
1515
'color-function-notation': 'legacy',
16+
'color-hex-case': 'lower',
1617
'declaration-block-trailing-semicolon': null, // fix bad formatting with "each()"
1718
'function-no-unknown': null,
1819
indentation: null, // TODO change to "4" once https://github.com/fomantic/Fomantic-UI/pull/2593#discussion_r1045131096 is fixed
@@ -24,7 +25,7 @@ module.exports = {
2425
'number-max-precision': 5,
2526
'property-case': null,
2627
'rule-empty-line-before': null,
27-
'string-quotes': null,
28+
'string-quotes': 'double',
2829
'value-keyword-case': null,
2930

3031
// TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
@@ -41,9 +42,7 @@ module.exports = {
4142
'declaration-block-no-redundant-longhand-properties': null, // 12 errors
4243
'value-no-vendor-prefix': null, // 9 errors
4344
'font-family-no-missing-generic-family-keyword': null, // 8 errors
44-
'selector-attribute-quotes': null, // 7 errors
4545
'shorthand-property-no-redundant-values': null, // 5 errors
46-
'function-url-quotes': null, // 5 errors
4746
'declaration-block-no-duplicate-properties': null, // 2 errors
4847
'font-family-no-duplicate-names': null, // 2 errors
4948
'function-linear-gradient-no-nonstandard-direction': null, // 1 error

examples/components/sticky-context.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<style type="text/css">
6767

6868
body {
69-
background-color: #FFFFFF;
69+
background-color: #fff;
7070
}
7171
.text.container {
7272
position: relative;

examples/fixed.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<style type="text/css">
2828
body {
29-
background-color: #FFFFFF;
29+
background-color: #fff;
3030
}
3131
.ui.menu .item img.logo {
3232
margin-right: 1.5em;

examples/grid.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ <h3>Specifying Device Visibility</h3>
337337

338338
/* Some basic formatting */
339339
code {
340-
background-color: #E0E0E0;
340+
background-color: #e0e0e0;
341341
padding: 0.25em 0.3em;
342342
font-family: 'Lato';
343343
font-weight: bold;
@@ -375,11 +375,11 @@ <h3>Specifying Device Visibility</h3>
375375
position: absolute;
376376
top: 1rem;
377377
left: 1rem;
378-
background-color: #F0F0F0;
378+
background-color: #f0f0f0;
379379
content: '';
380380
width: calc(100% - 2rem);
381381
height: calc(100% - 2rem);
382-
box-shadow: 0px 0px 0px 1px #DDDDDD inset;
382+
box-shadow: 0px 0px 0px 1px #ddd inset;
383383
}
384384
.ui.divided.grid:before,
385385
.celled.grid:before {

examples/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
<style type="text/css">
3434
body {
35-
background-color: #DADADA;
35+
background-color: #dadada;
3636
}
3737
body > .grid {
3838
height: 100%;

examples/sticky.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<style type="text/css">
6161

6262
body {
63-
background-color: #FFFFFF;
63+
background-color: #fff;
6464
}
6565
.main.container {
6666
margin-top: 2em;
@@ -91,8 +91,8 @@
9191
}
9292

9393
.main.menu.fixed {
94-
background-color: #FFFFFF;
95-
border: 1px solid #DDD;
94+
background-color: #fff;
95+
border: 1px solid #ddd;
9696
box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.2);
9797
}
9898
.overlay.fixed .menu {

src/definitions/collections/breadcrumb.less

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
Theme
1313
*******************************/
1414

15-
@type: 'collection';
16-
@element: 'breadcrumb';
15+
@type: "collection";
16+
@element: "breadcrumb";
1717

18-
@import (multiple) '../../theme.config';
18+
@import (multiple) "../../theme.config";
1919

2020
/*******************************
2121
Breadcrumb
@@ -112,7 +112,7 @@
112112
.ui.@{value}.breadcrumb {
113113
font-size: @s;
114114
}
115-
})
115+
});
116116
}
117117

118118
.loadUIOverrides();

src/definitions/collections/form.less

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
Theme
1313
*******************************/
1414

15-
@type: 'collection';
16-
@element: 'form';
15+
@type: "collection";
16+
@element: "form";
1717

18-
@import (multiple) '../../theme.config';
18+
@import (multiple) "../../theme.config";
1919

2020
/*******************************
2121
Elements
@@ -98,8 +98,8 @@
9898
}
9999

100100
/* Set max height on unusual input */
101-
.ui.form::-webkit-datetime-edit,
102-
.ui.form::-webkit-inner-spin-button {
101+
.ui.form ::-webkit-datetime-edit,
102+
.ui.form ::-webkit-inner-spin-button {
103103
height: @inputLineHeight;
104104
}
105105

@@ -281,7 +281,7 @@
281281
}
282282

283283
& when (@variationFormInline) {
284-
/* Inline */
284+
/* Inline */
285285
.ui.form .inline.fields .field:not(.wide) .ui.input,
286286
.ui.form .inline.field:not(.wide) .ui.input {
287287
width: auto;
@@ -322,7 +322,7 @@
322322
.ui.form .@{state}.message:empty {
323323
display: none;
324324
}
325-
})
325+
});
326326
}
327327

328328
/* Assumptions */
@@ -383,24 +383,24 @@
383383
--------------------- */
384384

385385
/* browsers require these rules separate */
386-
.ui.form::-webkit-input-placeholder {
386+
.ui.form ::-webkit-input-placeholder {
387387
color: @inputPlaceholderColor;
388388
}
389-
.ui.form:-ms-input-placeholder when (@supportIE) {
389+
.ui.form :-ms-input-placeholder when (@supportIE) {
390390
color: @inputPlaceholderColor !important;
391391
}
392-
.ui.form::-moz-placeholder {
392+
.ui.form ::-moz-placeholder {
393393
color: @inputPlaceholderColor;
394394
opacity: 1;
395395
}
396396

397-
.ui.form:focus::-webkit-input-placeholder {
397+
.ui.form :focus::-webkit-input-placeholder {
398398
color: @inputPlaceholderFocusColor;
399399
}
400-
.ui.form:focus:-ms-input-placeholder when (@supportIE) {
400+
.ui.form :focus:-ms-input-placeholder when (@supportIE) {
401401
color: @inputPlaceholderFocusColor !important;
402402
}
403-
.ui.form:focus::-moz-placeholder {
403+
.ui.form :focus::-moz-placeholder {
404404
color: @inputPlaceholderFocusColor;
405405
}
406406

@@ -740,7 +740,7 @@
740740
color: @lbg;
741741
}
742742
}
743-
})
743+
});
744744
}
745745

746746
& when (@variationFormDisabled) {
@@ -750,15 +750,15 @@
750750

751751
.ui.form .disabled.fields .field,
752752
.ui.form .disabled.field,
753-
.ui.form .field:disabled {
753+
.ui.form .field :disabled {
754754
pointer-events: @disabledPointerEvents;
755755
opacity: @disabledOpacity;
756756
}
757757
.ui.form .field.disabled > label,
758758
.ui.form .fields.disabled > label {
759759
opacity: @disabledLabelOpacity;
760760
}
761-
.ui.form .field.disabled:disabled {
761+
.ui.form .field.disabled :disabled {
762762
opacity: 1;
763763
}
764764
}
@@ -775,7 +775,7 @@
775775
}
776776
.ui.loading.form::before {
777777
position: absolute;
778-
content: '';
778+
content: "";
779779
top: 0;
780780
left: 0;
781781
background: @loaderDimmerColor;
@@ -790,7 +790,7 @@
790790

791791
.ui.loading.form::after {
792792
position: absolute;
793-
content: '';
793+
content: "";
794794
top: 50%;
795795
left: 50%;
796796
margin: @loaderMargin;
@@ -1167,7 +1167,7 @@
11671167
.ui.@{value}.form .field .dropdown .menu > .item {
11681168
font-size: @s;
11691169
}
1170-
})
1170+
});
11711171
}
11721172

11731173
.loadUIOverrides();

0 commit comments

Comments
 (0)