Skip to content

Commit 0ae2adf

Browse files
committed
Update formatting settings
1 parent 8239deb commit 0ae2adf

11 files changed

+11190
-10412
lines changed

.changeset/config.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
3-
"access": "public",
4-
"baseBranch": "main",
5-
"changelog": [
6-
"@zazen/changesets-changelog",
7-
{ "repo": "stormwarning/tailwindcss-capsize" }
8-
],
9-
"commit": false,
10-
"ignore": [],
11-
"linked": [],
12-
"updateInternalDependencies": "patch"
2+
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
3+
"access": "public",
4+
"baseBranch": "main",
5+
"changelog": [
6+
"@zazen/changesets-changelog",
7+
{ "repo": "stormwarning/tailwindcss-capsize" }
8+
],
9+
"commit": false,
10+
"ignore": [],
11+
"linked": [],
12+
"updateInternalDependencies": "patch"
1313
}

.editorconfig

-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ root = true
44
[*]
55
charset = utf-8
66
end_of_line = lf
7-
indent_size = 4
87
indent_style = tab
98
insert_final_newline = true
109
trim_trailing_whitespace = true
1110

1211
[*.md]
1312
trim_trailing_whitespace = false
14-
15-
[*.{json,yml}]
16-
indent_size = 2
17-
indent_style = space

.eslintrc.cjs

+9-5
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ const config = {
88
env: {
99
node: true,
1010
},
11-
rules: {},
11+
rules: {
12+
'@typescript-eslint/ban-types': 'off',
13+
'@typescript-eslint/lines-between-class-members': 'off',
14+
'@typescript-eslint/padding-line-between-statements': 'off',
15+
16+
'n/file-extension-in-import': ['error', 'always'],
17+
},
1218
overrides: [
1319
{
1420
// Jest config
15-
files: [
16-
'**/__tests__/**/*.{js,ts,tsx}',
17-
'**/*.@(spec|test).{js,ts,tsx}',
18-
],
21+
files: ['**/__tests__/**/*.{js,ts,tsx}', '**/*.@(spec|test).{js,ts,tsx}'],
1922
env: {
2023
jest: true,
2124
},
@@ -33,4 +36,5 @@ const config = {
3336
],
3437
}
3538

39+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3640
module.exports = config

.github/renovate.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["github>tidaltheory/renovate-config"]
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["github>tidaltheory/renovate-config"]
44
}

__tests__/plugin.test.ts

+36-47
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
22
/// <reference path="../types/vitest.d.ts" />
33

4-
import { describe, it, expect } from 'vitest'
4+
import { describe, expect, it } from 'vitest'
55

66
import capsizePlugin from '../src/index.js'
77
import { css, html, run } from './run.js'
@@ -85,16 +85,14 @@ describe('Plugin', () => {
8585
8686
.leading-md {
8787
--line-height-offset: calc(
88-
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) /
89-
var(--font-size-px)
88+
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) / var(--font-size-px)
9089
);
9190
line-height: 2.5rem;
9291
}
9392
9493
.leading-sm {
9594
--line-height-offset: calc(
96-
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
97-
var(--font-size-px)
95+
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
9896
);
9997
line-height: 20px;
10098
}
@@ -104,23 +102,20 @@ describe('Plugin', () => {
104102
content: '';
105103
margin-bottom: calc(
106104
(
107-
(
108-
var(--ascent-scale) - var(--cap-height-scale) +
109-
var(--line-gap-scale) / 2
110-
) - var(--line-height-offset)
111-
) * -1em
105+
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
106+
--line-height-offset
107+
)
108+
) *
109+
-1em
112110
);
113111
}
114112
115113
.capsize::after {
116114
display: table;
117115
content: '';
118116
margin-top: calc(
119-
(
120-
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
121-
--line-height-offset
122-
)
123-
) * -1em
117+
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
118+
-1em
124119
);
125120
}
126121
@@ -146,16 +141,14 @@ describe('Plugin', () => {
146141
147142
.sm\\:leading-md {
148143
--line-height-offset: calc(
149-
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) /
150-
var(--font-size-px)
144+
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) / var(--font-size-px)
151145
);
152146
line-height: 2.5rem;
153147
}
154148
155149
.sm\\:leading-sm {
156150
--line-height-offset: calc(
157-
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
158-
var(--font-size-px)
151+
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
159152
);
160153
line-height: 20px;
161154
}
@@ -202,16 +195,14 @@ describe('Plugin', () => {
202195
203196
.leading-md {
204197
--line-height-offset: calc(
205-
(((var(--line-height-scale) * var(--font-size-px)) - 30) / 2) /
206-
var(--font-size-px)
198+
(((var(--line-height-scale) * var(--font-size-px)) - 30) / 2) / var(--font-size-px)
207199
);
208200
line-height: 2.5rem;
209201
}
210202
211203
.leading-sm {
212204
--line-height-offset: calc(
213-
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
214-
var(--font-size-px)
205+
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
215206
);
216207
line-height: 20px;
217208
}
@@ -221,23 +212,20 @@ describe('Plugin', () => {
221212
content: '';
222213
margin-bottom: calc(
223214
(
224-
(
225-
var(--ascent-scale) - var(--cap-height-scale) +
226-
var(--line-gap-scale) / 2
227-
) - var(--line-height-offset)
228-
) * -1em
215+
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
216+
--line-height-offset
217+
)
218+
) *
219+
-1em
229220
);
230221
}
231222
232223
.capsize::after {
233224
display: table;
234225
content: '';
235226
margin-top: calc(
236-
(
237-
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
238-
--line-height-offset
239-
)
240-
) * -1em
227+
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
228+
-1em
241229
);
242230
}
243231
`),
@@ -281,8 +269,10 @@ describe('Plugin', () => {
281269
(var(--line-height-scale) * var(--font-size-px)) - calc(
282270
1.5 * var(--font-size-px)
283271
)
284-
) / 2
285-
) / var(--font-size-px)
272+
) /
273+
2
274+
) /
275+
var(--font-size-px)
286276
);
287277
line-height: 1.5;
288278
}
@@ -294,8 +284,10 @@ describe('Plugin', () => {
294284
(var(--line-height-scale) * var(--font-size-px)) - calc(
295285
1 * var(--font-size-px)
296286
)
297-
) / 2
298-
) / var(--font-size-px)
287+
) /
288+
2
289+
) /
290+
var(--font-size-px)
299291
);
300292
line-height: 100%;
301293
}
@@ -305,23 +297,20 @@ describe('Plugin', () => {
305297
content: '';
306298
margin-bottom: calc(
307299
(
308-
(
309-
var(--ascent-scale) - var(--cap-height-scale) +
310-
var(--line-gap-scale) / 2
311-
) - var(--line-height-offset)
312-
) * -1em
300+
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
301+
--line-height-offset
302+
)
303+
) *
304+
-1em
313305
);
314306
}
315307
316308
.capsize::after {
317309
display: table;
318310
content: '';
319311
margin-top: calc(
320-
(
321-
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
322-
--line-height-offset
323-
)
324-
) * -1em
312+
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
313+
-1em
325314
);
326315
}
327316
`),

__tests__/setup.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55

66
import { diff } from 'jest-diff'
7+
// eslint-disable-next-line import/default
78
import prettier from 'prettier'
89
import { expect } from 'vitest'
910

@@ -51,7 +52,7 @@ expect.extend({
5152
return (
5253
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
5354
'\n\n' +
54-
(diffString && diffString.includes('- Expect')
55+
(diffString?.includes('- Expect')
5556
? `Difference:\n\n${diffString}`
5657
: `Expected: ${this.utils.printExpected(expected)}\n` +
5758
`Received: ${this.utils.printReceived(actual)}`)

0 commit comments

Comments
 (0)