@via-ds/stylelint-plugin 0.0.1-canary.0 → 0.0.2
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.
- package/README.md +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +127 -1
- package/dist/index.js.map +7 -0
- package/dist/recommended.d.ts +1 -1
- package/dist/recommended.js +13 -1
- package/dist/recommended.js.map +7 -0
- package/dist/rules/index.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/utils/create-rule.d.ts +4 -4
- package/dist/utils/create-rule.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +4 -9
package/README.md
CHANGED
|
@@ -39,8 +39,8 @@ export default {
|
|
|
39
39
|
|
|
40
40
|
## Rules
|
|
41
41
|
|
|
42
|
-
| Rule | Description
|
|
43
|
-
| ------------------ |
|
|
42
|
+
| Rule | Description |
|
|
43
|
+
| ------------------ | ------------------------------------------------------- |
|
|
44
44
|
| `via/example-rule` | Example rule that reports selectors containing "foobar" |
|
|
45
45
|
|
|
46
46
|
---
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1,127 @@
|
|
|
1
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import stylelint2 from "stylelint";
|
|
3
|
+
|
|
4
|
+
// src/utils/create-rule.ts
|
|
5
|
+
import stylelint from "stylelint";
|
|
6
|
+
|
|
7
|
+
// src/plugin-namespace.ts
|
|
8
|
+
var PLUGIN_NAMESPACE = "via";
|
|
9
|
+
|
|
10
|
+
// src/utils/create-rule.ts
|
|
11
|
+
var {
|
|
12
|
+
utils: { report, ruleMessages, validateOptions }
|
|
13
|
+
} = stylelint;
|
|
14
|
+
function createRule(definition) {
|
|
15
|
+
const {
|
|
16
|
+
meta,
|
|
17
|
+
ruleName,
|
|
18
|
+
walkAtRules,
|
|
19
|
+
walkComments,
|
|
20
|
+
walkDecls,
|
|
21
|
+
walkRoot,
|
|
22
|
+
walkRules
|
|
23
|
+
} = definition;
|
|
24
|
+
const qualifiedRuleName = `${PLUGIN_NAMESPACE}/${ruleName}`;
|
|
25
|
+
const messages = ruleMessages(qualifiedRuleName, definition.messages);
|
|
26
|
+
const ruleFunction = (primary, _secondary, context) => {
|
|
27
|
+
return (root, result) => {
|
|
28
|
+
const validOptions = validateOptions(result, qualifiedRuleName, {
|
|
29
|
+
actual: primary,
|
|
30
|
+
possible: [true]
|
|
31
|
+
});
|
|
32
|
+
if (!validOptions) return;
|
|
33
|
+
const walkContext = {
|
|
34
|
+
messages,
|
|
35
|
+
fix: context?.fix ?? false,
|
|
36
|
+
report: (problem) => {
|
|
37
|
+
report({
|
|
38
|
+
...problem,
|
|
39
|
+
result,
|
|
40
|
+
ruleName: qualifiedRuleName
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
if (walkRoot) {
|
|
45
|
+
walkRoot(root, walkContext);
|
|
46
|
+
}
|
|
47
|
+
if (walkRules) {
|
|
48
|
+
root.walkRules((node) => walkRules(node, walkContext));
|
|
49
|
+
}
|
|
50
|
+
if (walkDecls) {
|
|
51
|
+
root.walkDecls((node) => walkDecls(node, walkContext));
|
|
52
|
+
}
|
|
53
|
+
if (walkAtRules) {
|
|
54
|
+
root.walkAtRules((node) => walkAtRules(node, walkContext));
|
|
55
|
+
}
|
|
56
|
+
if (walkComments) {
|
|
57
|
+
root.walkComments((node) => walkComments(node, walkContext));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
ruleFunction.ruleName = ruleName;
|
|
62
|
+
ruleFunction.messages = messages;
|
|
63
|
+
if (meta) {
|
|
64
|
+
ruleFunction.meta = meta;
|
|
65
|
+
}
|
|
66
|
+
return ruleFunction;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/rules/example-rule.ts
|
|
70
|
+
var example_rule_default = createRule({
|
|
71
|
+
ruleName: "example-rule",
|
|
72
|
+
messages: {
|
|
73
|
+
rejected: (selector) => `Example rule violation in selector "${selector}"`
|
|
74
|
+
},
|
|
75
|
+
meta: {
|
|
76
|
+
url: "https://github.com/10gen/lg/blob/main/packages/tools/stylelint-plugin/README.md"
|
|
77
|
+
},
|
|
78
|
+
walkRules(ruleNode, { messages, report: report2 }) {
|
|
79
|
+
const { selector } = ruleNode;
|
|
80
|
+
if (selector.includes("foobar")) {
|
|
81
|
+
report2({
|
|
82
|
+
message: messages.rejected(selector),
|
|
83
|
+
node: ruleNode,
|
|
84
|
+
word: selector
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// src/rules/no-attr-function.ts
|
|
91
|
+
var attrFunctionPattern = /\battr\s*\(/i;
|
|
92
|
+
var no_attr_function_default = createRule({
|
|
93
|
+
ruleName: "no-attr-function",
|
|
94
|
+
messages: {
|
|
95
|
+
rejected: (property) => `Unexpected "attr()" in "${property}". The attr() function has limited browser support outside of the "content" property (https://caniuse.com/?search=attr()).`
|
|
96
|
+
},
|
|
97
|
+
meta: {
|
|
98
|
+
url: "https://github.com/10gen/lg/blob/main/packages/tools/stylelint-plugin/README.md"
|
|
99
|
+
},
|
|
100
|
+
walkDecls(decl, { messages, report: report2 }) {
|
|
101
|
+
if (decl.prop === "content") return;
|
|
102
|
+
if (attrFunctionPattern.test(decl.value)) {
|
|
103
|
+
report2({
|
|
104
|
+
message: messages.rejected(decl.prop),
|
|
105
|
+
node: decl,
|
|
106
|
+
word: "attr("
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// src/rules/index.ts
|
|
113
|
+
var rules = {
|
|
114
|
+
[example_rule_default.ruleName]: example_rule_default,
|
|
115
|
+
[no_attr_function_default.ruleName]: no_attr_function_default
|
|
116
|
+
};
|
|
117
|
+
var rules_default = rules;
|
|
118
|
+
|
|
119
|
+
// src/index.ts
|
|
120
|
+
var rulesPlugins = Object.entries(rules_default).map(([ruleName, rule]) => {
|
|
121
|
+
return stylelint2.createPlugin(`${PLUGIN_NAMESPACE}/${ruleName}`, rule);
|
|
122
|
+
});
|
|
123
|
+
var index_default = rulesPlugins;
|
|
124
|
+
export {
|
|
125
|
+
index_default as default
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/index.ts", "../src/utils/create-rule.ts", "../src/plugin-namespace.ts", "../src/rules/example-rule.ts", "../src/rules/no-attr-function.ts", "../src/rules/index.ts"],
|
|
4
|
+
"sourcesContent": ["import stylelint from 'stylelint';\n\nimport rules from './rules/index';\nimport { PLUGIN_NAMESPACE } from './plugin-namespace';\n\nconst rulesPlugins = Object.entries(rules).map(([ruleName, rule]) => {\n return stylelint.createPlugin(`${PLUGIN_NAMESPACE}/${ruleName}`, rule);\n});\n\nexport default rulesPlugins;\n", "import type {\n AtRule,\n Comment,\n Declaration,\n Root,\n Rule as CssRule,\n} from 'postcss';\nimport type {\n PostcssResult,\n Problem,\n ProblemLocation,\n Rule,\n RuleMessages,\n RuleMeta,\n} from 'stylelint';\nimport stylelint from 'stylelint';\n\nimport { PLUGIN_NAMESPACE } from '../plugin-namespace';\n\nconst {\n utils: { report, ruleMessages, validateOptions },\n} = stylelint;\n\n/**\n * Problem report type for the `report` function.\n * Excludes `result` and `ruleName` which are automatically\n * provided by the createRule wrapper.\n */\nexport type ReportProblem = Omit<\n Problem,\n 'result' | 'ruleName' | keyof ProblemLocation\n> &\n ProblemLocation;\n\n/**\n * Context passed to walk callbacks.\n */\nexport interface WalkContext<M extends RuleMessages = RuleMessages> {\n /** Rule messages with ruleName suffix applied */\n messages: M;\n\n /** Whether autofix is enabled */\n fix: boolean;\n\n /**\n * Report a problem. `result` and the namespaced rule id (`via/...`) are automatically provided.\n */\n report: (problem: ReportProblem) => void;\n}\n\n/**\n * Generic walk callback type for PostCSS nodes.\n */\nexport type WalkCallback<N, M extends RuleMessages> = (\n node: N,\n context: WalkContext<M>,\n) => void;\n\n/**\n * Rule definition with simplified walk callbacks.\n * Just provide the walk callback(s) you need - no boilerplate required.\n */\nexport interface RuleDefinition<M extends RuleMessages = RuleMessages> {\n /** The rule name (without namespace prefix) */\n ruleName: string;\n\n /** Rule messages object */\n messages: M;\n\n /** Optional rule metadata */\n meta?: RuleMeta;\n\n /** Walk CSS rules (selectors) */\n walkRules?: WalkCallback<CssRule, M>;\n\n /** Walk declarations (property: value pairs) */\n walkDecls?: WalkCallback<Declaration, M>;\n\n /** Walk at-rules (@media, @import, etc.) */\n walkAtRules?: WalkCallback<AtRule, M>;\n\n /** Walk comments */\n walkComments?: WalkCallback<Comment, M>;\n\n /** Process the root node directly (for custom traversal) */\n walkRoot?: WalkCallback<Root, M>;\n}\n\n/**\n * Factory function to create a stylelint rule with minimal boilerplate.\n *\n * @example\n * ```ts\n * import { createRule } from \"../utils/create-rule.js\";\n *\n * export default createRule({\n * ruleName: \"no-foobar-selector\",\n * messages: {\n * rejected: (selector) => `Unexpected \"foobar\" in selector \"${selector}\"`,\n * },\n * meta: {\n * url: \"https://example.com/rules/no-foobar-selector\",\n * },\n * walkRules(ruleNode, { report, messages }) {\n * if (ruleNode.selector.includes(\"foobar\")) {\n * report({\n * message: messages.rejected(ruleNode.selector),\n * node: ruleNode,\n * word: ruleNode.selector,\n * });\n * }\n * },\n * });\n * ```\n */\nexport function createRule<M extends RuleMessages = RuleMessages>(\n definition: RuleDefinition<M>,\n): Rule<true, unknown, M> {\n const {\n meta,\n ruleName,\n walkAtRules,\n walkComments,\n walkDecls,\n walkRoot,\n walkRules,\n } = definition;\n const qualifiedRuleName = `${PLUGIN_NAMESPACE}/${ruleName}`;\n const messages = ruleMessages(qualifiedRuleName, definition.messages) as M;\n\n const ruleFunction: Rule<true, unknown, M> = (\n primary,\n _secondary,\n context,\n ) => {\n return (root: Root, result: PostcssResult) => {\n // Validate that the rule is enabled (primary option is `true`)\n const validOptions = validateOptions(result, qualifiedRuleName, {\n actual: primary,\n possible: [true],\n });\n\n if (!validOptions) return;\n\n // Create the context object for walk callbacks\n const walkContext: WalkContext<M> = {\n messages,\n fix: context?.fix ?? false,\n report: problem => {\n report({\n ...problem,\n result,\n ruleName: qualifiedRuleName,\n });\n },\n };\n\n // Execute the appropriate walk callbacks\n if (walkRoot) {\n walkRoot(root, walkContext);\n }\n\n if (walkRules) {\n root.walkRules(node => walkRules(node, walkContext));\n }\n\n if (walkDecls) {\n root.walkDecls(node => walkDecls(node, walkContext));\n }\n\n if (walkAtRules) {\n root.walkAtRules(node => walkAtRules(node, walkContext));\n }\n\n if (walkComments) {\n root.walkComments(node => walkComments(node, walkContext));\n }\n };\n };\n\n ruleFunction.ruleName = ruleName;\n ruleFunction.messages = messages;\n if (meta) {\n ruleFunction.meta = meta;\n }\n\n return ruleFunction;\n}\n\nexport { report, ruleMessages, validateOptions };\n", "/** Namespace prefix for rule IDs in config and warning output (e.g. `via/example-rule`). */\nexport const PLUGIN_NAMESPACE = 'via';\n", "import { createRule } from '../utils/index.js';\n\n/**\n * Example rule that reports any selector containing \"foobar\".\n *\n * This demonstrates the simplified createRule API where you\n * just provide walk callbacks - no boilerplate required.\n */\nexport default createRule({\n ruleName: 'example-rule',\n\n messages: {\n rejected: (selector: string) =>\n `Example rule violation in selector \"${selector}\"`,\n },\n\n meta: {\n url: 'https://github.com/10gen/lg/blob/main/packages/tools/stylelint-plugin/README.md',\n },\n\n walkRules(ruleNode, { messages, report }) {\n const { selector } = ruleNode;\n\n if (selector.includes('foobar')) {\n report({\n message: messages.rejected(selector),\n node: ruleNode,\n word: selector,\n });\n }\n },\n});\n", "import { createRule } from '../utils/index.js';\n\nconst attrFunctionPattern = /\\battr\\s*\\(/i;\n\n/**\n * Disallows `attr()` in CSS declaration values due to limited browser support.\n *\n * While `attr()` works in the `content` property across all browsers,\n * its use on other CSS properties (CSS Values Level 5) lacks broad support.\n * This rule flags all usage to ensure cross-browser compatibility.\n *\n * @see https://caniuse.com/?search=attr()\n */\nexport default createRule({\n ruleName: 'no-attr-function',\n\n messages: {\n rejected: (property: string) =>\n `Unexpected \"attr()\" in \"${property}\". The attr() function has limited browser support outside of the \"content\" property (https://caniuse.com/?search=attr()).`,\n },\n\n meta: {\n url: 'https://github.com/10gen/lg/blob/main/packages/tools/stylelint-plugin/README.md',\n },\n\n walkDecls(decl, { messages, report }) {\n if (decl.prop === 'content') return;\n\n if (attrFunctionPattern.test(decl.value)) {\n report({\n message: messages.rejected(decl.prop),\n node: decl,\n word: 'attr(',\n });\n }\n },\n});\n", "import type { Rule } from 'stylelint';\n\nimport exampleRule from './example-rule.js';\nimport noAttrFunction from './no-attr-function.js';\n\n/**\n * Registry of all Via stylelint rules.\n *\n * To add a new rule:\n * 1. Create a new file in this directory (e.g., `no-invalid-token.ts`)\n * 2. Export the rule function as default\n * 3. Import and add it to this object\n *\n * Rule names will be prefixed with \"via/\" when registered.\n * Example: A rule named \"no-invalid-token\" becomes \"via/no-invalid-token\"\n */\nconst rules: Record<string, Rule> = {\n [exampleRule.ruleName]: exampleRule,\n [noAttrFunction.ruleName]: noAttrFunction,\n};\n\nexport default rules;\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAOA,gBAAe;;;ACetB,OAAO,eAAe;;;ACdf,IAAM,mBAAmB;;;ADkBhC,IAAM;AAAA,EACJ,OAAO,EAAE,QAAQ,cAAc,gBAAgB;AACjD,IAAI;AA8FG,SAAS,WACd,YACwB;AACxB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,oBAAoB,GAAG,gBAAgB,IAAI,QAAQ;AACzD,QAAM,WAAW,aAAa,mBAAmB,WAAW,QAAQ;AAEpE,QAAM,eAAuC,CAC3C,SACA,YACA,YACG;AACH,WAAO,CAAC,MAAY,WAA0B;AAE5C,YAAM,eAAe,gBAAgB,Q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BAAsB;AAW5B,IAAO,2BAAQ,WAAW;AAAA,EACxB,UAAU;AAAA,EAEV,UAAU;AAAA,IACR,UAAU,CAAC,aACT,2BAA2B,QAAQ;AAAA,EACvC;AAAA,EAEA,MAAM;AAAA,IACJ,KAAK;AAAA,EACP;AAAA,EAEA,UAAU,MAAM,EAAE,UAAU,QAAAC,QAAO,GAAG;AACpC,QAAI,KAAK,SAAS,UAAW;AAE7B,QAAI,oBAAoB,KAAK,KAAK,KAAK,GAAG;AACxC,MAAAA,QAAO;AAAA,QACL,SAAS,SAAS,SAAS,KAAK,IAAI;AAAA,QACpC,MAAM;AAAA,QACN,MAAM;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF;AACF,CAAC;;;ACpBD,IAAM,QAA8B;AAAA,EAClC,CAAC,qBAAY,QAAQ,GAAG;AAAA,EACxB,CAAC,yBAAe,QAAQ,GAAG;AAC7B;AAEA,IAAO,gBAAQ;;;ALhBf,IAAM,eAAe,OAAO,QAAQ,aAAK,EAAE,IAAI,CAAC,CAAC,UAAU,IAAI,MAAM;AACnE,SAAOC,WAAU,aAAa,GAAG,gBAAgB,IAAI,QAAQ,IAAI,IAAI;AACvE,CAAC;AAED,IAAO,gBAAQ;",
|
|
6
|
+
"names": ["stylelint", "report", "report", "stylelint"]
|
|
7
|
+
}
|
package/dist/recommended.d.ts
CHANGED
package/dist/recommended.js
CHANGED
|
@@ -1 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
// src/recommended.ts
|
|
2
|
+
var recommended = {
|
|
3
|
+
plugins: ["@via-ds/stylelint-plugin"],
|
|
4
|
+
rules: {
|
|
5
|
+
"via/example-rule": true,
|
|
6
|
+
"via/no-attr-function": true
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
var recommended_default = recommended;
|
|
10
|
+
export {
|
|
11
|
+
recommended_default as default
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=recommended.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/recommended.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Config } from 'stylelint';\n\n/**\n * Recommended Via stylelint configuration.\n *\n * Enforces design token usage by prohibiting:\n * - Named colors and hex values (use CSS variables instead)\n * - Hard-coded spacing values (use token variables instead)\n *\n * Usage:\n * ```js\n * // stylelint.config.mjs\n * export default {\n * extends: ['@via-ds/stylelint-plugin/recommended'],\n * };\n * ```\n */\nconst recommended: Config = {\n plugins: ['@via-ds/stylelint-plugin'],\n rules: {\n 'via/example-rule': true,\n 'via/no-attr-function': true,\n },\n};\n\nexport default recommended;\n"],
|
|
5
|
+
"mappings": ";AAiBA,IAAM,cAAsB;AAAA,EAC1B,SAAS,CAAC,0BAA0B;AAAA,EACpC,OAAO;AAAA,IACL,oBAAoB;AAAA,IACpB,wBAAwB;AAAA,EAC1B;AACF;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/rules/index.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { AtRule, Comment, Declaration, Root, Rule as CssRule } from
|
|
2
|
-
import type { PostcssResult, Problem, ProblemLocation, Rule, RuleMessages, RuleMeta } from
|
|
3
|
-
import stylelint from
|
|
1
|
+
import type { AtRule, Comment, Declaration, Root, Rule as CssRule } from 'postcss';
|
|
2
|
+
import type { PostcssResult, Problem, ProblemLocation, Rule, RuleMessages, RuleMeta } from 'stylelint';
|
|
3
|
+
import stylelint from 'stylelint';
|
|
4
4
|
declare const report: (problem: Problem) => void, ruleMessages: <T extends RuleMessages, R extends { [K in keyof T]: T[K]; }>(ruleName: string, messages: T) => R, validateOptions: (result: PostcssResult, ruleName: string, ...optionDescriptions: stylelint.RuleOptions[]) => boolean;
|
|
5
5
|
/**
|
|
6
6
|
* Problem report type for the `report` function.
|
|
7
7
|
* Excludes `result` and `ruleName` which are automatically
|
|
8
8
|
* provided by the createRule wrapper.
|
|
9
9
|
*/
|
|
10
|
-
export type ReportProblem = Omit<Problem,
|
|
10
|
+
export type ReportProblem = Omit<Problem, 'result' | 'ruleName' | keyof ProblemLocation> & ProblemLocation;
|
|
11
11
|
/**
|
|
12
12
|
* Context passed to walk callbacks.
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-rule.d.ts","sourceRoot":"","sources":["../../src/utils/create-rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,WAAW,EACX,IAAI,EACJ,IAAI,IAAI,OAAO,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,aAAa,EACb,OAAO,EACP,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,QAAQ,EACT,MAAM,WAAW,CAAC;AACnB,OAAO,SAAS,MAAM,WAAW,CAAC;AAIlC,QAAA,MACW,MAAM,8BAAE,YAAY,qGAAE,eAAe,sGACnC,CAAC;AAEd;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"create-rule.d.ts","sourceRoot":"","sources":["../../src/utils/create-rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,WAAW,EACX,IAAI,EACJ,IAAI,IAAI,OAAO,EAChB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,aAAa,EACb,OAAO,EACP,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,QAAQ,EACT,MAAM,WAAW,CAAC;AACnB,OAAO,SAAS,MAAM,WAAW,CAAC;AAIlC,QAAA,MACW,MAAM,8BAAE,YAAY,qGAAE,eAAe,sGACnC,CAAC;AAEd;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,OAAO,EACP,QAAQ,GAAG,UAAU,GAAG,MAAM,eAAe,CAC9C,GACC,eAAe,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,W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AAM,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createRule, report, type ReportProblem, type RuleDefinition, ruleMessages, validateOptions, type WalkContext, } from
|
|
1
|
+
export { createRule, report, type ReportProblem, type RuleDefinition, ruleMessages, validateOptions, type WalkContext, } from './create-rule.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@via-ds/stylelint-plugin",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Stylelint plugin for Via Design System",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,17 +22,12 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@via-ds/tokens": "0.
|
|
25
|
+
"@via-ds/tokens": "0.1.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@rollup/plugin-babel": "^6.1.0",
|
|
29
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
30
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
31
28
|
"@types/node": "24.1.0",
|
|
29
|
+
"esbuild": "^0.28.0",
|
|
32
30
|
"postcss": "^8.0.0",
|
|
33
|
-
"rollup": "4.55.1",
|
|
34
|
-
"rollup-plugin-node-externals": "^8.1.2",
|
|
35
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
36
31
|
"stylelint": "^17.0.0",
|
|
37
32
|
"typescript": "5.9.3",
|
|
38
33
|
"@via-ds/config": "^0.0.0"
|
|
@@ -56,7 +51,7 @@
|
|
|
56
51
|
}
|
|
57
52
|
},
|
|
58
53
|
"scripts": {
|
|
59
|
-
"build": "
|
|
54
|
+
"build": "esbuild src/index.ts src/recommended.ts --bundle --format=esm --platform=node --target=node20 --outdir=dist --sourcemap --packages=external",
|
|
60
55
|
"tsc": "tsc --project ./tsconfig.json",
|
|
61
56
|
"test": "vitest run"
|
|
62
57
|
}
|