@projectwallace/format-css 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,196 +1,218 @@
1
- import d from "css-tree/parser";
2
- const a = " ", c = "", $ = ":", x = ";", g = '"', I = "(", v = ")", ee = "[", te = "]", V = "{", W = "}", re = "{}", Z = ",", j = "Atrule", F = "Rule", G = "Block", Q = "SelectorList", Y = "Selector", w = "Declaration", B = "Operator";
3
- function C(y) {
4
- return /[A-Z]/.test(y) ? y.toLowerCase() : y;
5
- }
6
- function ne(y, {
7
- minify: O = !1,
8
- tab_size: S = void 0
9
- } = /* @__PURE__ */ Object.create(null)) {
10
- if (S !== void 0 && Number(S) < 1)
1
+ import { parse as X, NODE_TYPES as l, ATTR_FLAG_CASE_INSENSITIVE as z, ATTR_FLAG_CASE_SENSITIVE as tt, ATTR_OPERATOR_EQUAL as et, ATTR_OPERATOR_STAR_EQUAL as rt, ATTR_OPERATOR_DOLLAR_EQUAL as st, ATTR_OPERATOR_CARET_EQUAL as it, ATTR_OPERATOR_PIPE_EQUAL as lt, ATTR_OPERATOR_TILDE_EQUAL as nt } from "@projectwallace/css-parser";
2
+ const f = " ", c = "", k = ":", b = ";", $ = '"', P = "(", N = ")", ut = "[", ct = "]", w = "{", g = "}", D = ",";
3
+ function pt(R, { minify: O = !1, tab_size: L = void 0 } = /* @__PURE__ */ Object.create(null)) {
4
+ if (L !== void 0 && Number(L) < 1)
11
5
  throw new TypeError("tab_size must be a number greater than 0");
12
- let T = [], k = d(y, {
13
- positions: !0,
14
- parseAtrulePrelude: !1,
15
- parseCustomProperty: !0,
16
- parseValue: !0,
17
- onComment: (n, e) => {
18
- T.push(e.start.offset, e.end.offset);
6
+ const E = O ? c : `
7
+ `, p = O ? c : f, M = O ? c : b;
8
+ let A = [], d = X(R, {
9
+ on_comment: ({ start: t, end: e }) => {
10
+ A.push(t, e);
19
11
  }
20
- });
21
- const u = O ? c : `
22
- `, p = O ? c : a, h = O ? c : x;
23
- let s = 0;
24
- function i(n) {
25
- return O === !0 ? c : S !== void 0 ? a.repeat(S * n) : " ".repeat(n);
26
- }
27
- function P(n) {
28
- let e = n.loc;
29
- return e == null ? c : y.slice(e.start.offset, e.end.offset);
12
+ }), a = 0;
13
+ function o(t) {
14
+ return O === !0 ? c : L !== void 0 ? f.repeat(L * t) : " ".repeat(t);
30
15
  }
31
- function b(n) {
32
- return /** @type {import('css-tree').CssLocation} */ n.loc.start.offset;
16
+ function _(t, e, r = a) {
17
+ if (O || t === void 0 || e === void 0)
18
+ return c;
19
+ let s = c;
20
+ for (let i = 0; i < A.length; i += 2) {
21
+ let n = A[i];
22
+ if (n === void 0 || n < t) continue;
23
+ let u = A[i + 1];
24
+ if (u === void 0 || u > e) break;
25
+ s.length > 0 && (s += E + o(r)), s += R.slice(n, u);
26
+ }
27
+ return s;
28
+ }
29
+ function Q(t) {
30
+ return t.replace(/(?:^['"])|(?:['"]$)/g, c);
31
+ }
32
+ function m(t) {
33
+ return t = (t == null ? void 0 : t.toString()) || "", $ + Q(t) + $;
34
+ }
35
+ function B(t) {
36
+ let e = [], r = t.text, s = r.charCodeAt(0);
37
+ return s === 43 || s === 45 ? e.push(f) : s !== 44 && e.push(p), e.push(r), s === 43 || s === 45 ? e.push(f) : e.push(p), e.join(c);
38
+ }
39
+ function S(t) {
40
+ var r, s;
41
+ let e = [];
42
+ for (let i of t) {
43
+ if (i.type === l.FUNCTION) {
44
+ let n = i.name.toLowerCase();
45
+ e.push(n, P), e.push(S(i.children)), e.push(N);
46
+ } else i.type === l.DIMENSION ? e.push(i.value, (r = i.unit) == null ? void 0 : r.toLowerCase()) : i.type === l.STRING ? e.push(m(i.text)) : i.type === l.OPERATOR ? e.push(B(i)) : i.type === l.PARENTHESIS ? e.push(P, S(i.children), N) : i.type === l.URL && typeof i.value == "string" ? (e.push("url("), e.push(m(i.value)), e.push(N)) : e.push(i.text);
47
+ i.type !== l.OPERATOR && i.has_next && ((s = i.next_sibling) == null ? void 0 : s.type) !== l.OPERATOR && e.push(f);
48
+ }
49
+ return e.join(c);
33
50
  }
34
- function E(n) {
35
- return /** @type {import('css-tree').CssLocation} */ n.loc.end.offset;
51
+ function H(t) {
52
+ return t === null ? c : S(t);
36
53
  }
37
- function m(n, e) {
38
- if (O === !0 || n === void 0 || e === void 0)
39
- return c;
40
- let t = "";
41
- for (let r = 0; r < T.length; r += 2) {
42
- let l = T[r];
43
- if (l === void 0 || l < n) continue;
44
- let f = T[r + 1];
45
- if (f === void 0 || f > e) break;
46
- t.length > 0 && (t += u + i(s)), t += y.slice(l, f);
54
+ function F(t) {
55
+ let e = [];
56
+ if (t.is_important) {
57
+ let i = t.text, n = i.endsWith(b), u = i.lastIndexOf("!"), T = n ? -1 : void 0;
58
+ e.push(p, i.slice(u, T).toLowerCase());
59
+ }
60
+ let r = H(t.value), s = t.property;
61
+ return s === "font" && (r = r.replace(/\s*\/\s*/, "/")), r === c && O === !0 && (r += f), s.startsWith("--") || (s = s.toLowerCase()), s + k + p + r + e.join(c);
62
+ }
63
+ function G(t) {
64
+ switch (t) {
65
+ case nt:
66
+ return "~=";
67
+ case lt:
68
+ return "|=";
69
+ case it:
70
+ return "^=";
71
+ case st:
72
+ return "$=";
73
+ case rt:
74
+ return "*=";
75
+ case et:
76
+ default:
77
+ return "=";
47
78
  }
48
- return t;
49
- }
50
- function M(n) {
51
- let e, t = n.prelude, r = n.block;
52
- t.type === Q && (e = q(t));
53
- let l = m(E(t), b(r));
54
- return l && (e += u + i(s) + l), r.type === G && (e += K(r)), e;
55
- }
56
- function q(n) {
57
- let e = c;
58
- return n.children.forEach((t, r) => {
59
- t.type === Y && (e += i(s) + A(t)), r.next !== null && (e += Z + u);
60
- let l = r.next !== null ? b(r.next.data) : E(n), f = m(E(t), l);
61
- f && (e += i(s) + f + u);
62
- }), e;
63
- }
64
- function A(n) {
65
- let e = c;
66
- return (n.children || []).forEach((r) => {
67
- switch (r.type) {
68
- case "TypeSelector": {
69
- e += C(r.name);
70
- break;
71
- }
72
- case "Combinator": {
73
- e += a, r.name !== " " && (e += r.name + a);
74
- break;
75
- }
76
- case "PseudoClassSelector":
77
- case "PseudoElementSelector": {
78
- e += $;
79
- let l = C(r.name);
80
- (l === "before" || l === "after" || r.type === "PseudoElementSelector") && (e += $), e += l, r.children !== null && (e += I + A(r) + v);
81
- break;
82
- }
83
- case Q: {
84
- r.children.forEach((l, f) => {
85
- l.type === Y && (e += A(l)), f.next !== null && f.next.data.type === Y && (e += Z + p);
86
- });
87
- break;
88
- }
89
- case "Nth": {
90
- let l = r.nth;
91
- if (l.type === "AnPlusB") {
92
- let f = l.a, o = l.b;
93
- f !== null && (e += f + "n"), f !== null && o !== null && (e += a), o !== null && (f !== null && !o.startsWith("-") && (e += "+" + a), e += o);
94
- } else
95
- e += P(l);
96
- r.selector !== null && (e += a + "of" + a + A(r.selector));
97
- break;
98
- }
99
- case "AttributeSelector": {
100
- e += ee, e += r.name.name, r.matcher !== null && r.value !== null && (e += r.matcher, e += g, r.value.type === "String" ? e += r.value.value : r.value.type === "Identifier" && (e += r.value.name), e += g), r.flags !== null && (e += a + r.flags), e += te;
101
- break;
102
- }
103
- case "NestingSelector": {
104
- e += "&";
105
- break;
106
- }
107
- default: {
108
- e += P(r);
109
- break;
110
- }
79
+ }
80
+ function I(t) {
81
+ let e = [], r = t.nth_a, s = t.nth_b;
82
+ return r && e.push(r), r && s && e.push(p), s && (r && !s.startsWith("-") && e.push("+", p), e.push(parseFloat(s))), e.join(c);
83
+ }
84
+ function Y(t) {
85
+ var r, s;
86
+ let e = [];
87
+ return ((r = t.children[0]) == null ? void 0 : r.type) === l.NTH_SELECTOR && (e.push(I(t.children[0])), e.push(f, "of", f)), ((s = t.children[1]) == null ? void 0 : s.type) === l.SELECTOR_LIST && e.push(y(t.children[1])), e.join(c);
88
+ }
89
+ function W(t, e = !1) {
90
+ switch (t.type) {
91
+ case l.TYPE_SELECTOR:
92
+ return t.name.toLowerCase();
93
+ case l.COMBINATOR: {
94
+ let r = t.text;
95
+ return /^\s+$/.test(r) ? f : (e ? c : p) + r + p;
96
+ }
97
+ case l.PSEUDO_ELEMENT_SELECTOR:
98
+ case l.PSEUDO_CLASS_SELECTOR: {
99
+ let r = [k], s = t.name.toLowerCase();
100
+ return (s === "before" || s === "after" || t.type === l.PSEUDO_ELEMENT_SELECTOR) && r.push(k), r.push(s), t.has_children && (r.push(P), t.children.length > 0 && (s === "highlight" ? r.push(S(t.children)) : r.push(y(t))), r.push(N)), r.join(c);
111
101
  }
112
- }), e;
102
+ case l.ATTRIBUTE_SELECTOR: {
103
+ let r = [ut, t.name.toLowerCase()];
104
+ return t.attr_operator && (r.push(G(t.attr_operator)), typeof t.value == "string" && r.push(m(t.value)), t.attr_flags === z ? r.push(f, "i") : t.attr_flags === tt && r.push(f, "s")), r.push(ct), r.join(c);
105
+ }
106
+ default:
107
+ return t.text;
108
+ }
113
109
  }
114
- function K(n) {
115
- let e = n.children, t = p;
116
- if (e.isEmpty) {
117
- let f = m(b(n), E(n));
118
- return f ? (t += V + u, t += i(s + 1) + f, t += u + i(s) + W, t) : t + re;
110
+ function v(t) {
111
+ if (t.type === l.NTH_SELECTOR)
112
+ return I(t);
113
+ if (t.type === l.NTH_OF_SELECTOR)
114
+ return Y(t);
115
+ if (t.type === l.SELECTOR_LIST)
116
+ return y(t);
117
+ if (t.type === l.LANG_SELECTOR)
118
+ return m(t.text);
119
+ let e = [];
120
+ return t.children.forEach((r, s) => {
121
+ const i = W(r, s === 0);
122
+ e.push(i);
123
+ }), e.join(c);
124
+ }
125
+ function y(t) {
126
+ let e = [];
127
+ for (let r of t)
128
+ e.push(v(r)), r.has_next && e.push(D, p);
129
+ return e.join(c);
130
+ }
131
+ function K(t) {
132
+ let e = [], r;
133
+ for (let s of t) {
134
+ if (r !== void 0) {
135
+ let n = _(r, s.start);
136
+ n && e.push(o(a) + n);
137
+ }
138
+ let i = v(s);
139
+ s.has_next && (i += D), e.push(o(a) + i), r = s.end;
119
140
  }
120
- t += V + u, s++;
121
- let r = m(b(n), b(
122
- /** @type {import('css-tree').CssNode} */
123
- e.first
124
- ));
125
- r && (t += i(s) + r + u), e.forEach((f, o) => {
126
- if (o.prev !== null) {
127
- let H = m(E(o.prev.data), b(f));
128
- H && (t += i(s) + H + u);
141
+ return e.join(E);
142
+ }
143
+ function x(t) {
144
+ var T;
145
+ let e = [];
146
+ a++;
147
+ let r = t.children;
148
+ if (r.length === 0) {
149
+ let h = _(t.start, t.end);
150
+ if (h)
151
+ return e.push(o(a) + h), a--, e.push(o(a) + g), e.join(E);
152
+ }
153
+ let s = r[0], i = _(t.start, s == null ? void 0 : s.start);
154
+ i && e.push(o(a) + i);
155
+ let n;
156
+ for (let h of r) {
157
+ if (n !== void 0) {
158
+ let C = _(n, h.start);
159
+ C && e.push(o(a) + C);
129
160
  }
130
- f.type === w ? (t += X(f), o.next === null ? t += h : t += x) : (o.prev !== null && o.prev.data.type === w && (t += u), f.type === F ? t += M(f) : f.type === j ? t += U(f) : t += R(f, s)), o.next !== null && (t += u, f.type !== w && (t += u));
131
- });
132
- let l = m(E(
133
- /** @type {import('css-tree').CssNode} */
134
- e.last
135
- ), E(n));
136
- return l && (t += u + i(s) + l), s--, t += u + i(s) + W, t;
137
- }
138
- function U(n) {
139
- let e = i(s) + "@", t = n.prelude, r = n.block;
140
- return e += C(n.name), t !== null && (e += a + J(t)), r === null ? e += x : r.type === G && (e += K(r)), e;
141
- }
142
- function J(n) {
143
- let e = P(n);
144
- return e.replace(/\s*([:,])/g, e.toLowerCase().includes("selector(") ? "$1" : "$1 ").replace(/\)([a-zA-Z])/g, ") $1").replace(/\s*(=>|<=)\s*/g, " $1 ").replace(/([^<>=\s])([<>])([^<>=\s])/g, `$1${p}$2${p}$3`).replace(/\s+/g, p).replace(/calc\(\s*([^()+\-*/]+)\s*([*/+-])\s*([^()+\-*/]+)\s*\)/g, (t, r, l, f) => {
145
- let o = l === "+" || l === "-" ? a : p;
146
- return `calc(${r.trim()}${o}${l}${o}${f.trim()})`;
147
- }).replace(/selector|url|supports|layer\(/ig, (t) => C(t));
148
- }
149
- function X(n) {
150
- let e = n.property;
151
- e.charCodeAt(0) === 45 && e.charCodeAt(1) === 45 || (e = C(e));
152
- let t = D(n.value);
153
- return e === "font" && (t = t.replace(/\s*\/\s*/, "/")), t === c && O === !0 && (t += a), n.important === !0 ? t += p + "!important" : typeof n.important == "string" && (t += p + "!" + C(n.important)), i(s) + e + $ + p + t;
154
- }
155
- function N(n) {
156
- let e = c;
157
- return n.forEach((t, r) => {
158
- t.type === "Identifier" ? e += t.name : t.type === "Function" ? e += C(t.name) + I + N(t.children) + v : t.type === "Dimension" ? e += t.value + C(t.unit) : t.type === "Value" ? e += D(t) : t.type === B ? e += z(t) : t.type === "Parentheses" ? e += I + N(t.children) + v : t.type === "Url" ? e += "url(" + g + t.value + g + v : e += P(t), t.type !== B && r.next !== null && r.next.data.type !== B && (e += a);
159
- }), e;
160
- }
161
- function z(n) {
162
- let e = c, t = n.value.trim(), r = t.charCodeAt(0);
163
- return r === 43 || r === 45 ? e += a : r !== 44 && (e += p), e += t, r === 43 || r === 45 ? e += a : e += p, e;
164
- }
165
- function D(n) {
166
- return n.type === "Raw" ? R(n, 0) : N(n.children);
167
- }
168
- function R(n, e) {
169
- return i(e) + P(n).trim();
170
- }
171
- let L = k.children, _ = c;
172
- if (L.first !== null) {
173
- let n = m(0, b(L.first));
174
- n && (_ += n + u), L.forEach((t, r) => {
175
- if (t.type === F ? _ += M(t) : t.type === j ? _ += U(t) : _ += R(t, s), r.next !== null) {
176
- _ += u;
177
- let l = m(E(t), b(r.next.data));
178
- l && (_ += i(s) + l), _ += u;
161
+ let Z = ((T = h.next_sibling) == null ? void 0 : T.type) !== l.DECLARATION;
162
+ if (h.type === l.DECLARATION) {
163
+ let C = F(h), J = Z ? M : b;
164
+ e.push(o(a) + C + J);
165
+ } else h.type === l.STYLE_RULE ? (n !== void 0 && e.length !== 0 && e.push(c), e.push(j(h))) : h.type === l.AT_RULE && (n !== void 0 && e.length !== 0 && e.push(c), e.push(o(a) + U(h)));
166
+ n = h.end;
167
+ }
168
+ let u = _(n, t.end);
169
+ return u && e.push(o(a) + u), a--, e.push(o(a) + g), e.join(E);
170
+ }
171
+ function j(t) {
172
+ var r, s;
173
+ let e = [];
174
+ if (((r = t.first_child) == null ? void 0 : r.type) === l.SELECTOR_LIST) {
175
+ let i = K(t.first_child), n = _(t.first_child.end, (s = t.block) == null ? void 0 : s.start);
176
+ n && (i += E + o(a) + n), i += p + w, t.block && (t.block.has_children || _(t.block.start, t.block.end)) || (i += g), e.push(i);
177
+ }
178
+ return t.block && (t.block.has_children || _(t.block.start, t.block.end)) && e.push(x(t.block)), e.join(E);
179
+ }
180
+ function V(t) {
181
+ return t.replace(/\s*([:,])/g, t.toLowerCase().includes("selector(") ? "$1" : "$1 ").replace(/\)([a-zA-Z])/g, ") $1").replace(/\s*(=>|<=)\s*/g, " $1 ").replace(/([^<>=\s])([<>])([^<>=\s])/g, `$1${p}$2${p}$3`).replace(/\s+/g, p).replace(/calc\(\s*([^()+\-*/]+)\s*([*/+-])\s*([^()+\-*/]+)\s*\)/g, (e, r, s, i) => {
182
+ let n = s === "+" || s === "-" ? f : p;
183
+ return `calc(${r.trim()}${n}${s}${n}${i.trim()})`;
184
+ }).replace(/selector|url|supports|layer\(/gi, (e) => e.toLowerCase());
185
+ }
186
+ function U(t) {
187
+ let e = [], r = ["@", t.name.toLowerCase()];
188
+ return t.prelude && r.push(f, V(t.prelude.text)), t.block === null ? r.push(b) : (r.push(p, w), !t.block.is_empty || _(t.block.start, t.block.end) || r.push(g)), e.push(r.join(c)), t.block !== null && (!t.block.is_empty || _(t.block.start, t.block.end)) && e.push(x(t.block)), e.join(E);
189
+ }
190
+ function q(t) {
191
+ let e = [], r = t.children;
192
+ if (r.length === 0)
193
+ return _(0, t.end, 0);
194
+ let s = r[0];
195
+ if (s) {
196
+ let u = _(0, s.start, 0);
197
+ u && e.push(u);
198
+ }
199
+ let i;
200
+ for (let u of t) {
201
+ if (i !== void 0) {
202
+ let T = _(i, u.start, 0);
203
+ T && e.push(T);
179
204
  }
180
- });
181
- let e = m(E(
182
- /** @type {import('css-tree').CssNode} */
183
- L.last
184
- ), E(k));
185
- e && (_ += u + e);
186
- } else
187
- _ += m(0, E(k));
188
- return _;
205
+ u.type === l.STYLE_RULE ? e.push(j(u)) : u.type === l.AT_RULE && e.push(U(u)), i = u.end, u.has_next && (u.next_sibling && _(u.end, u.next_sibling.start, 0) || e.push(c));
206
+ }
207
+ let n = _(i, t.end, 0);
208
+ return n && e.push(n), e.join(E);
209
+ }
210
+ return q(d).trimEnd();
189
211
  }
190
- function fe(y) {
191
- return ne(y, { minify: !0 });
212
+ function _t(R) {
213
+ return pt(R, { minify: !0 });
192
214
  }
193
215
  export {
194
- ne as format,
195
- fe as minify
216
+ pt as format,
217
+ _t as minify
196
218
  };
package/dist/index.d.ts CHANGED
@@ -1,29 +1,16 @@
1
+ export type FormatOptions = {
2
+ /** Whether to minify the CSS or keep it formatted */
3
+ minify?: boolean;
4
+ /** Tell the formatter to use N spaces instead of tabs */
5
+ tab_size?: number;
6
+ };
1
7
  /**
2
- * @typedef {Object} Options
3
- * @property {boolean} [minify] Whether to minify the CSS or keep it formatted
4
- * @property {number} [tab_size] Tell the formatter to use N spaces instead of tabs
5
- *
6
8
  * Format a string of CSS using some simple rules
7
- * @param {string} css The original CSS
8
- * @param {Options} [options]
9
- * @returns {string} The formatted CSS
10
9
  */
11
- export function format(css: string, { minify, tab_size, }?: Options): string;
10
+ export declare function format(css: string, { minify, tab_size }?: FormatOptions): string;
12
11
  /**
13
12
  * Minify a string of CSS
14
13
  * @param {string} css The original CSS
15
14
  * @returns {string} The minified CSS
16
15
  */
17
- export function minify(css: string): string;
18
- export type Options = {
19
- /**
20
- * Whether to minify the CSS or keep it formatted
21
- */
22
- minify?: boolean | undefined;
23
- /**
24
- * Tell the formatter to use N spaces instead of tabs
25
- *
26
- * Format a string of CSS using some simple rules
27
- */
28
- tab_size?: number | undefined;
29
- };
16
+ export declare function minify(css: string): string;
package/package.json CHANGED
@@ -1,60 +1,65 @@
1
1
  {
2
- "name": "@projectwallace/format-css",
3
- "version": "2.1.1",
4
- "description": "Fast, small, zero-config library to format or minify CSS with basic rules.",
5
- "repository": {
6
- "type": "git",
7
- "url": "git+https://github.com/projectwallace/format-css.git"
8
- },
9
- "homepage": "https://github.com/projectwallace/format-css",
10
- "issues": "https://github.com/projectwallace/format-css/issues",
11
- "license": "MIT",
12
- "engines": {
13
- "node": ">=18.0.0"
14
- },
15
- "type": "module",
16
- "main": "./dist/format-css.js",
17
- "exports": {
18
- "types": "./dist/index.d.ts",
19
- "default": "./dist/format-css.js"
20
- },
21
- "types": "./dist/index.d.ts",
22
- "scripts": {
23
- "build": "vite build",
24
- "test": "c8 --reporter=lcov uvu",
25
- "check": "tsc",
26
- "prettier": "prettier --check index.js test/**/*.js"
27
- },
28
- "devDependencies": {
29
- "@codecov/vite-plugin": "^1.9.0",
30
- "@types/css-tree": "^2.3.10",
31
- "c8": "^10.1.3",
32
- "prettier": "^3.5.3",
33
- "typescript": "^5.8.3",
34
- "uvu": "^0.5.6",
35
- "vite": "^6.2.6",
36
- "vite-plugin-dts": "^4.5.3"
37
- },
38
- "dependencies": {
39
- "css-tree": "^3.0.1"
40
- },
41
- "files": [
42
- "dist"
43
- ],
44
- "keywords": [
45
- "css",
46
- "stylesheet",
47
- "formatter",
48
- "format",
49
- "print",
50
- "prettifier",
51
- "pretty",
52
- "prettier"
53
- ],
54
- "prettier": {
55
- "semi": false,
56
- "useTabs": true,
57
- "printWidth": 140,
58
- "singleQuote": true
59
- }
60
- }
2
+ "name": "@projectwallace/format-css",
3
+ "version": "2.2.0",
4
+ "description": "Fast, small, zero-config library to format or minify CSS with basic rules.",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/projectwallace/format-css.git"
8
+ },
9
+ "homepage": "https://github.com/projectwallace/format-css",
10
+ "issues": "https://github.com/projectwallace/format-css/issues",
11
+ "license": "MIT",
12
+ "author": "Bart Veneman <bart@projectwallace.com>",
13
+ "engines": {
14
+ "node": ">=18.0.0"
15
+ },
16
+ "type": "module",
17
+ "main": "./dist/format-css.js",
18
+ "exports": {
19
+ "types": "./dist/index.d.ts",
20
+ "default": "./dist/format-css.js"
21
+ },
22
+ "types": "./dist/index.d.ts",
23
+ "scripts": {
24
+ "build": "vite build",
25
+ "test": "vitest --coverage",
26
+ "check": "tsc",
27
+ "prettier": "prettier --check index.ts test/**/*.ts",
28
+ "lint": "oxlint",
29
+ "lint-package": "publint"
30
+ },
31
+ "devDependencies": {
32
+ "@codecov/vite-plugin": "^1.9.1",
33
+ "@vitest/coverage-v8": "^4.0.3",
34
+ "c8": "^10.1.3",
35
+ "oxlint": "^1.24.0",
36
+ "prettier": "^3.6.2",
37
+ "publint": "^0.3.15",
38
+ "typescript": "^5.9.3",
39
+ "vite": "^6.2.6",
40
+ "vite-plugin-dts": "^4.5.4",
41
+ "vitest": "^4.0.3"
42
+ },
43
+ "files": [
44
+ "dist"
45
+ ],
46
+ "keywords": [
47
+ "css",
48
+ "stylesheet",
49
+ "formatter",
50
+ "format",
51
+ "print",
52
+ "prettifier",
53
+ "pretty",
54
+ "prettier"
55
+ ],
56
+ "prettier": {
57
+ "semi": false,
58
+ "useTabs": true,
59
+ "printWidth": 140,
60
+ "singleQuote": true
61
+ },
62
+ "dependencies": {
63
+ "@projectwallace/css-parser": "^0.12.2"
64
+ }
65
+ }