Skip to content

Commit 6708260

Browse files
committed
chore: lint with prettier on build
1 parent bf62c8c commit 6708260

40 files changed

+221
-233
lines changed

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 100
3+
}

css/pico.classless.css

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

css/pico.classless.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/pico.css

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

css/pico.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/themes/default.css

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

css/themes/default.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,20 @@
2929
},
3030
"scripts": {
3131
"✨": "run-s build",
32-
"build": "run-s \"build:*\" --silent",
32+
"build": "run-s lint \"build:*\" --silent",
3333
"watch": "nodemon -q --watch scss/ --ext scss --exec 'run-s build'",
34-
"build:sort-scss": "postcss --config scss ./scss/**/*.scss --replace",
34+
"lint": "run-s \"lint:*\" --silent",
35+
"lint:prettier": "prettier --write --loglevel silent 'scss/**/*.scss'",
36+
"lint:sort-scss": "postcss --config scss ./scss/**/*.scss --replace",
3537
"build:css": "sass --style expanded --source-map --embed-sources --no-error-css scss/:css/",
3638
"build:autoprefix": "postcss --config css --replace css/*.css css/*/*.css !css/*.min.css !css/*/*.min.css",
3739
"build:minify": "cleancss -O1 --with-rebase --batch --batch-suffix .min css/*.css css/*/*.css !css/*.min.css !css/*/*.min.css",
38-
"prebuild": "echo '\\033[32m[@picocss/pico] ✨ Start\\033[0m'",
39-
"prebuild:sort-scss": "echo '[@picocss/pico] ✨ Clean SCSS files'",
40+
"prebuild": "echo '\\033[96m[@picocss/pico] ✨ Start\\033[0m'",
41+
"prelint": "echo '[@picocss/pico] ✨ Lint'",
4042
"prebuild:css": "echo '[@picocss/pico] ✨ Compile'",
4143
"prebuild:autoprefix": "echo '[@picocss/pico] ✨ Autoprefix'",
4244
"prebuild:minify": "echo '[@picocss/pico] ✨ Minify'",
43-
"postbuild:minify": "echo '\\033[32m[@picocss/pico] ✨ Build done\\033[0m'"
45+
"postbuild:minify": "echo '\\033[32m[@picocss/pico] ✨ Done\\033[0m'"
4446
},
4547
"devDependencies": {
4648
"autoprefixer": "^10.4.12",
@@ -51,6 +53,7 @@
5153
"postcss": "^8.4.17",
5254
"postcss-cli": "^10.0.0",
5355
"postcss-scss": "^4.0.5",
56+
"prettier": "2.7.1",
5457
"sass": "^1.55.0"
5558
},
5659
"browserslist": [
@@ -59,4 +62,4 @@
5962
"not dead",
6063
"not ie > 0"
6164
]
62-
}
65+
}

scss/_functions.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Output color in RGB format
22
@function to-rgb($color) {
33
@return unquote("rgb(#{red($color)}, #{green($color)}, #{blue($color)})");
4-
}
4+
}

scss/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ $enable-semantic-container: false !default;
1010
// Enable .container and .container-fluid
1111
$enable-class-container: true !default;
1212

13-
// Enable a centered viewport for <header>, <main>, <footer> inside $enable-semantic-container
13+
// Enable a centered viewport for <header>, <main>, <footer> inside $enable-semantic-container
1414
// Fluid layout if disabled
1515
$enable-viewport: true !default;
1616

scss/components/_accordion.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ details {
113113
}
114114
}
115115
}
116-
}
116+
}

scss/components/_card.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ article {
1313
> footer {
1414
margin-right: calc(var(--block-spacing-horizontal) * -1);
1515
margin-left: calc(var(--block-spacing-horizontal) * -1);
16-
padding: calc(var(--block-spacing-vertical) * 0.66)
17-
var(--block-spacing-horizontal);
16+
padding: calc(var(--block-spacing-vertical) * 0.66) var(--block-spacing-horizontal);
1817
background-color: var(--card-sectionning-background-color);
1918
}
2019

@@ -33,4 +32,4 @@ article {
3332
border-bottom-right-radius: var(--border-radius);
3433
border-bottom-left-radius: var(--border-radius);
3534
}
36-
}
35+
}

scss/components/_dropdown.scss

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ li[role="list"] > ul {
3131
li {
3232
width: 100%;
3333
margin-bottom: 0;
34-
padding: calc(var(--form-element-spacing-vertical) * 0.5)
35-
var(--form-element-spacing-horizontal);
34+
padding: calc(var(--form-element-spacing-vertical) * 0.5) var(--form-element-spacing-horizontal);
3635
list-style: none;
3736

3837
&:first-of-type {
@@ -89,11 +88,10 @@ details[role="list"] {
8988

9089
&:not([role]) {
9190
height: calc(
92-
1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 +
93-
var(--border-width) * 2
91+
1rem * var(--line-height) + var(--form-element-spacing-vertical) * 2 + var(--border-width) *
92+
2
9493
);
95-
padding: var(--form-element-spacing-vertical)
96-
var(--form-element-spacing-horizontal);
94+
padding: var(--form-element-spacing-vertical) var(--form-element-spacing-horizontal);
9795
border: var(--border-width) solid var(--form-element-border-color);
9896
border-radius: var(--border-radius);
9997
background-color: var(--form-element-background-color);
@@ -102,9 +100,8 @@ details[role="list"] {
102100
cursor: pointer;
103101

104102
@if $enable-transitions {
105-
transition: background-color var(--transition),
106-
border-color var(--transition), color var(--transition),
107-
box-shadow var(--transition);
103+
transition: background-color var(--transition), border-color var(--transition),
104+
color var(--transition), box-shadow var(--transition);
108105
}
109106

110107
&:active,
@@ -205,4 +202,4 @@ li[role="list"] {
205202
> a::after {
206203
background-image: var(--icon-chevron);
207204
}
208-
}
205+
}

scss/components/_modal.scss

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ dialog {
4545

4646
> header,
4747
> footer {
48-
padding: calc(var(--block-spacing-vertical) * 0.5)
49-
var(--block-spacing-horizontal);
48+
padding: calc(var(--block-spacing-vertical) * 0.5) var(--block-spacing-horizontal);
5049
}
5150

5251
> header {
@@ -135,7 +134,7 @@ dialog {
135134

136135
dialog {
137136
animation-duration: ($animation-duration * 4);
138-
animation-name: modal-overlay ;
137+
animation-name: modal-overlay;
139138

140139
> article {
141140
animation-delay: $animation-duration;
@@ -165,4 +164,4 @@ dialog {
165164
opacity: 0;
166165
}
167166
}
168-
}
167+
}

scss/components/_nav.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ nav {
4141
li {
4242
display: inline-block;
4343
margin: 0;
44-
padding: var(--nav-element-spacing-vertical)
45-
var(--nav-element-spacing-horizontal);
44+
padding: var(--nav-element-spacing-vertical) var(--nav-element-spacing-horizontal);
4645

4746
// Minimal support for buttons and forms elements
4847
> * {
@@ -111,8 +110,7 @@ aside {
111110
}
112111

113112
li {
114-
padding: calc(var(--nav-element-spacing-vertical) * 0.5)
115-
var(--nav-element-spacing-horizontal);
113+
padding: calc(var(--nav-element-spacing-vertical) * 0.5) var(--nav-element-spacing-horizontal);
116114

117115
a {
118116
display: block;
@@ -138,4 +136,4 @@ aside {
138136
}
139137
}
140138
}
141-
}
139+
}

scss/components/_progress.scss

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ progress {
5353
@media (prefers-reduced-motion: no-preference) {
5454
&:indeterminate {
5555
background: var(--progress-background-color)
56-
linear-gradient(
57-
to right,
58-
var(--progress-color) 30%,
59-
var(--progress-background-color) 30%
60-
)
56+
linear-gradient(to right, var(--progress-color) 30%, var(--progress-background-color) 30%)
6157
top left / 150% 150% no-repeat;
62-
animation: progress-indeterminate 1s linear infinite;
58+
animation: progress-indeterminate 1s linear infinite;
6359

6460
&[value]::-webkit-progress-value {
6561
background-color: transparent;
@@ -86,4 +82,4 @@ progress {
8682
100% {
8783
background-position: -200% 0;
8884
}
89-
}
85+
}

0 commit comments

Comments
 (0)