Skip to content

Commit

Permalink
Update formatting settings
Browse files Browse the repository at this point in the history
  • Loading branch information
stormwarning committed Jan 30, 2025
1 parent 8239deb commit 0ae2adf
Show file tree
Hide file tree
Showing 11 changed files with 11,190 additions and 10,412 deletions.
22 changes: 11 additions & 11 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@zazen/changesets-changelog",
{ "repo": "stormwarning/tailwindcss-capsize" }
],
"commit": false,
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
"$schema": "https://unpkg.com/@changesets/config@latest/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": [
"@zazen/changesets-changelog",
{ "repo": "stormwarning/tailwindcss-capsize" }
],
"commit": false,
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
}
5 changes: 0 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{json,yml}]
indent_size = 2
indent_style = space
14 changes: 9 additions & 5 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ const config = {
env: {
node: true,
},
rules: {},
rules: {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/padding-line-between-statements': 'off',

'n/file-extension-in-import': ['error', 'always'],
},
overrides: [
{
// Jest config
files: [
'**/__tests__/**/*.{js,ts,tsx}',
'**/*.@(spec|test).{js,ts,tsx}',
],
files: ['**/__tests__/**/*.{js,ts,tsx}', '**/*.@(spec|test).{js,ts,tsx}'],
env: {
jest: true,
},
Expand All @@ -33,4 +36,5 @@ const config = {
],
}

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
module.exports = config
4 changes: 2 additions & 2 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>tidaltheory/renovate-config"]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>tidaltheory/renovate-config"]
}
83 changes: 36 additions & 47 deletions __tests__/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="../types/vitest.d.ts" />

import { describe, it, expect } from 'vitest'
import { describe, expect, it } from 'vitest'

import capsizePlugin from '../src/index.js'
import { css, html, run } from './run.js'
Expand Down Expand Up @@ -85,16 +85,14 @@ describe('Plugin', () => {
.leading-md {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) / var(--font-size-px)
);
line-height: 2.5rem;
}
.leading-sm {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
);
line-height: 20px;
}
Expand All @@ -104,23 +102,20 @@ describe('Plugin', () => {
content: '';
margin-bottom: calc(
(
(
var(--ascent-scale) - var(--cap-height-scale) +
var(--line-gap-scale) / 2
) - var(--line-height-offset)
) * -1em
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) *
-1em
);
}
.capsize::after {
display: table;
content: '';
margin-top: calc(
(
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) * -1em
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
-1em
);
}
Expand All @@ -146,16 +141,14 @@ describe('Plugin', () => {
.sm\\:leading-md {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 40) / 2) / var(--font-size-px)
);
line-height: 2.5rem;
}
.sm\\:leading-sm {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
);
line-height: 20px;
}
Expand Down Expand Up @@ -202,16 +195,14 @@ describe('Plugin', () => {
.leading-md {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 30) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 30) / 2) / var(--font-size-px)
);
line-height: 2.5rem;
}
.leading-sm {
--line-height-offset: calc(
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) /
var(--font-size-px)
(((var(--line-height-scale) * var(--font-size-px)) - 20) / 2) / var(--font-size-px)
);
line-height: 20px;
}
Expand All @@ -221,23 +212,20 @@ describe('Plugin', () => {
content: '';
margin-bottom: calc(
(
(
var(--ascent-scale) - var(--cap-height-scale) +
var(--line-gap-scale) / 2
) - var(--line-height-offset)
) * -1em
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) *
-1em
);
}
.capsize::after {
display: table;
content: '';
margin-top: calc(
(
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) * -1em
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
-1em
);
}
`),
Expand Down Expand Up @@ -281,8 +269,10 @@ describe('Plugin', () => {
(var(--line-height-scale) * var(--font-size-px)) - calc(
1.5 * var(--font-size-px)
)
) / 2
) / var(--font-size-px)
) /
2
) /
var(--font-size-px)
);
line-height: 1.5;
}
Expand All @@ -294,8 +284,10 @@ describe('Plugin', () => {
(var(--line-height-scale) * var(--font-size-px)) - calc(
1 * var(--font-size-px)
)
) / 2
) / var(--font-size-px)
) /
2
) /
var(--font-size-px)
);
line-height: 100%;
}
Expand All @@ -305,23 +297,20 @@ describe('Plugin', () => {
content: '';
margin-bottom: calc(
(
(
var(--ascent-scale) - var(--cap-height-scale) +
var(--line-gap-scale) / 2
) - var(--line-height-offset)
) * -1em
(var(--ascent-scale) - var(--cap-height-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) *
-1em
);
}
.capsize::after {
display: table;
content: '';
margin-top: calc(
(
(var(--descent-scale) + var(--line-gap-scale) / 2) - var(
--line-height-offset
)
) * -1em
((var(--descent-scale) + var(--line-gap-scale) / 2) - var(--line-height-offset)) *
-1em
);
}
`),
Expand Down
3 changes: 2 additions & 1 deletion __tests__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import { diff } from 'jest-diff'
// eslint-disable-next-line import/default
import prettier from 'prettier'
import { expect } from 'vitest'

Expand Down Expand Up @@ -51,7 +52,7 @@ expect.extend({
return (
this.utils.matcherHint('toMatchCss', undefined, undefined, options) +
'\n\n' +
(diffString && diffString.includes('- Expect')
(diffString?.includes('- Expect')
? `Difference:\n\n${diffString}`
: `Expected: ${this.utils.printExpected(expected)}\n` +
`Received: ${this.utils.printReceived(actual)}`)
Expand Down
Loading

0 comments on commit 0ae2adf

Please sign in to comment.