Skip to content

Commit 3ee8970

Browse files
authored
add stylelint-stylistic (#25285)
Add [stylelint-stylistic](https://github.com/elirasza/stylelint-stylistic), autofix all issues with two manual tweaks. This restores all the stylistic rules removed in Stylelint 15.
1 parent 69b1e2f commit 3ee8970

13 files changed

+108
-27
lines changed

.stylelintrc.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins:
22
- stylelint-declaration-strict-value
3+
- stylelint-stylistic
34

45
ignoreFiles:
56
- "**/*.go"
@@ -132,6 +133,82 @@ rules:
132133
selector-type-no-unknown: [true, {ignore: [custom-elements]}]
133134
shorthand-property-no-redundant-values: true
134135
string-no-newline: true
136+
stylistic/at-rule-name-case: null
137+
stylistic/at-rule-name-newline-after: null
138+
stylistic/at-rule-name-space-after: null
139+
stylistic/at-rule-semicolon-newline-after: null
140+
stylistic/at-rule-semicolon-space-before: null
141+
stylistic/block-closing-brace-empty-line-before: null
142+
stylistic/block-closing-brace-newline-after: null
143+
stylistic/block-closing-brace-newline-before: null
144+
stylistic/block-closing-brace-space-after: null
145+
stylistic/block-closing-brace-space-before: null
146+
stylistic/block-opening-brace-newline-after: null
147+
stylistic/block-opening-brace-newline-before: null
148+
stylistic/block-opening-brace-space-after: null
149+
stylistic/block-opening-brace-space-before: null
150+
stylistic/color-hex-case: lower
151+
stylistic/declaration-bang-space-after: never
152+
stylistic/declaration-bang-space-before: null
153+
stylistic/declaration-block-semicolon-newline-after: null
154+
stylistic/declaration-block-semicolon-newline-before: null
155+
stylistic/declaration-block-semicolon-space-after: null
156+
stylistic/declaration-block-semicolon-space-before: never
157+
stylistic/declaration-block-trailing-semicolon: null
158+
stylistic/declaration-colon-newline-after: null
159+
stylistic/declaration-colon-space-after: null
160+
stylistic/declaration-colon-space-before: never
161+
stylistic/function-comma-newline-after: null
162+
stylistic/function-comma-newline-before: null
163+
stylistic/function-comma-space-after: null
164+
stylistic/function-comma-space-before: null
165+
stylistic/function-max-empty-lines: 0
166+
stylistic/function-parentheses-newline-inside: never-multi-line
167+
stylistic/function-parentheses-space-inside: null
168+
stylistic/function-whitespace-after: null
169+
stylistic/indentation: 2
170+
stylistic/linebreaks: null
171+
stylistic/max-empty-lines: 1
172+
stylistic/max-line-length: null
173+
stylistic/media-feature-colon-space-after: null
174+
stylistic/media-feature-colon-space-before: never
175+
stylistic/media-feature-name-case: null
176+
stylistic/media-feature-parentheses-space-inside: null
177+
stylistic/media-feature-range-operator-space-after: always
178+
stylistic/media-feature-range-operator-space-before: always
179+
stylistic/media-query-list-comma-newline-after: null
180+
stylistic/media-query-list-comma-newline-before: null
181+
stylistic/media-query-list-comma-space-after: null
182+
stylistic/media-query-list-comma-space-before: null
183+
stylistic/no-empty-first-line: null
184+
stylistic/no-eol-whitespace: true
185+
stylistic/no-extra-semicolons: true
186+
stylistic/no-missing-end-of-source-newline: null
187+
stylistic/number-leading-zero: null
188+
stylistic/number-no-trailing-zeros: null
189+
stylistic/property-case: lower
190+
stylistic/selector-attribute-brackets-space-inside: null
191+
stylistic/selector-attribute-operator-space-after: null
192+
stylistic/selector-attribute-operator-space-before: null
193+
stylistic/selector-combinator-space-after: null
194+
stylistic/selector-combinator-space-before: null
195+
stylistic/selector-descendant-combinator-no-non-space: null
196+
stylistic/selector-list-comma-newline-after: null
197+
stylistic/selector-list-comma-newline-before: null
198+
stylistic/selector-list-comma-space-after: always-single-line
199+
stylistic/selector-list-comma-space-before: never-single-line
200+
stylistic/selector-max-empty-lines: 0
201+
stylistic/selector-pseudo-class-case: lower
202+
stylistic/selector-pseudo-class-parentheses-space-inside: never
203+
stylistic/selector-pseudo-element-case: lower
204+
stylistic/string-quotes: double
205+
stylistic/unicode-bom: null
206+
stylistic/unit-case: lower
207+
stylistic/value-list-comma-newline-after: null
208+
stylistic/value-list-comma-newline-before: null
209+
stylistic/value-list-comma-space-after: null
210+
stylistic/value-list-comma-space-before: null
211+
stylistic/value-list-max-empty-lines: 0
135212
time-min-milliseconds: null
136213
unit-allowed-list: null
137214
unit-disallowed-list: null

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
"postcss-html": "1.5.0",
7777
"stylelint": "15.7.0",
7878
"stylelint-declaration-strict-value": "1.9.2",
79+
"stylelint-stylistic": "0.4.2",
7980
"svgo": "3.0.2",
8081
"updates": "14.1.1",
8182
"vitest": "0.32.0"

web_src/css/base.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ img.ui.avatar,
15731573
position: absolute;
15741574
display: block;
15751575
background: linear-gradient(to right, var(--color-header-wrapper-transparent), var(--color-header-wrapper) 100%);
1576-
content: '';
1576+
content: "";
15771577
right: 0;
15781578
height: 39px;
15791579
width: 60px;
@@ -2168,7 +2168,6 @@ table th[data-sortt-desc] .svg {
21682168
background: var(--color-secondary-dark-1) !important;
21692169
}
21702170

2171-
21722171
/* https://github.com/go-gitea/gitea/pull/11486 */
21732172
.ui.sub.header {
21742173
text-transform: none;

web_src/css/features/imagediff.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@
5050
overflow: hidden;
5151
}
5252

53-
.image-diff-container
54-
.diff-swipe
55-
.swipe-frame
56-
.swipe-container
57-
.after-container {
53+
.image-diff-container .diff-swipe .swipe-frame .swipe-container .after-container {
5854
position: absolute;
5955
right: 0;
6056
}

web_src/css/helpers.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Gitea's private styles use `g-` prefix.
4040
text-overflow: ellipsis !important;
4141
}
4242

43-
4443
.g-table-auto-ellipsis td.auto-ellipsis {
4544
position: relative;
4645
}

web_src/css/modules/button.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ a.btn:hover {
9595
background: var(--color-hover);
9696
}
9797

98-
9998
.ui.basic.buttons .button:active,
10099
.ui.basic.button:active,
101100
.ui.basic.buttons .active.button,

web_src/css/modules/normalize.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ Correct the inability to style clickable types in iOS and Safari.
144144
*/
145145

146146
button,
147-
[type='button'],
148-
[type='reset'],
149-
[type='submit'] {
147+
[type="button"],
148+
[type="reset"],
149+
[type="submit"] {
150150
-webkit-appearance: button;
151151
}
152152

@@ -206,7 +206,7 @@ Correct the cursor style of increment and decrement buttons in Safari.
206206
2. Correct the outline style in Safari.
207207
*/
208208

209-
[type='search'] {
209+
[type="search"] {
210210
-webkit-appearance: textfield; /* 1 */
211211
outline-offset: -2px; /* 2 */
212212
}

web_src/css/modules/select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
top: 12px;
1414
right: 8px;
1515
pointer-events: none;
16-
content: '';
16+
content: "";
1717
width: 14px;
1818
height: 14px;
1919
mask-size: cover;

web_src/css/repo.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,6 @@
18441844
border: none;
18451845
}
18461846

1847-
18481847
@media (max-width: 991.98px) {
18491848
.diff-file-box {
18501849
scroll-margin-top: 77px; /* match .repository .diff-detail-box */
@@ -1854,9 +1853,9 @@
18541853
/* TODO: this can potentially be made "global" by removing the class prefix */
18551854
.diff-file-box .ui.attached.header,
18561855
.diff-file-box .ui.attached.table {
1857-
margin: 0; /* remove fomantic negative margins */;
1858-
width: initial; /* remove fomantic over 100% width */;
1859-
max-width: initial; /* remove fomantic over 100% width */;
1856+
margin: 0; /* remove fomantic negative margins */
1857+
width: initial; /* remove fomantic over 100% width */
1858+
max-width: initial; /* remove fomantic over 100% width */
18601859
}
18611860

18621861
.repository .diff-stats {
@@ -1908,7 +1907,6 @@
19081907
flex: 1
19091908
}
19101909

1911-
19121910
.repository.packages .empty {
19131911
padding-top: 70px;
19141912
padding-bottom: 100px;

web_src/css/review.css

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@
9595
.comment-code-cloud .comments .comment {
9696
display: flex;
9797
}
98-
.comment-code-cloud
99-
.comments
100-
.comment
101-
.comment-header-right.actions
102-
.ui.basic.label {
98+
.comment-code-cloud .comments .comment .comment-header-right.actions .ui.basic.label {
10399
display: none;
104100
}
105101
.comment-code-cloud .comments .comment .avatar {

web_src/css/shared/settings.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ details.toggleable-item summary::-webkit-details-marker /* Safari */ {
2121

2222
details.toggleable-item summary::after {
2323
transition: transform 0.25s ease;
24-
content: '';
24+
content: "";
2525
width: 14px;
2626
height: 14px;
2727
mask-size: cover;

web_src/css/standalone/swagger.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ body {
3434
background: #1e1e1e;
3535
}
3636
.swagger-ui, .swagger-back-link {
37-
filter: invert(88%) hue-rotate(180deg);
37+
filter: invert(88%) hue-rotate(180deg);
3838
}
3939
.swagger-ui .microlight {
40-
filter: invert(100%) hue-rotate(180deg);
40+
filter: invert(100%) hue-rotate(180deg);
4141
}
4242
}

0 commit comments

Comments
 (0)