@culur/config-stylelint 1.7.0 → 1.7.1
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/CHANGELOG.md +19 -0
- package/dist/{factory-wCIsmB0H.mjs → factory-B33e_UAZ.mjs} +4 -13
- package/dist/{factory-BTQtj5HJ.cjs.map → factory-B33e_UAZ.mjs.map} +1 -1
- package/dist/{factory-BTQtj5HJ.cjs → factory-BNS_YTTh.cjs} +4 -13
- package/dist/{factory-wCIsmB0H.mjs.map → factory-BNS_YTTh.cjs.map} +1 -1
- package/dist/factory.cjs +1 -1
- package/dist/factory.mjs +1 -1
- package/dist/shareable-configs/auto.cjs +1 -1
- package/dist/shareable-configs/auto.cjs.map +1 -1
- package/dist/shareable-configs/auto.d.cts +1 -3
- package/dist/shareable-configs/auto.d.mts +1 -3
- package/dist/shareable-configs/auto.mjs +1 -1
- package/dist/shareable-configs/auto.mjs.map +1 -1
- package/dist/shareable-configs/none.cjs +1 -1
- package/dist/shareable-configs/none.cjs.map +1 -1
- package/dist/shareable-configs/none.d.cts +1 -3
- package/dist/shareable-configs/none.d.mts +1 -3
- package/dist/shareable-configs/none.mjs +1 -1
- package/dist/shareable-configs/none.mjs.map +1 -1
- package/dist/shareable-configs/sass-vue.cjs +1 -1
- package/dist/shareable-configs/sass-vue.cjs.map +1 -1
- package/dist/shareable-configs/sass-vue.d.cts +1 -3
- package/dist/shareable-configs/sass-vue.d.mts +1 -3
- package/dist/shareable-configs/sass-vue.mjs +1 -1
- package/dist/shareable-configs/sass-vue.mjs.map +1 -1
- package/dist/shareable-configs/sass.cjs +1 -1
- package/dist/shareable-configs/sass.cjs.map +1 -1
- package/dist/shareable-configs/sass.d.cts +1 -3
- package/dist/shareable-configs/sass.d.mts +1 -3
- package/dist/shareable-configs/sass.mjs +1 -1
- package/dist/shareable-configs/sass.mjs.map +1 -1
- package/dist/shareable-configs/tailwind3-sass-vue.cjs +1 -1
- package/dist/shareable-configs/tailwind3-sass-vue.cjs.map +1 -1
- package/dist/shareable-configs/tailwind3-sass-vue.d.cts +1 -3
- package/dist/shareable-configs/tailwind3-sass-vue.d.mts +1 -3
- package/dist/shareable-configs/tailwind3-sass-vue.mjs +1 -1
- package/dist/shareable-configs/tailwind3-sass-vue.mjs.map +1 -1
- package/dist/shareable-configs/tailwind3-sass.cjs +1 -1
- package/dist/shareable-configs/tailwind3-sass.cjs.map +1 -1
- package/dist/shareable-configs/tailwind3-sass.d.cts +1 -3
- package/dist/shareable-configs/tailwind3-sass.d.mts +1 -3
- package/dist/shareable-configs/tailwind3-sass.mjs +1 -1
- package/dist/shareable-configs/tailwind3-sass.mjs.map +1 -1
- package/dist/shareable-configs/tailwind3.cjs +1 -1
- package/dist/shareable-configs/tailwind3.cjs.map +1 -1
- package/dist/shareable-configs/tailwind3.d.cts +1 -3
- package/dist/shareable-configs/tailwind3.d.mts +1 -3
- package/dist/shareable-configs/tailwind3.mjs +1 -1
- package/dist/shareable-configs/tailwind3.mjs.map +1 -1
- package/dist/shareable-configs/tailwind4-vue.cjs +1 -1
- package/dist/shareable-configs/tailwind4-vue.cjs.map +1 -1
- package/dist/shareable-configs/tailwind4-vue.d.cts +1 -3
- package/dist/shareable-configs/tailwind4-vue.d.mts +1 -3
- package/dist/shareable-configs/tailwind4-vue.mjs +1 -1
- package/dist/shareable-configs/tailwind4-vue.mjs.map +1 -1
- package/dist/shareable-configs/tailwind4.cjs +1 -1
- package/dist/shareable-configs/tailwind4.cjs.map +1 -1
- package/dist/shareable-configs/tailwind4.d.cts +1 -3
- package/dist/shareable-configs/tailwind4.d.mts +1 -3
- package/dist/shareable-configs/tailwind4.mjs +1 -1
- package/dist/shareable-configs/tailwind4.mjs.map +1 -1
- package/dist/shareable-configs/vue.cjs +1 -1
- package/dist/shareable-configs/vue.cjs.map +1 -1
- package/dist/shareable-configs/vue.d.cts +1 -3
- package/dist/shareable-configs/vue.d.mts +1 -3
- package/dist/shareable-configs/vue.mjs +1 -1
- package/dist/shareable-configs/vue.mjs.map +1 -1
- package/package.json +7 -7
- package/src/configs/css.test.ts +8 -0
- package/src/configs/scss.test.ts +7 -0
- package/src/configs/shared.test.ts +7 -0
- package/src/configs/vue.test.ts +17 -0
- package/src/factory.test.ts +30 -0
- package/src/rules/at-rule-no-unknown.test.ts +48 -0
- package/src/rules/declaration-block-no-redundant-longhand-properties.test.ts +36 -0
- package/src/rules/dollar-variable-pattern.test.ts +27 -0
- package/src/rules/function-no-unknown.test.ts +44 -0
- package/src/rules/import-notation.test.ts +16 -0
- package/src/rules/order.test.ts +53 -0
- package/src/rules/selector-pseudo-class-no-unknown.test.ts +40 -0
- package/src/shareable-configs/shareable-configs.test.ts +25 -0
- package/src/utils/utils.test.ts +46 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @culur/config-stylelint
|
|
2
2
|
|
|
3
|
+
## 1.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ⚙️ Update dependencies ([`9a88e8f`](https://github.com/culur/culur/commit/9a88e8fd9ba1f143ad679572e599de18cf68bb33)) ([@renovate](https://github.com/apps/renovate)):
|
|
8
|
+
- `dependencies`:
|
|
9
|
+
- `stylelint-scss@^7.1.1`
|
|
10
|
+
- `devDependencies`:
|
|
11
|
+
- `postcss@^8.5.15`
|
|
12
|
+
- `stylelint@^17.12.0`
|
|
13
|
+
|
|
14
|
+
- ⚙️ Update dependencies ([`1cb4759`](https://github.com/culur/culur/commit/1cb475982905de1f2b2bffc9daf9193343129f99)) ([@renovate](https://github.com/apps/renovate)):
|
|
15
|
+
- `dependencies`:
|
|
16
|
+
- `stylelint-config-clean-order@^10.0.0`
|
|
17
|
+
- `stylelint-selector-bem-pattern@^5.0.0`
|
|
18
|
+
|
|
19
|
+
- 📦 Update workspace dependencies:
|
|
20
|
+
- [`@culur/utils-packages@1.3.0`](https://github.com/culur/culur/tree/main/packages/utils-packages#readme)
|
|
21
|
+
|
|
3
22
|
## 1.7.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -65,10 +65,7 @@ const atRuleNoUnknownSCSS = (packages) => defineRules({
|
|
|
65
65
|
"at-rule-no-unknown": null,
|
|
66
66
|
"scss/at-rule-no-unknown": atRuleNoUnknownRule(packages)
|
|
67
67
|
});
|
|
68
|
-
|
|
69
|
-
//#region src/rules/declaration-block-no-redundant-longhand-properties.ts
|
|
70
|
-
const declarationBlockNoRedundantLonghandPropertiesRule = defineRule([true, { ignoreShorthands: ["grid-template"] }]);
|
|
71
|
-
const declarationBlockNoRedundantLonghandProperties = defineRules({ "declaration-block-no-redundant-longhand-properties": declarationBlockNoRedundantLonghandPropertiesRule });
|
|
68
|
+
const declarationBlockNoRedundantLonghandProperties = defineRules({ "declaration-block-no-redundant-longhand-properties": defineRule([true, { ignoreShorthands: ["grid-template"] }]) });
|
|
72
69
|
//#endregion
|
|
73
70
|
//#region src/rules/function-no-unknown.ts
|
|
74
71
|
const getIgnoreFunctionsByTailwindVersion = (tailwindVersion) => {
|
|
@@ -223,10 +220,7 @@ const orderRule = (packages) => defineRule([definePrimaryOption(
|
|
|
223
220
|
}
|
|
224
221
|
), { unspecified: "bottom" }]);
|
|
225
222
|
const order = (packages) => defineRules({ "order/order": orderRule(packages) });
|
|
226
|
-
|
|
227
|
-
//#region src/rules/selector-pseudo-class-no-unknown.ts
|
|
228
|
-
const selectorPseudoClassNoUnknownRule = defineRule([true, { ignorePseudoClasses: ["global", "local"] }]);
|
|
229
|
-
const selectorPseudoClassNoUnknown = defineRules({ "selector-pseudo-class-no-unknown": selectorPseudoClassNoUnknownRule });
|
|
223
|
+
const selectorPseudoClassNoUnknown = defineRules({ "selector-pseudo-class-no-unknown": defineRule([true, { ignorePseudoClasses: ["global", "local"] }]) });
|
|
230
224
|
//#endregion
|
|
231
225
|
//#region src/configs/css.ts
|
|
232
226
|
const configCss = (packages) => ({
|
|
@@ -242,10 +236,7 @@ const configCss = (packages) => ({
|
|
|
242
236
|
"declaration-empty-line-before": null
|
|
243
237
|
}
|
|
244
238
|
});
|
|
245
|
-
|
|
246
|
-
//#region src/rules/dollar-variable-pattern.ts
|
|
247
|
-
const dollarVariablePatternRule = defineRule(["^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$", { message: "Expected variable to be kebab-case" }]);
|
|
248
|
-
const dollarVariablePatternSCSS = defineRules({ "scss/dollar-variable-pattern": dollarVariablePatternRule });
|
|
239
|
+
const dollarVariablePatternSCSS = defineRules({ "scss/dollar-variable-pattern": defineRule(["^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$", { message: "Expected variable to be kebab-case" }]) });
|
|
249
240
|
//#endregion
|
|
250
241
|
//#region src/configs/scss.ts
|
|
251
242
|
const configScss = (packages) => ({
|
|
@@ -270,4 +261,4 @@ function defineConfig(packages, config) {
|
|
|
270
261
|
//#endregion
|
|
271
262
|
export { defineConfig as t };
|
|
272
263
|
|
|
273
|
-
//# sourceMappingURL=factory-
|
|
264
|
+
//# sourceMappingURL=factory-B33e_UAZ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory-BTQtj5HJ.cjs","names":[],"sources":["../src/utils/utils.ts","../src/rules/at-rule-no-unknown.ts","../src/rules/declaration-block-no-redundant-longhand-properties.ts","../src/rules/function-no-unknown.ts","../src/rules/import-notation.ts","../src/rules/order.ts","../src/rules/selector-pseudo-class-no-unknown.ts","../src/configs/css.ts","../src/rules/dollar-variable-pattern.ts","../src/configs/scss.ts","../src/configs/shared.ts","../src/configs/vue.ts","../src/factory.ts"],"sourcesContent":["import type { Config, ConfigRuleSettings } from 'stylelint';\n\n// import type Primary, Secondary from stylelint\n\ntype StringOrRegex = string | RegExp;\ntype OneOrMany<S> = S | S[];\n\nexport type Primary =\n | number\n | true\n | OneOrMany<StringOrRegex>\n | Record<string, any>;\nexport type Secondary = Record<string, any>;\n\nexport const defineRule = <\n PrimaryOption extends Primary,\n SecondaryOptions extends Secondary = object,\n>(\n rule: ConfigRuleSettings<PrimaryOption, SecondaryOptions>,\n) => rule;\n\nexport const defineRules = <TRules extends Config['rules']>(rule: TRules) =>\n rule;\n\n// clone function mergeConfigs from stylelint repository\nexport const mergeConfigs = (\n ...configsOrNull: (Config | undefined | null | false)[]\n) => {\n const configs = configsOrNull.filter((c): c is Config => !!c);\n\n return {\n plugins: [...new Set(configs.flatMap(c => c.plugins ?? []))],\n overrides: [...new Set(configs.flatMap(c => c.overrides ?? []))],\n extends: configs\n .flatMap(c => c.extends ?? [])\n .filter((item, index, arr) => arr.lastIndexOf(item) === index),\n rules: configs.reduce(\n (acc, config) => ({ ...acc, ...config.rules }),\n {} as Config['rules'],\n ),\n ...configs.reduce(\n (\n acc,\n { plugins: _p, overrides: _o, extends: _e, rules: _r, ...config },\n ) => ({ ...acc, ...config }),\n {} as Config,\n ),\n };\n};\n\nexport const isInRange = (\n version: false | number | undefined,\n ...versions: number[]\n) => typeof version === 'number' && versions.includes(version);\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreAtRulesByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return [\n // Directives\n 'tailwind',\n 'apply',\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 1:\n case 2:\n return [\n // Directives\n 'tailwind',\n 'apply',\n 'layer', // new\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return [\n // Directives\n 'tailwind',\n 'layer',\n 'apply',\n 'config', // new\n ];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return [\n // Directives\n 'import',\n 'theme',\n 'source',\n 'utility',\n 'variant',\n 'custom-variant',\n 'apply',\n 'reference',\n\n // Compatibility\n 'config',\n 'plugin',\n ];\n\n default:\n return [];\n }\n};\n\nexport const atRuleNoUnknownRule = (packages: Partial<Packages>) =>\n defineRule<true, { ignoreAtRules: (string | RegExp)[] }>([\n true,\n { ignoreAtRules: getIgnoreAtRulesByTailwindVersion(packages.tailwind) },\n ]);\n\nexport const atRuleNoUnknownCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n\nexport const atRuleNoUnknownSCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': null,\n 'scss/at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const declarationBlockNoRedundantLonghandPropertiesRule = defineRule<\n true,\n { ignoreShorthands?: (string | RegExp)[] }\n>([true, { ignoreShorthands: ['grid-template'] }]);\n\nexport const declarationBlockNoRedundantLonghandProperties = defineRules({\n 'declaration-block-no-redundant-longhand-properties':\n declarationBlockNoRedundantLonghandPropertiesRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreFunctionsByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return ['config'];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n case 1:\n return ['theme'];\n\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 2:\n return ['screen', 'theme'];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return ['theme', 'screen'];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return ['--alpha', '--spacing', 'theme'];\n\n default:\n return [];\n }\n};\n\nconst sassFunctionRegex = /^(list|math|color)\\..+/;\nconst getIgnoreFunctions = (packages: Partial<Packages>) => [\n // https://tailwindcss.com\n ...getIgnoreFunctionsByTailwindVersion(packages.tailwind),\n\n // https://sass-lang.com/documentation/modules/list\n // https://sass-lang.com/documentation/modules/math\n // https://sass-lang.com/documentation/modules/color\n ...(packages.sass //\n ? [sassFunctionRegex]\n : []),\n\n // https://vuejs.org/api/sfc-css-features.html#v-bind-in-css\n ...(packages.vue //\n ? ['v-bind']\n : []),\n];\n\nexport function functionNoUnknownRule(packages: Partial<Packages>) {\n return defineRule<true, { ignoreFunctions: (string | RegExp)[] }>([\n true,\n { ignoreFunctions: getIgnoreFunctions(packages) },\n ]);\n}\n\nexport const functionNoUnknown = (packages: Partial<Packages>) =>\n defineRules({\n 'function-no-unknown': functionNoUnknownRule(packages),\n });\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRules, isInRange } from '~/utils';\n\nexport const importNotationCSS = (packages: Partial<Packages>) =>\n defineRules(\n isInRange(packages.tailwind, 4) //\n ? { 'import-notation': null }\n : {},\n );\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules, isInRange } from '~/utils';\n\n// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md#options\n\ntype Keyword =\n | 'custom-properties' /**/ // Custom properties (e.g. --property: 10px;)\n | 'dollar-variables' /***/ // Dollar variables (e.g. $variable)\n | 'at-variables' /*******/ // At-variables (e.g. @variable available in Less syntax)\n | 'declarations' /*******/ // CSS declarations (e.g. display: block)\n | 'rules' /**************/ // Nested rules (e.g. a { span {} })\n | 'at-rules' /***********/ // Nested at-rules (e.g. div { @media () {} })\n | 'less-mixins'; /*******/ // Mixins in Less syntax (e.g. .mixin();)\n\ninterface AtRule {\n type: 'at-rule';\n name?: string;\n parameter?: string | RegExp;\n hasBlock?: boolean;\n}\n\ninterface Rule {\n type: 'rule';\n selector?: string | RegExp;\n name?: string;\n}\n\ntype PrimaryOption = Array<Keyword | AtRule | Rule>;\ninterface SecondaryOptions {\n unspecified?: 'top' | 'bottom' | 'ignore';\n}\n\nconst definePrimaryOption = (...options: (PrimaryOption[number] | false | undefined)[]) =>\n options.filter((option): option is PrimaryOption[number] => !!option);\n\nconst blockRuleRegex = /^&::[\\w-]+/;\n\nexport const orderRule = (packages: Partial<Packages>) =>\n defineRule<PrimaryOption, SecondaryOptions>([\n definePrimaryOption(\n //! import\n packages.sass /**********************************/ && { type: 'at-rule', name: 'use' }, // scss: @use 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'forward' }, // scss: @forward 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'import' }, // scss: @import 'path/path';\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'import' }, // tailwind 4: @import \"tailwindcss\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'source' }, // tailwind 4: @source \"../node_modules/@culur/ui-lib\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'reference' }, // tailwind 4: @reference \"../../app.css\";\n\n //! root\n isInRange(packages.tailwind, 0, 1, 2, 3) /*******/ && { type: 'at-rule', name: 'tailwind' }, // tailwind 0,1,2,3 : @tailwind base;\n isInRange(packages.tailwind, 3, 4) /*************/ && { type: 'at-rule', name: 'config' }, // tailwind 3,4: @config 'tailwind.custom.config.js'\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'plugin' }, // tailwind 4: @plugin '@tailwindcss/typography'\n isInRange(packages.tailwind, 1, 2, 3) /**********/ && { type: 'at-rule', name: 'layer' }, // tailwind 1,2,3 : @layer base {}\n\n //! variables\n 'dollar-variables', // css: $variable: 10px;\n 'at-variables', // css: @variable: 10px;\n { type: 'at-rule', hasBlock: false }, // css: @variable: 10px;\n 'custom-properties', // css: --property: 10px;\n\n //! tailwind\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'theme' }, // tailwind 4: @theme {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'custom-variant' }, // tailwind 4: @custom-variant pointer-coarse (@media (pointer: coarse));\n\n //! functions, methods\n packages.sass /**********************************/ && { type: 'at-rule', name: 'function' }, // scss: @function sum() {}\n packages.sass /**********************************/ && { type: 'at-rule', name: 'mixin' }, // scss: @mixin mixin-name {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'utility' }, // tailwind 4: @utility tab-4 { tab-size: 4; }\n\n //! declarations\n packages.sass /**********************************/ && { type: 'at-rule', name: 'extend' }, // scss: @extend .class-name;\n packages.sass /**********************************/ && { type: 'at-rule', name: 'include' }, // scss: @include mixin-name;\n isInRange(packages.tailwind, 0, 1, 2, 3, 4) /****/ && { type: 'at-rule', name: 'apply' }, // tailwind 0,1,2,3,4: @apply p-3;\n 'less-mixins', // less: .mixin();\n 'declarations', // css: display: block;\n\n //! block rules\n { type: 'rule', selector: blockRuleRegex }, // css: &::after {}\n 'rules', // css: child-component {}\n\n //! blocks nested\n packages.sass && { type: 'at-rule', name: 'at-root' }, // scss: @at-root selector { /* content */ }\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'responsive' }, // tailwind 0,1,2 : @responsive {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'variants' }, // tailwind 0,1,2 : @variants hover {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'screen' }, // tailwind 0,1,2 : @screen sm {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'variants' }, // tailwind 4: @variant dark {}\n { type: 'at-rule', hasBlock: true }, // css: @media () {}\n ),\n {\n unspecified: 'bottom',\n },\n ]);\n\nexport const order = (packages: Partial<Packages>) =>\n defineRules({\n 'order/order': orderRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const selectorPseudoClassNoUnknownRule = defineRule<\n true,\n { ignorePseudoClasses?: (string | RegExp)[] }\n>([true, { ignorePseudoClasses: ['global', 'local'] }]);\n\nexport const selectorPseudoClassNoUnknown = defineRules({\n 'selector-pseudo-class-no-unknown': selectorPseudoClassNoUnknownRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownCSS } from '~/rules/at-rule-no-unknown';\nimport { declarationBlockNoRedundantLonghandProperties } from '~/rules/declaration-block-no-redundant-longhand-properties';\nimport { functionNoUnknown } from '~/rules/function-no-unknown';\nimport { importNotationCSS } from '~/rules/import-notation';\nimport { order } from '~/rules/order';\nimport { selectorPseudoClassNoUnknown } from '~/rules/selector-pseudo-class-no-unknown';\n\nexport const configCss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard', 'stylelint-config-clean-order'],\n plugins: ['stylelint-order', 'stylelint-selector-bem-pattern'],\n rules: {\n ...atRuleNoUnknownCSS(packages),\n ...declarationBlockNoRedundantLonghandProperties,\n ...functionNoUnknown(packages),\n ...importNotationCSS(packages),\n ...order(packages),\n ...selectorPseudoClassNoUnknown,\n 'declaration-empty-line-before': null,\n },\n});\n","import { defineRule, defineRules } from '~/utils';\n\ntype PrimaryOption = string;\ninterface SecondaryOptions {\n message: string;\n}\n\nexport const dollarVariablePatternRule = defineRule<\n PrimaryOption,\n SecondaryOptions\n>([\n '^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',\n { message: 'Expected variable to be kebab-case' },\n]);\n\nexport const dollarVariablePatternSCSS = defineRules({\n 'scss/dollar-variable-pattern': dollarVariablePatternRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownSCSS } from '~/rules/at-rule-no-unknown';\nimport { dollarVariablePatternSCSS } from '~/rules/dollar-variable-pattern';\n\nexport const configScss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard-scss'],\n rules: {\n ...atRuleNoUnknownSCSS(packages),\n ...dollarVariablePatternSCSS,\n },\n});\n","import type { Config } from 'stylelint';\n\nexport const configShared = (): Config => ({\n extends: ['stylelint-config-html'],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\n\nexport const configVue = (packages: Partial<Packages>): Config => ({\n extends: [\n packages.sass\n ? 'stylelint-config-standard-vue/scss'\n : 'stylelint-config-standard-vue',\n ],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { configCss } from './configs/css';\nimport { configScss } from './configs/scss';\nimport { configShared } from './configs/shared';\nimport { configVue } from './configs/vue';\nimport { mergeConfigs } from './utils';\n\nexport default function defineConfig(\n packages?: Partial<Packages>,\n config?: Config,\n): Config {\n const packages_ = packages ?? {};\n\n return mergeConfigs(\n configShared(),\n configCss(packages_),\n packages_.sass && configScss(packages_),\n packages_.vue && configVue(packages_),\n config,\n );\n}\n"],"mappings":";AAcA,MAAa,cAIX,SACG;AAEL,MAAa,eAA+C,SAC1D;AAGF,MAAa,gBACX,GAAG,kBACA;CACH,MAAM,UAAU,cAAc,QAAQ,MAAmB,CAAC,CAAC,EAAE;AAE7D,QAAO;EACL,SAAS,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;EAC5D,WAAW,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;EAChE,SAAS,QACN,SAAQ,MAAK,EAAE,WAAW,EAAE,CAAC,CAC7B,QAAQ,MAAM,OAAO,QAAQ,IAAI,YAAY,KAAK,KAAK,MAAM;EAChE,OAAO,QAAQ,QACZ,KAAK,YAAY;GAAE,GAAG;GAAK,GAAG,OAAO;GAAO,GAC7C,EAAE,CACH;EACD,GAAG,QAAQ,QAEP,KACA,EAAE,SAAS,IAAI,WAAW,IAAI,SAAS,IAAI,OAAO,IAAI,GAAG,cACrD;GAAE,GAAG;GAAK,GAAG;GAAQ,GAC3B,EAAE,CACH;EACF;;AAGH,MAAa,aACX,SACA,GAAG,aACA,OAAO,YAAY,YAAY,SAAS,SAAS,QAAQ;;;AClD9D,MAAM,qCACJ,oBACG;AACH,SAAQ,iBAAR;EAEE,KAAK,EACH,QAAO;GAEL;GACA;GAEA;GACA;GACA;GACD;E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dD,MAAa,4BAA4B,WAGvC,CACA,0CACA,EAAE,SAAS,sCAAsC,CAClD,CAAC;AAEF,MAAa,4BAA4B,YAAY,EACnD,gCAAgC,2BACjC,CAAC;;;ACZF,MAAa,cAAc,cAAyC;CAClE,SAAS,CAAC,iCAAiC;CAC3C,OAAO;EACL,GAAG,oBAAoB,SAAS;EAChC,GAAG;EACJ;CACF;;;ACTD,MAAa,sBAA8B,EACzC,SAAS,CAAC,wBAAwB,EACnC;;;ACDD,MAAa,aAAa,cAAyC,EACjE,SAAS,CACP,SAAS,OACL,uCACA,gCACL,EACF;;;ACDD,SAAwB,aACtB,UACA,QACQ;CACR,MAAM,YAAY,YAAY,EAAE;AAEhC,QAAO,aACL,cAAc,EACd,UAAU,UAAU,EACpB,UAAU,QAAQ,WAAW,UAAU,EACvC,UAAU,OAAO,UAAU,UAAU,EACrC,OACD"}
|
|
1
|
+
{"version":3,"file":"factory-B33e_UAZ.mjs","names":[],"sources":["../src/utils/utils.ts","../src/rules/at-rule-no-unknown.ts","../src/rules/declaration-block-no-redundant-longhand-properties.ts","../src/rules/function-no-unknown.ts","../src/rules/import-notation.ts","../src/rules/order.ts","../src/rules/selector-pseudo-class-no-unknown.ts","../src/configs/css.ts","../src/rules/dollar-variable-pattern.ts","../src/configs/scss.ts","../src/configs/shared.ts","../src/configs/vue.ts","../src/factory.ts"],"sourcesContent":["import type { Config, ConfigRuleSettings } from 'stylelint';\n\n// import type Primary, Secondary from stylelint\n\ntype StringOrRegex = string | RegExp;\ntype OneOrMany<S> = S | S[];\n\nexport type Primary =\n | number\n | true\n | OneOrMany<StringOrRegex>\n | Record<string, any>;\nexport type Secondary = Record<string, any>;\n\nexport const defineRule = <\n PrimaryOption extends Primary,\n SecondaryOptions extends Secondary = object,\n>(\n rule: ConfigRuleSettings<PrimaryOption, SecondaryOptions>,\n) => rule;\n\nexport const defineRules = <TRules extends Config['rules']>(rule: TRules) =>\n rule;\n\n// clone function mergeConfigs from stylelint repository\nexport const mergeConfigs = (\n ...configsOrNull: (Config | undefined | null | false)[]\n) => {\n const configs = configsOrNull.filter((c): c is Config => !!c);\n\n return {\n plugins: [...new Set(configs.flatMap(c => c.plugins ?? []))],\n overrides: [...new Set(configs.flatMap(c => c.overrides ?? []))],\n extends: configs\n .flatMap(c => c.extends ?? [])\n .filter((item, index, arr) => arr.lastIndexOf(item) === index),\n rules: configs.reduce(\n (acc, config) => ({ ...acc, ...config.rules }),\n {} as Config['rules'],\n ),\n ...configs.reduce(\n (\n acc,\n { plugins: _p, overrides: _o, extends: _e, rules: _r, ...config },\n ) => ({ ...acc, ...config }),\n {} as Config,\n ),\n };\n};\n\nexport const isInRange = (\n version: false | number | undefined,\n ...versions: number[]\n) => typeof version === 'number' && versions.includes(version);\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreAtRulesByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return [\n // Directives\n 'tailwind',\n 'apply',\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 1:\n case 2:\n return [\n // Directives\n 'tailwind',\n 'apply',\n 'layer', // new\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return [\n // Directives\n 'tailwind',\n 'layer',\n 'apply',\n 'config', // new\n ];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return [\n // Directives\n 'import',\n 'theme',\n 'source',\n 'utility',\n 'variant',\n 'custom-variant',\n 'apply',\n 'reference',\n\n // Compatibility\n 'config',\n 'plugin',\n ];\n\n default:\n return [];\n }\n};\n\nexport const atRuleNoUnknownRule = (packages: Partial<Packages>) =>\n defineRule<true, { ignoreAtRules: (string | RegExp)[] }>([\n true,\n { ignoreAtRules: getIgnoreAtRulesByTailwindVersion(packages.tailwind) },\n ]);\n\nexport const atRuleNoUnknownCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n\nexport const atRuleNoUnknownSCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': null,\n 'scss/at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const declarationBlockNoRedundantLonghandPropertiesRule = defineRule<\n true,\n { ignoreShorthands?: (string | RegExp)[] }\n>([true, { ignoreShorthands: ['grid-template'] }]);\n\nexport const declarationBlockNoRedundantLonghandProperties = defineRules({\n 'declaration-block-no-redundant-longhand-properties':\n declarationBlockNoRedundantLonghandPropertiesRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreFunctionsByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return ['config'];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n case 1:\n return ['theme'];\n\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 2:\n return ['screen', 'theme'];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return ['theme', 'screen'];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return ['--alpha', '--spacing', 'theme'];\n\n default:\n return [];\n }\n};\n\nconst sassFunctionRegex = /^(list|math|color)\\..+/;\nconst getIgnoreFunctions = (packages: Partial<Packages>) => [\n // https://tailwindcss.com\n ...getIgnoreFunctionsByTailwindVersion(packages.tailwind),\n\n // https://sass-lang.com/documentation/modules/list\n // https://sass-lang.com/documentation/modules/math\n // https://sass-lang.com/documentation/modules/color\n ...(packages.sass //\n ? [sassFunctionRegex]\n : []),\n\n // https://vuejs.org/api/sfc-css-features.html#v-bind-in-css\n ...(packages.vue //\n ? ['v-bind']\n : []),\n];\n\nexport function functionNoUnknownRule(packages: Partial<Packages>) {\n return defineRule<true, { ignoreFunctions: (string | RegExp)[] }>([\n true,\n { ignoreFunctions: getIgnoreFunctions(packages) },\n ]);\n}\n\nexport const functionNoUnknown = (packages: Partial<Packages>) =>\n defineRules({\n 'function-no-unknown': functionNoUnknownRule(packages),\n });\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRules, isInRange } from '~/utils';\n\nexport const importNotationCSS = (packages: Partial<Packages>) =>\n defineRules(\n isInRange(packages.tailwind, 4) //\n ? { 'import-notation': null }\n : {},\n );\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules, isInRange } from '~/utils';\n\n// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md#options\n\ntype Keyword =\n | 'custom-properties' /**/ // Custom properties (e.g. --property: 10px;)\n | 'dollar-variables' /***/ // Dollar variables (e.g. $variable)\n | 'at-variables' /*******/ // At-variables (e.g. @variable available in Less syntax)\n | 'declarations' /*******/ // CSS declarations (e.g. display: block)\n | 'rules' /**************/ // Nested rules (e.g. a { span {} })\n | 'at-rules' /***********/ // Nested at-rules (e.g. div { @media () {} })\n | 'less-mixins'; /*******/ // Mixins in Less syntax (e.g. .mixin();)\n\ninterface AtRule {\n type: 'at-rule';\n name?: string;\n parameter?: string | RegExp;\n hasBlock?: boolean;\n}\n\ninterface Rule {\n type: 'rule';\n selector?: string | RegExp;\n name?: string;\n}\n\ntype PrimaryOption = Array<Keyword | AtRule | Rule>;\ninterface SecondaryOptions {\n unspecified?: 'top' | 'bottom' | 'ignore';\n}\n\nconst definePrimaryOption = (...options: (PrimaryOption[number] | false | undefined)[]) =>\n options.filter((option): option is PrimaryOption[number] => !!option);\n\nconst blockRuleRegex = /^&::[\\w-]+/;\n\nexport const orderRule = (packages: Partial<Packages>) =>\n defineRule<PrimaryOption, SecondaryOptions>([\n definePrimaryOption(\n //! import\n packages.sass /**********************************/ && { type: 'at-rule', name: 'use' }, // scss: @use 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'forward' }, // scss: @forward 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'import' }, // scss: @import 'path/path';\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'import' }, // tailwind 4: @import \"tailwindcss\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'source' }, // tailwind 4: @source \"../node_modules/@culur/ui-lib\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'reference' }, // tailwind 4: @reference \"../../app.css\";\n\n //! root\n isInRange(packages.tailwind, 0, 1, 2, 3) /*******/ && { type: 'at-rule', name: 'tailwind' }, // tailwind 0,1,2,3 : @tailwind base;\n isInRange(packages.tailwind, 3, 4) /*************/ && { type: 'at-rule', name: 'config' }, // tailwind 3,4: @config 'tailwind.custom.config.js'\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'plugin' }, // tailwind 4: @plugin '@tailwindcss/typography'\n isInRange(packages.tailwind, 1, 2, 3) /**********/ && { type: 'at-rule', name: 'layer' }, // tailwind 1,2,3 : @layer base {}\n\n //! variables\n 'dollar-variables', // css: $variable: 10px;\n 'at-variables', // css: @variable: 10px;\n { type: 'at-rule', hasBlock: false }, // css: @variable: 10px;\n 'custom-properties', // css: --property: 10px;\n\n //! tailwind\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'theme' }, // tailwind 4: @theme {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'custom-variant' }, // tailwind 4: @custom-variant pointer-coarse (@media (pointer: coarse));\n\n //! functions, methods\n packages.sass /**********************************/ && { type: 'at-rule', name: 'function' }, // scss: @function sum() {}\n packages.sass /**********************************/ && { type: 'at-rule', name: 'mixin' }, // scss: @mixin mixin-name {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'utility' }, // tailwind 4: @utility tab-4 { tab-size: 4; }\n\n //! declarations\n packages.sass /**********************************/ && { type: 'at-rule', name: 'extend' }, // scss: @extend .class-name;\n packages.sass /**********************************/ && { type: 'at-rule', name: 'include' }, // scss: @include mixin-name;\n isInRange(packages.tailwind, 0, 1, 2, 3, 4) /****/ && { type: 'at-rule', name: 'apply' }, // tailwind 0,1,2,3,4: @apply p-3;\n 'less-mixins', // less: .mixin();\n 'declarations', // css: display: block;\n\n //! block rules\n { type: 'rule', selector: blockRuleRegex }, // css: &::after {}\n 'rules', // css: child-component {}\n\n //! blocks nested\n packages.sass && { type: 'at-rule', name: 'at-root' }, // scss: @at-root selector { /* content */ }\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'responsive' }, // tailwind 0,1,2 : @responsive {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'variants' }, // tailwind 0,1,2 : @variants hover {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'screen' }, // tailwind 0,1,2 : @screen sm {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'variants' }, // tailwind 4: @variant dark {}\n { type: 'at-rule', hasBlock: true }, // css: @media () {}\n ),\n {\n unspecified: 'bottom',\n },\n ]);\n\nexport const order = (packages: Partial<Packages>) =>\n defineRules({\n 'order/order': orderRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const selectorPseudoClassNoUnknownRule = defineRule<\n true,\n { ignorePseudoClasses?: (string | RegExp)[] }\n>([true, { ignorePseudoClasses: ['global', 'local'] }]);\n\nexport const selectorPseudoClassNoUnknown = defineRules({\n 'selector-pseudo-class-no-unknown': selectorPseudoClassNoUnknownRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownCSS } from '~/rules/at-rule-no-unknown';\nimport { declarationBlockNoRedundantLonghandProperties } from '~/rules/declaration-block-no-redundant-longhand-properties';\nimport { functionNoUnknown } from '~/rules/function-no-unknown';\nimport { importNotationCSS } from '~/rules/import-notation';\nimport { order } from '~/rules/order';\nimport { selectorPseudoClassNoUnknown } from '~/rules/selector-pseudo-class-no-unknown';\n\nexport const configCss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard', 'stylelint-config-clean-order'],\n plugins: ['stylelint-order', 'stylelint-selector-bem-pattern'],\n rules: {\n ...atRuleNoUnknownCSS(packages),\n ...declarationBlockNoRedundantLonghandProperties,\n ...functionNoUnknown(packages),\n ...importNotationCSS(packages),\n ...order(packages),\n ...selectorPseudoClassNoUnknown,\n 'declaration-empty-line-before': null,\n },\n});\n","import { defineRule, defineRules } from '~/utils';\n\ntype PrimaryOption = string;\ninterface SecondaryOptions {\n message: string;\n}\n\nexport const dollarVariablePatternRule = defineRule<\n PrimaryOption,\n SecondaryOptions\n>([\n '^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',\n { message: 'Expected variable to be kebab-case' },\n]);\n\nexport const dollarVariablePatternSCSS = defineRules({\n 'scss/dollar-variable-pattern': dollarVariablePatternRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownSCSS } from '~/rules/at-rule-no-unknown';\nimport { dollarVariablePatternSCSS } from '~/rules/dollar-variable-pattern';\n\nexport const configScss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard-scss'],\n rules: {\n ...atRuleNoUnknownSCSS(packages),\n ...dollarVariablePatternSCSS,\n },\n});\n","import type { Config } from 'stylelint';\n\nexport const configShared = (): Config => ({\n extends: ['stylelint-config-html'],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\n\nexport const configVue = (packages: Partial<Packages>): Config => ({\n extends: [\n packages.sass\n ? 'stylelint-config-standard-vue/scss'\n : 'stylelint-config-standard-vue',\n ],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { configCss } from './configs/css';\nimport { configScss } from './configs/scss';\nimport { configShared } from './configs/shared';\nimport { configVue } from './configs/vue';\nimport { mergeConfigs } from './utils';\n\nexport default function defineConfig(\n packages?: Partial<Packages>,\n config?: Config,\n): Config {\n const packages_ = packages ?? {};\n\n return mergeConfigs(\n configShared(),\n configCss(packages_),\n packages_.sass && configScss(packages_),\n packages_.vue && configVue(packages_),\n config,\n );\n}\n"],"mappings":";AAcA,MAAa,cAIX,SACG;AAEL,MAAa,eAA+C,SAC1D;AAGF,MAAa,gBACX,GAAG,kBACA;CACH,MAAM,UAAU,cAAc,QAAQ,MAAmB,CAAC,CAAC,CAAC;CAE5D,OAAO;EACL,SAAS,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;EAC3D,WAAW,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;EAC/D,SAAS,QACN,SAAQ,MAAK,EAAE,WAAW,CAAC,CAAC,EAC5B,QAAQ,MAAM,OAAO,QAAQ,IAAI,YAAY,IAAI,MAAM,KAAK;EAC/D,OAAO,QAAQ,QACZ,KAAK,YAAY;GAAE,GAAG;GAAK,GAAG,OAAO;EAAM,IAC5C,CAAC,CACH;EACA,GAAG,QAAQ,QAEP,KACA,EAAE,SAAS,IAAI,WAAW,IAAI,SAAS,IAAI,OAAO,IAAI,GAAG,cACrD;GAAE,GAAG;GAAK,GAAG;EAAO,IAC1B,CAAC,CACH;CACF;AACF;AAEA,MAAa,aACX,SACA,GAAG,aACA,OAAO,YAAY,YAAY,SAAS,SAAS,OAAO;;;AClD7D,MAAM,qCACJ,oBACG;CACH,QAAQ,iBAAR;EAEE,KAAK,GACH,OAAO;GAEL;GACA;GAEA;GACA;GACA;EACF;EAIF,KAAK;EACL,KAAK,GACH,OAAO;GAEL;GACA;GACA;GAEA;GACA;GACA;EACF;EAGF,KAAK,GACH,OAAO;GAEL;GACA;GACA;GACA;EACF;EAGF,KAAK,GACH,OAAO;GAEL;GACA;G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AAG,oBAAoB,QAAQ;EAC/B,GAAG;CACL;AACF;;;ACTA,MAAa,sBAA8B,EACzC,SAAS,CAAC,uBAAuB,EACnC;;;ACDA,MAAa,aAAa,cAAyC,EACjE,SAAS,CACP,SAAS,OACL,uCACA,+BACN,EACF;;;ACDA,SAAwB,aACtB,UACA,QACQ;CACR,MAAM,YAAY,YAAY,CAAC;CAE/B,OAAO,aACL,aAAa,GACb,UAAU,SAAS,GACnB,UAAU,QAAQ,WAAW,SAAS,GACtC,UAAU,OAAO,UAAU,SAAS,GACpC,MACF;AACF"}
|
|
@@ -65,10 +65,7 @@ const atRuleNoUnknownSCSS = (packages) => defineRules({
|
|
|
65
65
|
"at-rule-no-unknown": null,
|
|
66
66
|
"scss/at-rule-no-unknown": atRuleNoUnknownRule(packages)
|
|
67
67
|
});
|
|
68
|
-
|
|
69
|
-
//#region src/rules/declaration-block-no-redundant-longhand-properties.ts
|
|
70
|
-
const declarationBlockNoRedundantLonghandPropertiesRule = defineRule([true, { ignoreShorthands: ["grid-template"] }]);
|
|
71
|
-
const declarationBlockNoRedundantLonghandProperties = defineRules({ "declaration-block-no-redundant-longhand-properties": declarationBlockNoRedundantLonghandPropertiesRule });
|
|
68
|
+
const declarationBlockNoRedundantLonghandProperties = defineRules({ "declaration-block-no-redundant-longhand-properties": defineRule([true, { ignoreShorthands: ["grid-template"] }]) });
|
|
72
69
|
//#endregion
|
|
73
70
|
//#region src/rules/function-no-unknown.ts
|
|
74
71
|
const getIgnoreFunctionsByTailwindVersion = (tailwindVersion) => {
|
|
@@ -223,10 +220,7 @@ const orderRule = (packages) => defineRule([definePrimaryOption(
|
|
|
223
220
|
}
|
|
224
221
|
), { unspecified: "bottom" }]);
|
|
225
222
|
const order = (packages) => defineRules({ "order/order": orderRule(packages) });
|
|
226
|
-
|
|
227
|
-
//#region src/rules/selector-pseudo-class-no-unknown.ts
|
|
228
|
-
const selectorPseudoClassNoUnknownRule = defineRule([true, { ignorePseudoClasses: ["global", "local"] }]);
|
|
229
|
-
const selectorPseudoClassNoUnknown = defineRules({ "selector-pseudo-class-no-unknown": selectorPseudoClassNoUnknownRule });
|
|
223
|
+
const selectorPseudoClassNoUnknown = defineRules({ "selector-pseudo-class-no-unknown": defineRule([true, { ignorePseudoClasses: ["global", "local"] }]) });
|
|
230
224
|
//#endregion
|
|
231
225
|
//#region src/configs/css.ts
|
|
232
226
|
const configCss = (packages) => ({
|
|
@@ -242,10 +236,7 @@ const configCss = (packages) => ({
|
|
|
242
236
|
"declaration-empty-line-before": null
|
|
243
237
|
}
|
|
244
238
|
});
|
|
245
|
-
|
|
246
|
-
//#region src/rules/dollar-variable-pattern.ts
|
|
247
|
-
const dollarVariablePatternRule = defineRule(["^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$", { message: "Expected variable to be kebab-case" }]);
|
|
248
|
-
const dollarVariablePatternSCSS = defineRules({ "scss/dollar-variable-pattern": dollarVariablePatternRule });
|
|
239
|
+
const dollarVariablePatternSCSS = defineRules({ "scss/dollar-variable-pattern": defineRule(["^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$", { message: "Expected variable to be kebab-case" }]) });
|
|
249
240
|
//#endregion
|
|
250
241
|
//#region src/configs/scss.ts
|
|
251
242
|
const configScss = (packages) => ({
|
|
@@ -275,4 +266,4 @@ Object.defineProperty(exports, "defineConfig", {
|
|
|
275
266
|
}
|
|
276
267
|
});
|
|
277
268
|
|
|
278
|
-
//# sourceMappingURL=factory-
|
|
269
|
+
//# sourceMappingURL=factory-BNS_YTTh.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory-wCIsmB0H.mjs","names":[],"sources":["../src/utils/utils.ts","../src/rules/at-rule-no-unknown.ts","../src/rules/declaration-block-no-redundant-longhand-properties.ts","../src/rules/function-no-unknown.ts","../src/rules/import-notation.ts","../src/rules/order.ts","../src/rules/selector-pseudo-class-no-unknown.ts","../src/configs/css.ts","../src/rules/dollar-variable-pattern.ts","../src/configs/scss.ts","../src/configs/shared.ts","../src/configs/vue.ts","../src/factory.ts"],"sourcesContent":["import type { Config, ConfigRuleSettings } from 'stylelint';\n\n// import type Primary, Secondary from stylelint\n\ntype StringOrRegex = string | RegExp;\ntype OneOrMany<S> = S | S[];\n\nexport type Primary =\n | number\n | true\n | OneOrMany<StringOrRegex>\n | Record<string, any>;\nexport type Secondary = Record<string, any>;\n\nexport const defineRule = <\n PrimaryOption extends Primary,\n SecondaryOptions extends Secondary = object,\n>(\n rule: ConfigRuleSettings<PrimaryOption, SecondaryOptions>,\n) => rule;\n\nexport const defineRules = <TRules extends Config['rules']>(rule: TRules) =>\n rule;\n\n// clone function mergeConfigs from stylelint repository\nexport const mergeConfigs = (\n ...configsOrNull: (Config | undefined | null | false)[]\n) => {\n const configs = configsOrNull.filter((c): c is Config => !!c);\n\n return {\n plugins: [...new Set(configs.flatMap(c => c.plugins ?? []))],\n overrides: [...new Set(configs.flatMap(c => c.overrides ?? []))],\n extends: configs\n .flatMap(c => c.extends ?? [])\n .filter((item, index, arr) => arr.lastIndexOf(item) === index),\n rules: configs.reduce(\n (acc, config) => ({ ...acc, ...config.rules }),\n {} as Config['rules'],\n ),\n ...configs.reduce(\n (\n acc,\n { plugins: _p, overrides: _o, extends: _e, rules: _r, ...config },\n ) => ({ ...acc, ...config }),\n {} as Config,\n ),\n };\n};\n\nexport const isInRange = (\n version: false | number | undefined,\n ...versions: number[]\n) => typeof version === 'number' && versions.includes(version);\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreAtRulesByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return [\n // Directives\n 'tailwind',\n 'apply',\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 1:\n case 2:\n return [\n // Directives\n 'tailwind',\n 'apply',\n 'layer', // new\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return [\n // Directives\n 'tailwind',\n 'layer',\n 'apply',\n 'config', // new\n ];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return [\n // Directives\n 'import',\n 'theme',\n 'source',\n 'utility',\n 'variant',\n 'custom-variant',\n 'apply',\n 'reference',\n\n // Compatibility\n 'config',\n 'plugin',\n ];\n\n default:\n return [];\n }\n};\n\nexport const atRuleNoUnknownRule = (packages: Partial<Packages>) =>\n defineRule<true, { ignoreAtRules: (string | RegExp)[] }>([\n true,\n { ignoreAtRules: getIgnoreAtRulesByTailwindVersion(packages.tailwind) },\n ]);\n\nexport const atRuleNoUnknownCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n\nexport const atRuleNoUnknownSCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': null,\n 'scss/at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const declarationBlockNoRedundantLonghandPropertiesRule = defineRule<\n true,\n { ignoreShorthands?: (string | RegExp)[] }\n>([true, { ignoreShorthands: ['grid-template'] }]);\n\nexport const declarationBlockNoRedundantLonghandProperties = defineRules({\n 'declaration-block-no-redundant-longhand-properties':\n declarationBlockNoRedundantLonghandPropertiesRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreFunctionsByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return ['config'];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n case 1:\n return ['theme'];\n\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 2:\n return ['screen', 'theme'];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return ['theme', 'screen'];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return ['--alpha', '--spacing', 'theme'];\n\n default:\n return [];\n }\n};\n\nconst sassFunctionRegex = /^(list|math|color)\\..+/;\nconst getIgnoreFunctions = (packages: Partial<Packages>) => [\n // https://tailwindcss.com\n ...getIgnoreFunctionsByTailwindVersion(packages.tailwind),\n\n // https://sass-lang.com/documentation/modules/list\n // https://sass-lang.com/documentation/modules/math\n // https://sass-lang.com/documentation/modules/color\n ...(packages.sass //\n ? [sassFunctionRegex]\n : []),\n\n // https://vuejs.org/api/sfc-css-features.html#v-bind-in-css\n ...(packages.vue //\n ? ['v-bind']\n : []),\n];\n\nexport function functionNoUnknownRule(packages: Partial<Packages>) {\n return defineRule<true, { ignoreFunctions: (string | RegExp)[] }>([\n true,\n { ignoreFunctions: getIgnoreFunctions(packages) },\n ]);\n}\n\nexport const functionNoUnknown = (packages: Partial<Packages>) =>\n defineRules({\n 'function-no-unknown': functionNoUnknownRule(packages),\n });\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRules, isInRange } from '~/utils';\n\nexport const importNotationCSS = (packages: Partial<Packages>) =>\n defineRules(\n isInRange(packages.tailwind, 4) //\n ? { 'import-notation': null }\n : {},\n );\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules, isInRange } from '~/utils';\n\n// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md#options\n\ntype Keyword =\n | 'custom-properties' /**/ // Custom properties (e.g. --property: 10px;)\n | 'dollar-variables' /***/ // Dollar variables (e.g. $variable)\n | 'at-variables' /*******/ // At-variables (e.g. @variable available in Less syntax)\n | 'declarations' /*******/ // CSS declarations (e.g. display: block)\n | 'rules' /**************/ // Nested rules (e.g. a { span {} })\n | 'at-rules' /***********/ // Nested at-rules (e.g. div { @media () {} })\n | 'less-mixins'; /*******/ // Mixins in Less syntax (e.g. .mixin();)\n\ninterface AtRule {\n type: 'at-rule';\n name?: string;\n parameter?: string | RegExp;\n hasBlock?: boolean;\n}\n\ninterface Rule {\n type: 'rule';\n selector?: string | RegExp;\n name?: string;\n}\n\ntype PrimaryOption = Array<Keyword | AtRule | Rule>;\ninterface SecondaryOptions {\n unspecified?: 'top' | 'bottom' | 'ignore';\n}\n\nconst definePrimaryOption = (...options: (PrimaryOption[number] | false | undefined)[]) =>\n options.filter((option): option is PrimaryOption[number] => !!option);\n\nconst blockRuleRegex = /^&::[\\w-]+/;\n\nexport const orderRule = (packages: Partial<Packages>) =>\n defineRule<PrimaryOption, SecondaryOptions>([\n definePrimaryOption(\n //! import\n packages.sass /**********************************/ && { type: 'at-rule', name: 'use' }, // scss: @use 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'forward' }, // scss: @forward 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'import' }, // scss: @import 'path/path';\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'import' }, // tailwind 4: @import \"tailwindcss\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'source' }, // tailwind 4: @source \"../node_modules/@culur/ui-lib\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'reference' }, // tailwind 4: @reference \"../../app.css\";\n\n //! root\n isInRange(packages.tailwind, 0, 1, 2, 3) /*******/ && { type: 'at-rule', name: 'tailwind' }, // tailwind 0,1,2,3 : @tailwind base;\n isInRange(packages.tailwind, 3, 4) /*************/ && { type: 'at-rule', name: 'config' }, // tailwind 3,4: @config 'tailwind.custom.config.js'\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'plugin' }, // tailwind 4: @plugin '@tailwindcss/typography'\n isInRange(packages.tailwind, 1, 2, 3) /**********/ && { type: 'at-rule', name: 'layer' }, // tailwind 1,2,3 : @layer base {}\n\n //! variables\n 'dollar-variables', // css: $variable: 10px;\n 'at-variables', // css: @variable: 10px;\n { type: 'at-rule', hasBlock: false }, // css: @variable: 10px;\n 'custom-properties', // css: --property: 10px;\n\n //! tailwind\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'theme' }, // tailwind 4: @theme {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'custom-variant' }, // tailwind 4: @custom-variant pointer-coarse (@media (pointer: coarse));\n\n //! functions, methods\n packages.sass /**********************************/ && { type: 'at-rule', name: 'function' }, // scss: @function sum() {}\n packages.sass /**********************************/ && { type: 'at-rule', name: 'mixin' }, // scss: @mixin mixin-name {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'utility' }, // tailwind 4: @utility tab-4 { tab-size: 4; }\n\n //! declarations\n packages.sass /**********************************/ && { type: 'at-rule', name: 'extend' }, // scss: @extend .class-name;\n packages.sass /**********************************/ && { type: 'at-rule', name: 'include' }, // scss: @include mixin-name;\n isInRange(packages.tailwind, 0, 1, 2, 3, 4) /****/ && { type: 'at-rule', name: 'apply' }, // tailwind 0,1,2,3,4: @apply p-3;\n 'less-mixins', // less: .mixin();\n 'declarations', // css: display: block;\n\n //! block rules\n { type: 'rule', selector: blockRuleRegex }, // css: &::after {}\n 'rules', // css: child-component {}\n\n //! blocks nested\n packages.sass && { type: 'at-rule', name: 'at-root' }, // scss: @at-root selector { /* content */ }\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'responsive' }, // tailwind 0,1,2 : @responsive {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'variants' }, // tailwind 0,1,2 : @variants hover {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'screen' }, // tailwind 0,1,2 : @screen sm {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'variants' }, // tailwind 4: @variant dark {}\n { type: 'at-rule', hasBlock: true }, // css: @media () {}\n ),\n {\n unspecified: 'bottom',\n },\n ]);\n\nexport const order = (packages: Partial<Packages>) =>\n defineRules({\n 'order/order': orderRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const selectorPseudoClassNoUnknownRule = defineRule<\n true,\n { ignorePseudoClasses?: (string | RegExp)[] }\n>([true, { ignorePseudoClasses: ['global', 'local'] }]);\n\nexport const selectorPseudoClassNoUnknown = defineRules({\n 'selector-pseudo-class-no-unknown': selectorPseudoClassNoUnknownRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownCSS } from '~/rules/at-rule-no-unknown';\nimport { declarationBlockNoRedundantLonghandProperties } from '~/rules/declaration-block-no-redundant-longhand-properties';\nimport { functionNoUnknown } from '~/rules/function-no-unknown';\nimport { importNotationCSS } from '~/rules/import-notation';\nimport { order } from '~/rules/order';\nimport { selectorPseudoClassNoUnknown } from '~/rules/selector-pseudo-class-no-unknown';\n\nexport const configCss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard', 'stylelint-config-clean-order'],\n plugins: ['stylelint-order', 'stylelint-selector-bem-pattern'],\n rules: {\n ...atRuleNoUnknownCSS(packages),\n ...declarationBlockNoRedundantLonghandProperties,\n ...functionNoUnknown(packages),\n ...importNotationCSS(packages),\n ...order(packages),\n ...selectorPseudoClassNoUnknown,\n 'declaration-empty-line-before': null,\n },\n});\n","import { defineRule, defineRules } from '~/utils';\n\ntype PrimaryOption = string;\ninterface SecondaryOptions {\n message: string;\n}\n\nexport const dollarVariablePatternRule = defineRule<\n PrimaryOption,\n SecondaryOptions\n>([\n '^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',\n { message: 'Expected variable to be kebab-case' },\n]);\n\nexport const dollarVariablePatternSCSS = defineRules({\n 'scss/dollar-variable-pattern': dollarVariablePatternRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownSCSS } from '~/rules/at-rule-no-unknown';\nimport { dollarVariablePatternSCSS } from '~/rules/dollar-variable-pattern';\n\nexport const configScss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard-scss'],\n rules: {\n ...atRuleNoUnknownSCSS(packages),\n ...dollarVariablePatternSCSS,\n },\n});\n","import type { Config } from 'stylelint';\n\nexport const configShared = (): Config => ({\n extends: ['stylelint-config-html'],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\n\nexport const configVue = (packages: Partial<Packages>): Config => ({\n extends: [\n packages.sass\n ? 'stylelint-config-standard-vue/scss'\n : 'stylelint-config-standard-vue',\n ],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { configCss } from './configs/css';\nimport { configScss } from './configs/scss';\nimport { configShared } from './configs/shared';\nimport { configVue } from './configs/vue';\nimport { mergeConfigs } from './utils';\n\nexport default function defineConfig(\n packages?: Partial<Packages>,\n config?: Config,\n): Config {\n const packages_ = packages ?? {};\n\n return mergeConfigs(\n configShared(),\n configCss(packages_),\n packages_.sass && configScss(packages_),\n packages_.vue && configVue(packages_),\n config,\n );\n}\n"],"mappings":";AAcA,MAAa,cAIX,SACG;AAEL,MAAa,eAA+C,SAC1D;AAGF,MAAa,gBACX,GAAG,kBACA;CACH,MAAM,UAAU,cAAc,QAAQ,MAAmB,CAAC,CAAC,EAAE;AAE7D,QAAO;EACL,SAAS,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;EAC5D,WAAW,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;EAChE,SAAS,QACN,SAAQ,MAAK,EAAE,WAAW,EAAE,CAAC,CAC7B,QAAQ,MAAM,OAAO,QAAQ,IAAI,YAAY,KAAK,KAAK,MAAM;EAChE,OAAO,QAAQ,QACZ,KAAK,YAAY;GAAE,GAAG;GAAK,GAAG,OAAO;GAAO,GAC7C,EAAE,CACH;EACD,GAAG,QAAQ,QAEP,KACA,EAAE,S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AAoC,kCACrC,CAAC;;;ACAF,MAAa,aAAa,cAAyC;CACjE,SAAS,CAAC,6BAA6B,+BAA+B;CACtE,SAAS,CAAC,mBAAmB,iCAAiC;CAC9D,OAAO;EACL,GAAG,mBAAmB,SAAS;EAC/B,GAAG;EACH,GAAG,kBAAkB,SAAS;EAC9B,GAAG,kBAAkB,SAAS;EAC9B,GAAG,MAAM,SAAS;EAClB,GAAG;EACH,iCAAiC;EAClC;CACF;;;ACdD,MAAa,4BAA4B,WAGvC,CACA,0CACA,EAAE,SAAS,sCAAsC,CAClD,CAAC;AAEF,MAAa,4BAA4B,YAAY,EACnD,gCAAgC,2BACjC,CAAC;;;ACZF,MAAa,cAAc,cAAyC;CAClE,SAAS,CAAC,iCAAiC;CAC3C,OAAO;EACL,GAAG,oBAAoB,SAAS;EAChC,GAAG;EACJ;CACF;;;ACTD,MAAa,sBAA8B,EACzC,SAAS,CAAC,wBAAwB,EACnC;;;ACDD,MAAa,aAAa,cAAyC,EACjE,SAAS,CACP,SAAS,OACL,uCACA,gCACL,EACF;;;ACDD,SAAwB,aACtB,UACA,QACQ;CACR,MAAM,YAAY,YAAY,EAAE;AAEhC,QAAO,aACL,cAAc,EACd,UAAU,UAAU,EACpB,UAAU,QAAQ,WAAW,UAAU,EACvC,UAAU,OAAO,UAAU,UAAU,EACrC,OACD"}
|
|
1
|
+
{"version":3,"file":"factory-BNS_YTTh.cjs","names":[],"sources":["../src/utils/utils.ts","../src/rules/at-rule-no-unknown.ts","../src/rules/declaration-block-no-redundant-longhand-properties.ts","../src/rules/function-no-unknown.ts","../src/rules/import-notation.ts","../src/rules/order.ts","../src/rules/selector-pseudo-class-no-unknown.ts","../src/configs/css.ts","../src/rules/dollar-variable-pattern.ts","../src/configs/scss.ts","../src/configs/shared.ts","../src/configs/vue.ts","../src/factory.ts"],"sourcesContent":["import type { Config, ConfigRuleSettings } from 'stylelint';\n\n// import type Primary, Secondary from stylelint\n\ntype StringOrRegex = string | RegExp;\ntype OneOrMany<S> = S | S[];\n\nexport type Primary =\n | number\n | true\n | OneOrMany<StringOrRegex>\n | Record<string, any>;\nexport type Secondary = Record<string, any>;\n\nexport const defineRule = <\n PrimaryOption extends Primary,\n SecondaryOptions extends Secondary = object,\n>(\n rule: ConfigRuleSettings<PrimaryOption, SecondaryOptions>,\n) => rule;\n\nexport const defineRules = <TRules extends Config['rules']>(rule: TRules) =>\n rule;\n\n// clone function mergeConfigs from stylelint repository\nexport const mergeConfigs = (\n ...configsOrNull: (Config | undefined | null | false)[]\n) => {\n const configs = configsOrNull.filter((c): c is Config => !!c);\n\n return {\n plugins: [...new Set(configs.flatMap(c => c.plugins ?? []))],\n overrides: [...new Set(configs.flatMap(c => c.overrides ?? []))],\n extends: configs\n .flatMap(c => c.extends ?? [])\n .filter((item, index, arr) => arr.lastIndexOf(item) === index),\n rules: configs.reduce(\n (acc, config) => ({ ...acc, ...config.rules }),\n {} as Config['rules'],\n ),\n ...configs.reduce(\n (\n acc,\n { plugins: _p, overrides: _o, extends: _e, rules: _r, ...config },\n ) => ({ ...acc, ...config }),\n {} as Config,\n ),\n };\n};\n\nexport const isInRange = (\n version: false | number | undefined,\n ...versions: number[]\n) => typeof version === 'number' && versions.includes(version);\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreAtRulesByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return [\n // Directives\n 'tailwind',\n 'apply',\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 1:\n case 2:\n return [\n // Directives\n 'tailwind',\n 'apply',\n 'layer', // new\n\n 'variants',\n 'responsive',\n 'screen',\n ];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return [\n // Directives\n 'tailwind',\n 'layer',\n 'apply',\n 'config', // new\n ];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return [\n // Directives\n 'import',\n 'theme',\n 'source',\n 'utility',\n 'variant',\n 'custom-variant',\n 'apply',\n 'reference',\n\n // Compatibility\n 'config',\n 'plugin',\n ];\n\n default:\n return [];\n }\n};\n\nexport const atRuleNoUnknownRule = (packages: Partial<Packages>) =>\n defineRule<true, { ignoreAtRules: (string | RegExp)[] }>([\n true,\n { ignoreAtRules: getIgnoreAtRulesByTailwindVersion(packages.tailwind) },\n ]);\n\nexport const atRuleNoUnknownCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n\nexport const atRuleNoUnknownSCSS = (packages: Partial<Packages>) =>\n defineRules({\n 'at-rule-no-unknown': null,\n 'scss/at-rule-no-unknown': atRuleNoUnknownRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const declarationBlockNoRedundantLonghandPropertiesRule = defineRule<\n true,\n { ignoreShorthands?: (string | RegExp)[] }\n>([true, { ignoreShorthands: ['grid-template'] }]);\n\nexport const declarationBlockNoRedundantLonghandProperties = defineRules({\n 'declaration-block-no-redundant-longhand-properties':\n declarationBlockNoRedundantLonghandPropertiesRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules } from '~/utils';\n\nconst getIgnoreFunctionsByTailwindVersion = (\n tailwindVersion: false | number | undefined,\n) => {\n switch (tailwindVersion) {\n // https://tailwindcss-v0.netlify.app//docs/functions-and-directives\n case 0:\n return ['config'];\n\n // https://v1.tailwindcss.com/docs/functions-and-directives\n case 1:\n return ['theme'];\n\n // https://v2.tailwindcss.com/docs/functions-and-directives\n case 2:\n return ['screen', 'theme'];\n\n // https://v3.tailwindcss.com/docs/functions-and-directives\n case 3:\n return ['theme', 'screen'];\n\n // https://tailwindcss.com/docs/functions-and-directives\n case 4:\n return ['--alpha', '--spacing', 'theme'];\n\n default:\n return [];\n }\n};\n\nconst sassFunctionRegex = /^(list|math|color)\\..+/;\nconst getIgnoreFunctions = (packages: Partial<Packages>) => [\n // https://tailwindcss.com\n ...getIgnoreFunctionsByTailwindVersion(packages.tailwind),\n\n // https://sass-lang.com/documentation/modules/list\n // https://sass-lang.com/documentation/modules/math\n // https://sass-lang.com/documentation/modules/color\n ...(packages.sass //\n ? [sassFunctionRegex]\n : []),\n\n // https://vuejs.org/api/sfc-css-features.html#v-bind-in-css\n ...(packages.vue //\n ? ['v-bind']\n : []),\n];\n\nexport function functionNoUnknownRule(packages: Partial<Packages>) {\n return defineRule<true, { ignoreFunctions: (string | RegExp)[] }>([\n true,\n { ignoreFunctions: getIgnoreFunctions(packages) },\n ]);\n}\n\nexport const functionNoUnknown = (packages: Partial<Packages>) =>\n defineRules({\n 'function-no-unknown': functionNoUnknownRule(packages),\n });\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRules, isInRange } from '~/utils';\n\nexport const importNotationCSS = (packages: Partial<Packages>) =>\n defineRules(\n isInRange(packages.tailwind, 4) //\n ? { 'import-notation': null }\n : {},\n );\n","import type { Packages } from '@culur/utils-packages';\nimport { defineRule, defineRules, isInRange } from '~/utils';\n\n// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md#options\n\ntype Keyword =\n | 'custom-properties' /**/ // Custom properties (e.g. --property: 10px;)\n | 'dollar-variables' /***/ // Dollar variables (e.g. $variable)\n | 'at-variables' /*******/ // At-variables (e.g. @variable available in Less syntax)\n | 'declarations' /*******/ // CSS declarations (e.g. display: block)\n | 'rules' /**************/ // Nested rules (e.g. a { span {} })\n | 'at-rules' /***********/ // Nested at-rules (e.g. div { @media () {} })\n | 'less-mixins'; /*******/ // Mixins in Less syntax (e.g. .mixin();)\n\ninterface AtRule {\n type: 'at-rule';\n name?: string;\n parameter?: string | RegExp;\n hasBlock?: boolean;\n}\n\ninterface Rule {\n type: 'rule';\n selector?: string | RegExp;\n name?: string;\n}\n\ntype PrimaryOption = Array<Keyword | AtRule | Rule>;\ninterface SecondaryOptions {\n unspecified?: 'top' | 'bottom' | 'ignore';\n}\n\nconst definePrimaryOption = (...options: (PrimaryOption[number] | false | undefined)[]) =>\n options.filter((option): option is PrimaryOption[number] => !!option);\n\nconst blockRuleRegex = /^&::[\\w-]+/;\n\nexport const orderRule = (packages: Partial<Packages>) =>\n defineRule<PrimaryOption, SecondaryOptions>([\n definePrimaryOption(\n //! import\n packages.sass /**********************************/ && { type: 'at-rule', name: 'use' }, // scss: @use 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'forward' }, // scss: @forward 'path/path';\n packages.sass /**********************************/ && { type: 'at-rule', name: 'import' }, // scss: @import 'path/path';\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'import' }, // tailwind 4: @import \"tailwindcss\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'source' }, // tailwind 4: @source \"../node_modules/@culur/ui-lib\";\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'reference' }, // tailwind 4: @reference \"../../app.css\";\n\n //! root\n isInRange(packages.tailwind, 0, 1, 2, 3) /*******/ && { type: 'at-rule', name: 'tailwind' }, // tailwind 0,1,2,3 : @tailwind base;\n isInRange(packages.tailwind, 3, 4) /*************/ && { type: 'at-rule', name: 'config' }, // tailwind 3,4: @config 'tailwind.custom.config.js'\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'plugin' }, // tailwind 4: @plugin '@tailwindcss/typography'\n isInRange(packages.tailwind, 1, 2, 3) /**********/ && { type: 'at-rule', name: 'layer' }, // tailwind 1,2,3 : @layer base {}\n\n //! variables\n 'dollar-variables', // css: $variable: 10px;\n 'at-variables', // css: @variable: 10px;\n { type: 'at-rule', hasBlock: false }, // css: @variable: 10px;\n 'custom-properties', // css: --property: 10px;\n\n //! tailwind\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'theme' }, // tailwind 4: @theme {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'custom-variant' }, // tailwind 4: @custom-variant pointer-coarse (@media (pointer: coarse));\n\n //! functions, methods\n packages.sass /**********************************/ && { type: 'at-rule', name: 'function' }, // scss: @function sum() {}\n packages.sass /**********************************/ && { type: 'at-rule', name: 'mixin' }, // scss: @mixin mixin-name {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'utility' }, // tailwind 4: @utility tab-4 { tab-size: 4; }\n\n //! declarations\n packages.sass /**********************************/ && { type: 'at-rule', name: 'extend' }, // scss: @extend .class-name;\n packages.sass /**********************************/ && { type: 'at-rule', name: 'include' }, // scss: @include mixin-name;\n isInRange(packages.tailwind, 0, 1, 2, 3, 4) /****/ && { type: 'at-rule', name: 'apply' }, // tailwind 0,1,2,3,4: @apply p-3;\n 'less-mixins', // less: .mixin();\n 'declarations', // css: display: block;\n\n //! block rules\n { type: 'rule', selector: blockRuleRegex }, // css: &::after {}\n 'rules', // css: child-component {}\n\n //! blocks nested\n packages.sass && { type: 'at-rule', name: 'at-root' }, // scss: @at-root selector { /* content */ }\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'responsive' }, // tailwind 0,1,2 : @responsive {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'variants' }, // tailwind 0,1,2 : @variants hover {}\n isInRange(packages.tailwind, 0, 1, 2) /**********/ && { type: 'at-rule', name: 'screen' }, // tailwind 0,1,2 : @screen sm {}\n isInRange(packages.tailwind, 4) /****************/ && { type: 'at-rule', name: 'variants' }, // tailwind 4: @variant dark {}\n { type: 'at-rule', hasBlock: true }, // css: @media () {}\n ),\n {\n unspecified: 'bottom',\n },\n ]);\n\nexport const order = (packages: Partial<Packages>) =>\n defineRules({\n 'order/order': orderRule(packages),\n });\n","import { defineRule, defineRules } from '~/utils';\n\nexport const selectorPseudoClassNoUnknownRule = defineRule<\n true,\n { ignorePseudoClasses?: (string | RegExp)[] }\n>([true, { ignorePseudoClasses: ['global', 'local'] }]);\n\nexport const selectorPseudoClassNoUnknown = defineRules({\n 'selector-pseudo-class-no-unknown': selectorPseudoClassNoUnknownRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownCSS } from '~/rules/at-rule-no-unknown';\nimport { declarationBlockNoRedundantLonghandProperties } from '~/rules/declaration-block-no-redundant-longhand-properties';\nimport { functionNoUnknown } from '~/rules/function-no-unknown';\nimport { importNotationCSS } from '~/rules/import-notation';\nimport { order } from '~/rules/order';\nimport { selectorPseudoClassNoUnknown } from '~/rules/selector-pseudo-class-no-unknown';\n\nexport const configCss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard', 'stylelint-config-clean-order'],\n plugins: ['stylelint-order', 'stylelint-selector-bem-pattern'],\n rules: {\n ...atRuleNoUnknownCSS(packages),\n ...declarationBlockNoRedundantLonghandProperties,\n ...functionNoUnknown(packages),\n ...importNotationCSS(packages),\n ...order(packages),\n ...selectorPseudoClassNoUnknown,\n 'declaration-empty-line-before': null,\n },\n});\n","import { defineRule, defineRules } from '~/utils';\n\ntype PrimaryOption = string;\ninterface SecondaryOptions {\n message: string;\n}\n\nexport const dollarVariablePatternRule = defineRule<\n PrimaryOption,\n SecondaryOptions\n>([\n '^(-{0,2}?[a-z][a-z0-9]*)(-[a-z0-9]+)*$',\n { message: 'Expected variable to be kebab-case' },\n]);\n\nexport const dollarVariablePatternSCSS = defineRules({\n 'scss/dollar-variable-pattern': dollarVariablePatternRule,\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { atRuleNoUnknownSCSS } from '~/rules/at-rule-no-unknown';\nimport { dollarVariablePatternSCSS } from '~/rules/dollar-variable-pattern';\n\nexport const configScss = (packages: Partial<Packages>): Config => ({\n extends: ['stylelint-config-standard-scss'],\n rules: {\n ...atRuleNoUnknownSCSS(packages),\n ...dollarVariablePatternSCSS,\n },\n});\n","import type { Config } from 'stylelint';\n\nexport const configShared = (): Config => ({\n extends: ['stylelint-config-html'],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\n\nexport const configVue = (packages: Partial<Packages>): Config => ({\n extends: [\n packages.sass\n ? 'stylelint-config-standard-vue/scss'\n : 'stylelint-config-standard-vue',\n ],\n});\n","import type { Packages } from '@culur/utils-packages';\nimport type { Config } from 'stylelint';\nimport { configCss } from './configs/css';\nimport { configScss } from './configs/scss';\nimport { configShared } from './configs/shared';\nimport { configVue } from './configs/vue';\nimport { mergeConfigs } from './utils';\n\nexport default function defineConfig(\n packages?: Partial<Packages>,\n config?: Config,\n): Config {\n const packages_ = packages ?? {};\n\n return mergeConfigs(\n configShared(),\n configCss(packages_),\n packages_.sass && configScss(packages_),\n packages_.vue && configVue(packages_),\n config,\n );\n}\n"],"mappings":";AAcA,MAAa,cAIX,SACG;AAEL,MAAa,eAA+C,SAC1D;AAGF,MAAa,gBACX,GAAG,kBACA;CACH,MAAM,UAAU,cAAc,QAAQ,MAAmB,CAAC,CAAC,CAAC;CAE5D,OAAO;EACL,SAAS,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;EAC3D,WAAW,CAAC,GAAG,IAAI,IAAI,QAAQ,SAAQ,MAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;EAC/D,SAAS,QACN,SAAQ,MAAK,EAAE,WAAW,CAAC,CAAC,EAC5B,QAAQ,MAAM,OAAO,QAAQ,IAAI,YAAY,IAAI,MAAM,KAAK;EAC/D,OAAO,QAAQ,QACZ,KAAK,YAAY;GAAE,GAAG;GAAK,GAAG,OAAO;EAAM,IAC5C,CAAC,CACH;EACA,GAAG,QAAQ,QAEP,KACA,EAAE,SAAS,IAAI,WAAW,IAAI,SAAS,IAAI,OAAO,IAAI,GAAG,cACrD;GAAE,GAAG;GAAK,GAAG;EAAO,IAC1B,CAAC,CACH;CACF;AACF;AAEA,MAAa,aACX,SACA,GAAG,aACA,OAA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AG,kBAAkB,QAAQ;EAC7B,GAAG,kBAAkB,QAAQ;EAC7B,GAAG,MAAM,QAAQ;EACjB,GAAG;EACH,iCAAiC;CACnC;AACF;ACNA,MAAa,4BAA4B,YAAY,EACnD,gCATuC,WAGvC,CACA,0CACA,EAAE,SAAS,qCAAqC,CAClD,CAGkC,EAClC,CAAC;;;ACZD,MAAa,cAAc,cAAyC;CAClE,SAAS,CAAC,gCAAgC;CAC1C,OAAO;EACL,GAAG,oBAAoB,QAAQ;EAC/B,GAAG;CACL;AACF;;;ACTA,MAAa,sBAA8B,EACzC,SAAS,CAAC,uBAAuB,EACnC;;;ACDA,MAAa,aAAa,cAAyC,EACjE,SAAS,CACP,SAAS,OACL,uCACA,+BACN,EACF;;;ACDA,SAAwB,aACtB,UACA,QACQ;CACR,MAAM,YAAY,YAAY,CAAC;CAE/B,OAAO,aACL,aAAa,GACb,UAAU,SAAS,GACnB,UAAU,QAAQ,WAAW,SAAS,GACtC,UAAU,OAAO,UAAU,SAAS,GACpC,MACF;AACF"}
|
package/dist/factory.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const require_factory = require("./factory-
|
|
1
|
+
const require_factory = require("./factory-BNS_YTTh.cjs");
|
|
2
2
|
module.exports = require_factory.defineConfig;
|
package/dist/factory.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as defineConfig } from "./factory-
|
|
1
|
+
import { t as defineConfig } from "./factory-B33e_UAZ.mjs";
|
|
2
2
|
export { defineConfig as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_factory = require("../factory-
|
|
1
|
+
const require_factory = require("../factory-BNS_YTTh.cjs");
|
|
2
2
|
//#region src/shareable-configs/auto.ts
|
|
3
3
|
const { tailwindVersion, hasSass, hasVue } = (0, require("@culur/utils-packages").defineHasPackages)();
|
|
4
4
|
var auto_default = require_factory.defineConfig({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/auto.ts"],"sourcesContent":["import { defineHasPackages } from '@culur/utils-packages';\nimport defineConfig from '~/factory';\n\nconst { tailwindVersion, hasSass, hasVue } = defineHasPackages();\n\nexport default defineConfig({\n tailwind: tailwindVersion(),\n sass: hasSass(),\n vue: hasVue(),\n});\n"],"mappings":";;AAGA,MAAM,EAAE,iBAAiB,SAAS,YAAA,
|
|
1
|
+
{"version":3,"file":"auto.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/auto.ts"],"sourcesContent":["import { defineHasPackages } from '@culur/utils-packages';\nimport defineConfig from '~/factory';\n\nconst { tailwindVersion, hasSass, hasVue } = defineHasPackages();\n\nexport default defineConfig({\n tailwind: tailwindVersion(),\n sass: hasSass(),\n vue: hasVue(),\n});\n"],"mappings":";;AAGA,MAAM,EAAE,iBAAiB,SAAS,YAAA,kCAAA,EAAA,mBAA6B;AAE/D,IAAA,eAAeA,gBAAAA,aAAa;CAC1B,UAAU,gBAAgB;CAC1B,MAAM,QAAQ;CACd,KAAK,OAAO;AACd,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$stylelint from "stylelint";
|
|
2
|
-
|
|
3
1
|
//#region src/shareable-configs/auto.d.ts
|
|
4
|
-
declare const _default:
|
|
2
|
+
declare const _default: import("stylelint").Config;
|
|
5
3
|
//#endregion
|
|
6
4
|
export { _default as default };
|
|
7
5
|
//# sourceMappingURL=auto.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as defineConfig } from "../factory-
|
|
1
|
+
import { t as defineConfig } from "../factory-B33e_UAZ.mjs";
|
|
2
2
|
import { defineHasPackages } from "@culur/utils-packages";
|
|
3
3
|
//#region src/shareable-configs/auto.ts
|
|
4
4
|
const { tailwindVersion, hasSass, hasVue } = defineHasPackages();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auto.mjs","names":[],"sources":["../../src/shareable-configs/auto.ts"],"sourcesContent":["import { defineHasPackages } from '@culur/utils-packages';\nimport defineConfig from '~/factory';\n\nconst { tailwindVersion, hasSass, hasVue } = defineHasPackages();\n\nexport default defineConfig({\n tailwind: tailwindVersion(),\n sass: hasSass(),\n vue: hasVue(),\n});\n"],"mappings":";;;AAGA,MAAM,EAAE,iBAAiB,SAAS,WAAW,
|
|
1
|
+
{"version":3,"file":"auto.mjs","names":[],"sources":["../../src/shareable-configs/auto.ts"],"sourcesContent":["import { defineHasPackages } from '@culur/utils-packages';\nimport defineConfig from '~/factory';\n\nconst { tailwindVersion, hasSass, hasVue } = defineHasPackages();\n\nexport default defineConfig({\n tailwind: tailwindVersion(),\n sass: hasSass(),\n vue: hasVue(),\n});\n"],"mappings":";;;AAGA,MAAM,EAAE,iBAAiB,SAAS,WAAW,kBAAkB;AAE/D,IAAA,eAAe,aAAa;CAC1B,UAAU,gBAAgB;CAC1B,MAAM,QAAQ;CACd,KAAK,OAAO;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"none.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/none.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: false,\n vue: false,\n});\n"],"mappings":";AAEA,IAAA,
|
|
1
|
+
{"version":3,"file":"none.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/none.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: false,\n vue: false,\n});\n"],"mappings":";AAEA,IAAA,gDAAeA,EAAAA,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$stylelint from "stylelint";
|
|
2
|
-
|
|
3
1
|
//#region src/shareable-configs/none.d.ts
|
|
4
|
-
declare const _default:
|
|
2
|
+
declare const _default: import("stylelint").Config;
|
|
5
3
|
//#endregion
|
|
6
4
|
export { _default as default };
|
|
7
5
|
//# sourceMappingURL=none.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"none.mjs","names":[],"sources":["../../src/shareable-configs/none.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: false,\n vue: false,\n});\n"],"mappings":";;AAEA,IAAA,eAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;
|
|
1
|
+
{"version":3,"file":"none.mjs","names":[],"sources":["../../src/shareable-configs/none.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: false,\n vue: false,\n});\n"],"mappings":";;AAEA,IAAA,eAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sass-vue.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: true,\n});\n"],"mappings":";AAEA,IAAA,
|
|
1
|
+
{"version":3,"file":"sass-vue.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: true,\n});\n"],"mappings":";AAEA,IAAA,oDAAeA,EAAAA,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$stylelint from "stylelint";
|
|
2
|
-
|
|
3
1
|
//#region src/shareable-configs/sass-vue.d.ts
|
|
4
|
-
declare const _default:
|
|
2
|
+
declare const _default: import("stylelint").Config;
|
|
5
3
|
//#endregion
|
|
6
4
|
export { _default as default };
|
|
7
5
|
//# sourceMappingURL=sass-vue.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sass-vue.mjs","names":[],"sources":["../../src/shareable-configs/sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: true,\n});\n"],"mappings":";;AAEA,IAAA,mBAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;
|
|
1
|
+
{"version":3,"file":"sass-vue.mjs","names":[],"sources":["../../src/shareable-configs/sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: true,\n});\n"],"mappings":";;AAEA,IAAA,mBAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sass.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/sass.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: false,\n});\n"],"mappings":";AAEA,IAAA,
|
|
1
|
+
{"version":3,"file":"sass.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/sass.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: false,\n});\n"],"mappings":";AAEA,IAAA,gDAAeA,EAAAA,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$stylelint from "stylelint";
|
|
2
|
-
|
|
3
1
|
//#region src/shareable-configs/sass.d.ts
|
|
4
|
-
declare const _default:
|
|
2
|
+
declare const _default: import("stylelint").Config;
|
|
5
3
|
//#endregion
|
|
6
4
|
export { _default as default };
|
|
7
5
|
//# sourceMappingURL=sass.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sass.mjs","names":[],"sources":["../../src/shareable-configs/sass.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: false,\n});\n"],"mappings":";;AAEA,IAAA,eAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;
|
|
1
|
+
{"version":3,"file":"sass.mjs","names":[],"sources":["../../src/shareable-configs/sass.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: false,\n sass: true,\n vue: false,\n});\n"],"mappings":";;AAEA,IAAA,eAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind3-sass-vue.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/tailwind3-sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: 3,\n sass: true,\n vue: true,\n});\n"],"mappings":";AAEA,IAAA,
|
|
1
|
+
{"version":3,"file":"tailwind3-sass-vue.cjs","names":["defineConfig"],"sources":["../../src/shareable-configs/tailwind3-sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: 3,\n sass: true,\n vue: true,\n});\n"],"mappings":";AAEA,IAAA,8DAAeA,EAAAA,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import * as _$stylelint from "stylelint";
|
|
2
|
-
|
|
3
1
|
//#region src/shareable-configs/tailwind3-sass-vue.d.ts
|
|
4
|
-
declare const _default:
|
|
2
|
+
declare const _default: import("stylelint").Config;
|
|
5
3
|
export = _default;
|
|
6
4
|
//# sourceMappingURL=tailwind3-sass-vue.d.cts.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import * as _$stylelint from "stylelint";
|
|
2
|
-
|
|
3
1
|
//#region src/shareable-configs/tailwind3-sass-vue.d.ts
|
|
4
|
-
declare const _default:
|
|
2
|
+
declare const _default: import("stylelint").Config;
|
|
5
3
|
//#endregion
|
|
6
4
|
export { _default as default };
|
|
7
5
|
//# sourceMappingURL=tailwind3-sass-vue.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind3-sass-vue.mjs","names":[],"sources":["../../src/shareable-configs/tailwind3-sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: 3,\n sass: true,\n vue: true,\n});\n"],"mappings":";;AAEA,IAAA,6BAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;
|
|
1
|
+
{"version":3,"file":"tailwind3-sass-vue.mjs","names":[],"sources":["../../src/shareable-configs/tailwind3-sass-vue.ts"],"sourcesContent":["import defineConfig from '~/factory';\n\nexport default defineConfig({\n tailwind: 3,\n sass: true,\n vue: true,\n});\n"],"mappings":";;AAEA,IAAA,6BAAe,aAAa;CAC1B,UAAU;CACV,MAAM;CACN,KAAK;AACP,CAAC"}
|