Skip to content

Commit 0986a2c

Browse files
Florens VerscheldejasonLaster
Florens Verschelde
authored andcommitted
Use stylelint-prettier instead of stylelint formatting rules (firefox-devtools#8098)
1 parent a0bd711 commit 0986a2c

File tree

13 files changed

+59
-86
lines changed

13 files changed

+59
-86
lines changed

.stylelintignore

-3
This file was deleted.

.stylelintrc

+4-40
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,19 @@
11
{
2+
"plugins": ["stylelint-prettier"],
23
"rules": {
3-
"at-rule-semicolon-newline-after": "always",
4-
"block-closing-brace-newline-after": "always",
5-
"block-closing-brace-newline-before": "always-multi-line",
6-
"block-closing-brace-space-before": "always-single-line",
74
"block-no-empty": true,
8-
"block-opening-brace-newline-after": "always-multi-line",
9-
"block-opening-brace-space-after": "always-single-line",
10-
"block-opening-brace-space-before": "always",
11-
"color-hex-case": "lower",
125
"color-hex-length": "long",
136
"color-no-invalid-hex": true,
14-
"declaration-bang-space-after": "never",
15-
"declaration-bang-space-before": "always",
167
"declaration-block-no-shorthand-property-overrides": true,
17-
"declaration-block-semicolon-newline-after": "always-multi-line",
18-
"declaration-block-semicolon-space-after": "always-single-line",
19-
"declaration-block-semicolon-space-before": "never",
208
"declaration-block-single-line-max-declarations": 1,
21-
"declaration-block-trailing-semicolon": "always",
22-
"declaration-colon-space-after": "always-single-line",
23-
"declaration-colon-space-before": "never",
249
"function-calc-no-unspaced-operator": true,
25-
"function-comma-newline-after": "always-multi-line",
26-
"function-comma-space-after": "always-single-line",
27-
"function-comma-space-before": "never",
2810
"function-linear-gradient-no-nonstandard-direction": true,
29-
"function-parentheses-newline-inside": "always-multi-line",
30-
"function-parentheses-space-inside": "never-single-line",
3111
"function-whitespace-after": "always",
32-
"max-empty-lines": 1,
33-
"media-feature-colon-space-after": "always",
34-
"media-feature-colon-space-before": "never",
35-
"media-feature-range-operator-space-after": "always",
36-
"media-feature-range-operator-space-before": "always",
37-
"media-query-list-comma-newline-after": "always-multi-line",
38-
"media-query-list-comma-space-after": "always-single-line",
39-
"media-query-list-comma-space-before": "never",
40-
"media-feature-parentheses-space-inside": "never",
41-
"no-eol-whitespace": true,
4212
"no-invalid-double-slash-comments": true,
4313
"no-missing-end-of-source-newline": true,
44-
"number-leading-zero": "always",
45-
"number-no-trailing-zeros": true,
46-
"selector-combinator-space-after": "always",
47-
"selector-list-comma-space-before": "never",
14+
"prettier/prettier": true,
4815
"selector-pseudo-element-colon-notation": "double",
4916
"selector-type-case": "lower",
50-
"string-no-newline": true,
51-
"value-list-comma-newline-after": "always-multi-line",
52-
"value-list-comma-space-after": "always-single-line",
53-
"value-list-comma-space-before": "never",
54-
},
17+
"string-no-newline": true
18+
}
5519
}

bin/prettier.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const args = [
1414
"*.js",
1515
"*.json",
1616
"packages/**/src/*.js",
17+
"packages/**/src/*.css",
1718
"src/*.js",
1819
"src/*/*.js",
1920
"src/components/**/*.css",

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"license-check": "devtools-license-check",
2424
"links": "ls -l node_modules/ | grep ^l || echo 'no linked packages'",
2525
"lint": "run-p lint:css lint:js lint:jsx-a11y lint:md",
26-
"lint:css": "stylelint \"src/components/**/*.css\"",
26+
"lint:css": "stylelint \"src/components/**/*.css\" \"packages/*/src/**/*.css\"",
2727
"lint:js": "eslint *.js \"src/**/*.js\" \"packages/*/src/**/*.js\" --fix",
2828
"lint:jsx-a11y": "eslint *.js \"src/**/*.js\" \"packages/*/src/**/*.js\" --plugin=jsx-a11y --config=.eslintrc.jsx-a11y",
2929
"lint:md": "remark -u devtools-linters/markdown/preset -qf *.md src",
@@ -162,6 +162,7 @@
162162
"rimraf": "^2.6.1",
163163
"single-line-log": "^1.1.2",
164164
"stylelint": "^9.0.0",
165+
"stylelint-prettier": "^1.0.6",
165166
"webpack": "^3.5.5",
166167
"webpack-visualizer-plugin": "^0.1.11",
167168
"workerjs": "github:jasonLaster/workerjs#a2425aaeebacae7a7640e496a54c2a41962f3890"

packages/devtools-components/src/tree.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
/* We can remove the outline since we do add our own focus style on nodes */
5+
/* We can remove the outline since we do add our own focus style on nodes */
66
.tree:focus {
77
outline: none;
88
}
@@ -35,7 +35,7 @@
3535
display: inline-block;
3636
width: 12px;
3737
margin-inline-start: 5px;
38-
border-inline-start: 1px solid #A2D1FF;
38+
border-inline-start: 1px solid #a2d1ff;
3939
flex-shrink: 0;
4040
}
4141

@@ -47,7 +47,7 @@
4747
/* For non expandable root nodes, we don't have .tree-indent elements, so we declare
4848
the margin on the start of the node */
4949
.tree-node[data-expandable="false"][aria-level="1"] {
50-
padding-inline-start: 15px
50+
padding-inline-start: 15px;
5151
}
5252

5353
.tree .tree-node[data-expandable="true"] {

packages/devtools-reps/src/launchpad/components/Console.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ main {
2727
padding: 0.5rem;
2828
}
2929

30-
.rep-input:before {
30+
.rep-input::before {
3131
content: "➜ ";
3232
}
3333

@@ -48,7 +48,7 @@ main {
4848
}
4949

5050
.rep-element[data-mode]::before {
51-
content: attr(data-mode)":";
51+
content: attr(data-mode) ":";
5252
background-color: var(--theme-toolbar-background);
5353
font-family: monospace;
5454
display: inline-block;
@@ -73,7 +73,7 @@ main {
7373
.packet header .copy-label {
7474
margin: 0 0.5em;
7575
padding-inline-start: 0.5em;
76-
border-inline-start: 1px solid rgba(0,0,0, 0.2);
76+
border-inline-start: 1px solid rgba(0, 0, 0, 0.2);
7777
}
7878

7979
.packet header.packet-expanded::before {

packages/devtools-reps/src/object-inspector/components/ObjectInspector.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
color: var(--theme-body-color);
2828
}
2929

30-
.tree.object-inspector .block .object-label:before {
30+
.tree.object-inspector .block .object-label::before {
3131
content: "☲ ";
3232
font-size: 1.1em;
3333
}

packages/devtools-reps/src/reps/reps.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ button.invoke-getter {
288288
background-color: var(--theme-icon-color);
289289
height: 10px;
290290
vertical-align: middle;
291-
border:none;
291+
border: none;
292292
}
293293

294294
.invoke-getter:hover {

packages/devtools-splitter/src/SplitBox.css

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
}
4949

5050
.split-box.vert > .splitter {
51+
/* prettier-ignore */
5152
min-width: calc(var(--devtools-splitter-inline-start-width) +
5253
var(--devtools-splitter-inline-end-width) + 1px);
5354

@@ -61,6 +62,7 @@
6162
}
6263

6364
.split-box.horz > .splitter {
65+
/* prettier-ignore */
6466
min-height: calc(var(--devtools-splitter-top-width) +
6567
var(--devtools-splitter-bottom-width) + 1px);
6668
border-top-width: var(--devtools-splitter-top-width);

src/components/Editor/SearchBar.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
left: 0;
2020
right: 0;
2121
bottom: -1px;
22-
border: solid 1px var(--blue-50);
22+
border: solid 1px var(--blue-50);
2323
pointer-events: none;
2424
opacity: 0;
2525
transition: opacity 150ms ease-out;

src/components/PrimaryPanes/Sources.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@
157157
width: 100%;
158158
height: 2px;
159159
background-color: var(--tab-line-color, transparent);
160-
transition: transform 250ms var(--animation-curve), opacity 250ms var(--animation-curve);
160+
transition: transform 250ms var(--animation-curve),
161+
opacity 250ms var(--animation-curve);
161162
opacity: 0;
162163
transform: scaleX(0);
163164
}

src/components/SecondaryPanes/EventListeners.css

+32-32
Original file line numberDiff line numberDiff line change
@@ -3,56 +3,56 @@
33
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
44

55
.event-listeners-content {
6-
padding-top: 4px;
7-
padding-bottom: 4px;
8-
padding-inline-start: 14px;
9-
padding-inline-end: 20px;
6+
padding-top: 4px;
7+
padding-bottom: 4px;
8+
padding-inline-start: 14px;
9+
padding-inline-end: 20px;
1010
}
1111

1212
.event-listeners-content ul {
13-
padding: 0;
14-
list-style-type: none;
13+
padding: 0;
14+
list-style-type: none;
1515
}
1616

1717
.event-listener-group {
18-
user-select: none;
18+
user-select: none;
1919
}
2020

2121
.event-listener-header {
22-
display: flex;
23-
align-items: center;
22+
display: flex;
23+
align-items: center;
2424
}
2525

2626
.event-listener-expand {
27-
border: none;
28-
background: none;
29-
padding: 4px 5px;
30-
line-height: 12px;
27+
border: none;
28+
background: none;
29+
padding: 4px 5px;
30+
line-height: 12px;
3131
}
3232

3333
.event-listener-expand:hover {
34-
background: transparent;
34+
background: transparent;
3535
}
3636

3737
.event-listener-group input[type="checkbox"] {
38-
margin: 0px;
39-
margin-inline-end: 4px;
38+
margin: 0px;
39+
margin-inline-end: 4px;
4040
}
4141

4242
.event-listener-label {
43-
display: flex;
44-
align-items: center;
45-
padding-inline-start: 2px;
46-
padding-inline-end: 10px;
43+
display: flex;
44+
align-items: center;
45+
padding-inline-start: 2px;
46+
padding-inline-end: 10px;
4747
}
4848

4949
.event-listener-category {
50-
padding: 3px 0px;
51-
line-height: 14px;
50+
padding: 3px 0px;
51+
line-height: 14px;
5252
}
5353

5454
.event-listeners-content .arrow {
55-
margin-inline-end: 0;
55+
margin-inline-end: 0;
5656
}
5757

5858
html[dir="ltr"] .event-listeners-content .arrow.expanded {
@@ -64,19 +64,19 @@ html[dir="rtl"] .event-listeners-content .arrow.expanded {
6464
}
6565

6666
.event-listener-event {
67-
display: flex;
68-
align-items: center;
69-
margin-inline-start: 30px;
67+
display: flex;
68+
align-items: center;
69+
margin-inline-start: 30px;
7070
}
7171

7272
.event-listener-name {
73-
line-height: 14px;
74-
padding: 3px 0px;
73+
line-height: 14px;
74+
padding: 3px 0px;
7575
}
7676

7777
.event-listener-event input {
78-
margin-inline-end: 4px;
79-
margin-inline-start: 0px;
80-
margin-top: 0px;
81-
margin-bottom: 0px;
78+
margin-inline-end: 4px;
79+
margin-inline-start: 0px;
80+
margin-top: 0px;
81+
margin-bottom: 0px;
8282
}

yarn.lock

+7
Original file line numberDiff line numberDiff line change
@@ -12540,6 +12540,13 @@ style-search@^0.1.0:
1254012540
resolved "https://registry.yarnpkg.com/style-search/-/style-search-0.1.0.tgz#7958c793e47e32e07d2b5cafe5c0bf8e12e77902"
1254112541
integrity sha1-eVjHk+R+MuB9K1yv5cC/jhLneQI=
1254212542

12543+
stylelint-prettier@^1.0.6:
12544+
version "1.0.6"
12545+
resolved "https://registry.yarnpkg.com/stylelint-prettier/-/stylelint-prettier-1.0.6.tgz#479b76336751cb617c5beb7545d05a791f945e1e"
12546+
integrity sha512-XKlTyJHJYiyXs9JXRMt2FQxMJoBSjz4I6+4+/R3o8/ePof19v9naC4d0zsMKUJ88by81+qHfqXBLfmAalu46cg==
12547+
dependencies:
12548+
prettier-linter-helpers "^1.0.0"
12549+
1254312550
stylelint@^9.0.0:
1254412551
version "9.4.0"
1254512552
resolved "https://registry.yarnpkg.com/stylelint/-/stylelint-9.4.0.tgz#2f2b82ae9db53a06735ae0724f41b134fdb84a10"

0 commit comments

Comments
 (0)