Skip to content

Commit a1ed5fe

Browse files
authored
Set up prettier (#883)
1 parent 40ef355 commit a1ed5fe

29 files changed

+1401
-1144
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ indent_size = 4
1919
indent_style = space
2020
indent_size = 2
2121

22+
[*.{ts,tsx}]
23+
indent_style = space
24+
indent_size = 4
25+
quote_type = single
26+
2227
# Dotnet code style settings:
2328
[*.{cs,vb}]
2429
trim_trailing_whitespace=true

.github/workflows/pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
- name: Lint
6060
run: npm run lint
6161

62+
- name: Format
63+
run: npm run fmt:check
64+
6265

6366
build:
6467
runs-on: ${{ matrix.os }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Ignore artifacts:
2+
build
3+
coverage

src/Elastic.Markdown/.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"plugins": ["prettier-plugin-tailwindcss"]
6+
}
Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,45 @@
11
/* Copy buttons */
22
button.copybtn {
3-
position: absolute;
4-
display: flex;
5-
top: calc(var(--spacing) * 5);
6-
right: calc(var(--spacing) * 4);
7-
width: 1.7em;
8-
height: 1.7em;
3+
position: absolute;
4+
display: flex;
5+
top: calc(var(--spacing) * 5);
6+
right: calc(var(--spacing) * 4);
7+
width: 1.7em;
8+
height: 1.7em;
99
opacity: 0;
10-
transition: opacity 0.3s, border .3s, background-color .3s;
11-
user-select: none;
10+
transition:
11+
opacity 0.3s,
12+
border 0.3s,
13+
background-color 0.3s;
14+
user-select: none;
1215
cursor: pointer;
13-
padding: 0;
14-
border: none;
15-
outline: none;
16-
border-radius: 0.4em;
17-
background-color: rgb(34, 39, 46);
18-
color: var(--color-grey-50);
16+
padding: 0;
17+
border: none;
18+
outline: none;
19+
border-radius: 0.4em;
20+
background-color: rgb(34, 39, 46);
21+
color: var(--color-grey-50);
1922
}
2023

2124
button.copybtn.success {
2225
background-color: rgb(34, 39, 46);
23-
color: #22863a;
26+
color: #22863a;
2427
}
2528

2629
button.copybtn svg {
27-
stroke: currentColor;
28-
width: 1.5em;
29-
height: 1.5em;
30-
padding: 0.1em;
30+
stroke: currentColor;
31+
width: 1.5em;
32+
height: 1.5em;
33+
padding: 0.1em;
3134
}
3235

33-
div.highlight {
34-
position: relative;
36+
div.highlight {
37+
position: relative;
3538
}
3639

3740
/* Show the copybutton */
38-
.highlight:hover button.copybtn, button.copybtn.success {
41+
.highlight:hover button.copybtn,
42+
button.copybtn.success {
3943
opacity: 1;
4044
}
4145

@@ -47,39 +51,43 @@ div.highlight {
4751
*
4852
* <p class="o-tooltip--left" data-tooltip="Hey">Short</p>
4953
*/
50-
.o-tooltip--left {
51-
position: relative;
52-
}
54+
.o-tooltip--left {
55+
position: relative;
56+
}
5357

54-
.o-tooltip--left:after {
55-
opacity: 0;
56-
visibility: hidden;
57-
position: absolute;
58-
content: attr(data-tooltip);
59-
padding: .2em;
60-
font-size: var(--text-sm);
61-
left: -.2em;
58+
.o-tooltip--left:after {
59+
opacity: 0;
60+
visibility: hidden;
61+
position: absolute;
62+
content: attr(data-tooltip);
63+
padding: 0.2em;
64+
font-size: var(--text-sm);
65+
left: -0.2em;
6266
background-color: rgb(34, 39, 46);
63-
color: var(--color-grey-50);
64-
white-space: nowrap;
65-
z-index: 2;
66-
border-radius: 2px;
67-
transform: translateX(-102%) translateY(0);
68-
transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
67+
color: var(--color-grey-50);
68+
white-space: nowrap;
69+
z-index: 2;
70+
border-radius: 2px;
71+
transform: translateX(-102%) translateY(0);
72+
transition:
73+
opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1),
74+
transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
6975
}
7076

7177
.o-tooltip--left:hover:after {
72-
display: block;
73-
opacity: 1;
74-
visibility: visible;
75-
transform: translateX(-100%) translateY(0);
76-
transition: opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1), transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
77-
transition-delay: .5s;
78+
display: block;
79+
opacity: 1;
80+
visibility: visible;
81+
transform: translateX(-100%) translateY(0);
82+
transition:
83+
opacity 0.2s cubic-bezier(0.64, 0.09, 0.08, 1),
84+
transform 0.2s cubic-bezier(0.64, 0.09, 0.08, 1);
85+
transition-delay: 0.5s;
7886
}
7987

8088
/* By default the copy button shouldn't show up when printing a page */
8189
@media print {
82-
button.copybtn {
83-
display: none;
84-
}
90+
button.copybtn {
91+
display: none;
92+
}
8593
}

0 commit comments

Comments
 (0)