@open-xchange/linter-presets 1.31.2 → 1.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.33.0] - 2026-11-10
6
+
7
+ - changed: (StyleLint) update `stylelint-config-standard-less`, `stylelint-config-recommended-less`, and `stylelint-less` to v5, which support StyleLint 18 (no unmet peer dependency for these packages anymore)
8
+ - chore: bump dependencies
9
+
10
+ ## [1.32.0] - 2026-11-06
11
+
12
+ - changed: require NodeJS v24.15
13
+ - changed: (StyleLint) require StyleLint 18 (peer dependency `stylelint` raised to `^18.0.0`, `postcss` to `^8.5.0`)
14
+ - changed: (StyleLint) `@stylistic/stylelint-plugin` 6 checks SCSS and Less files with copies of its rules in syntax namespaces (e.g. `@stylistic/scss/indentation`); the options `stylistic` and `rules` apply to all namespaces, but inline directives in SCSS and Less files need the namespaced rule names
15
+ - changed: (StyleLint) disable the new rules of `stylelint-config-recommended` 19 that report valid preprocessor syntax (`value-no-invalid` for SCSS; `selector-no-invalid`, `selector-no-unmatchable`, and `value-no-invalid` for Less)
16
+ - fixed: (StyleLint) replace rule `declaration-block-single-line-max-declarations` removed in StyleLint 18 with `@stylistic/declaration-block-single-line-max-declarations`
17
+ - fixed: (StyleLint) extend the base packages of `stylelint-config-standard-scss` and `stylelint-config-standard-less` with their rules, as these packages still extend `stylelint-config-standard` 40 which enables the removed rule
18
+
5
19
  ## [1.31.2] - 2026-11-04
6
20
 
7
21
  - chore: drop dependency `empathic`
@@ -951,7 +965,9 @@
951
965
  - added: (ESLint) project configuration (core, js, ts, json, yaml, license, directives, promises, jsdoc, stylistic)
952
966
  - added: (ESLint) environment presets (tsconfig, node, browser, jest, vitest, codecept, react, plugin)
953
967
 
954
- [Unreleased]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.31.2...main
968
+ [Unreleased]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.33.0...main
969
+ [1.33.0]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.32.0...linter-presets-1.33.0
970
+ [1.32.0]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.31.2...linter-presets-1.32.0
955
971
  [1.31.2]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.31.1...linter-presets-1.31.2
956
972
  [1.31.1]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.31.0...linter-presets-1.31.1
957
973
  [1.31.0]: https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/compare/linter-presets-1.30.7...linter-presets-1.31.0
@@ -1,5 +1,5 @@
1
1
  import { ConfigWithExtends } from "@eslint/config-helpers";
2
- import { ESLintUtils, TSESLint } from "@typescript-eslint/utils";
2
+ import { TSESLint } from "@typescript-eslint/utils";
3
3
  import "picomatch";
4
4
  import { ConfigObject, ConfigObject as ConfigObject$1, RulesConfig, RulesConfig as RulesConfig$1 } from "@eslint/core";
5
5
  import { Linter } from "eslint";
@@ -71,8 +71,11 @@ export interface ProjectOptions {
71
71
  vue?: VueOptions;
72
72
  /**
73
73
  * Additional linter rules to be added to the global configuration. Rule
74
- * names starting with `scss/` or `less/` will automatically be assigned to
75
- * the respective language override configuration.
74
+ * names starting with `scss/` or `less/` (also `@stylistic/scss/` or
75
+ * `@stylistic/less/`) will automatically be assigned to the respective
76
+ * language override configuration. Rules of the `@stylistic` plugin without
77
+ * syntax namespace (e.g. `@stylistic/indentation`) will be applied to SCSS
78
+ * and Less files too.
76
79
  */
77
80
  rules?: RuleRecord;
78
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/stylelint/index.ts"],"mappings":";;;;YAYY,aAAa,YAAY;;;;iBAOpB;;;;;;EAOf;;;;;;;EAQA;;;;;iBAQe;;;;;;EAOf;;;;;EAMA,QAAQ;;;;;iBAQO;;;;;EAMf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;EAKA,YAAY;;;;EAKZ,MAAM;;;;;;EAON,QAAQ;;;;;;;;;;;;;wBAgBM,aAAa,SAAS,iBAAiB"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/stylelint/index.ts"],"mappings":";;;;YAcY,aAAa,YAAY;;;;iBAOpB;;;;;;EAOf;;;;;;;EAQA;;;;;iBAQe;;;;;;EAOf;;;;;EAMA,QAAQ;;;;;iBAQO;;;;;EAMf;;;;;EAMA;;;;;EAMA;;;;;EAMA;;;;EAKA,YAAY;;;;EAKZ,MAAM;;;;;;;;;EAUN,QAAQ;;;;;;;;;;;;;wBAmDM,aAAa,SAAS,iBAAiB"}
@@ -1,5 +1,7 @@
1
1
  import { t as PathResolver } from "../resolver-COtuVv5w.mjs";
2
2
  import { fileURLToPath } from "node:url";
3
+ import standardScssConfig from "stylelint-config-standard-scss";
4
+ import { rules } from "@stylistic/stylelint-config";
3
5
  import { readFile } from "node:fs/promises";
4
6
  import stylelint from "stylelint";
5
7
  // src/stylelint/rules/license-header.ts
@@ -97,6 +99,28 @@ function resolvePackage(name) {
97
99
  return fileURLToPath(import.meta.resolve(name));
98
100
  }
99
101
  // src/stylelint/index.ts
102
+ const STYLISTIC_RULE_RE = /^@stylistic\/([^/]+)$/;
103
+ const SCSS_DISABLED_RULES = { "value-no-invalid": null };
104
+ const LESS_DISABLED_RULES = {
105
+ "selector-no-invalid": null,
106
+ "selector-no-unmatchable": null,
107
+ "value-no-invalid": null
108
+ };
109
+ /**
110
+ * Adds a namespace prefix to the names of all passed rules.
111
+ *
112
+ * @param rules
113
+ * The rule settings to be prefixed.
114
+ *
115
+ * @param prefix
116
+ * The namespace prefix for all rule names, without trailing slash.
117
+ *
118
+ * @returns
119
+ * The rule settings with prefixed rule names.
120
+ */
121
+ function prefixRules(rules, prefix) {
122
+ return Object.fromEntries(Object.entries(rules).map(([name, rule]) => [`${prefix}/${name}`, rule]));
123
+ }
100
124
  /**
101
125
  * Generates a StyleLint configuration object targeting the source files in the
102
126
  * entire project.
@@ -124,14 +148,38 @@ function defineConfig(options) {
124
148
  ...options.stylistic
125
149
  };
126
150
  const resolver = new PathResolver(options.root);
151
+ const standardScss = [
152
+ resolvePackage("stylelint-config-recommended-scss"),
153
+ { rules: standardScssConfig.rules },
154
+ { rules: SCSS_DISABLED_RULES }
155
+ ];
127
156
  const extensions = {
128
157
  base: [resolvePackage("stylelint-config-standard"), resolvePackage("@stylistic/stylelint-config")],
129
- scss: [resolvePackage("stylelint-config-standard-scss")],
130
- less: [resolvePackage("stylelint-config-standard-less")],
131
- vue: [resolvePackage(options.vue?.lang === "scss" ? "stylelint-config-standard-vue/scss" : "stylelint-config-standard-vue")]
158
+ scss: standardScss,
159
+ less: [resolvePackage("stylelint-config-standard-less"), { rules: LESS_DISABLED_RULES }],
160
+ vue: options.vue?.lang === "scss" ? [
161
+ resolvePackage("stylelint-config-standard-vue"),
162
+ ...standardScss,
163
+ resolvePackage("stylelint-config-recommended-vue/scss"),
164
+ { rules: prefixRules(rules, "@stylistic/scss") }
165
+ ] : [resolvePackage("stylelint-config-standard-vue")]
132
166
  };
133
167
  if (options.tailwind) extensions.base.push(resolvePackage("stylelint-config-tailwindcss"));
134
- const rules = {
168
+ const stylisticRules = {
169
+ "declaration-block-single-line-max-declarations": null,
170
+ "declaration-colon-newline-after": null,
171
+ indentation: [stylistic.indent, { ignore: ["inside-parens"] }],
172
+ "max-line-length": null,
173
+ "no-empty-first-line": null,
174
+ "selector-list-comma-newline-after": null,
175
+ "string-quotes": stylistic.quotes === "off" ? null : [stylistic.quotes, { avoidEscape: true }]
176
+ };
177
+ const customRules = Object.entries(options.rules ?? {});
178
+ for (const [name, rule] of customRules) {
179
+ const match = STYLISTIC_RULE_RE.exec(name);
180
+ if (match) stylisticRules[match[1]] = rule;
181
+ }
182
+ const rules$1 = {
135
183
  base: {
136
184
  "at-rule-empty-line-before": null,
137
185
  "color-function-notation": ["modern", { ignore: ["with-var-inside"] }],
@@ -139,7 +187,6 @@ function defineConfig(options) {
139
187
  "comment-empty-line-before": null,
140
188
  "custom-property-empty-line-before": null,
141
189
  "declaration-block-no-redundant-longhand-properties": [true, { ignoreShorthands: ["inset"] }],
142
- "declaration-block-single-line-max-declarations": null,
143
190
  "declaration-empty-line-before": null,
144
191
  "function-url-no-scheme-relative": true,
145
192
  "function-url-scheme-allowed-list": ["data"],
@@ -148,39 +195,38 @@ function defineConfig(options) {
148
195
  "no-unknown-animations": true,
149
196
  "rule-empty-line-before": null,
150
197
  "shorthand-property-no-redundant-values": [true, { ignore: ["four-into-three-edge-values"] }],
151
- "@stylistic/declaration-colon-newline-after": null,
152
- "@stylistic/indentation": [stylistic.indent, { ignore: ["inside-parens"] }],
153
- "@stylistic/max-line-length": null,
154
- "@stylistic/no-empty-first-line": null,
155
- "@stylistic/selector-list-comma-newline-after": null,
156
- "@stylistic/string-quotes": stylistic.quotes === "off" ? null : [stylistic.quotes, { avoidEscape: true }]
198
+ ...prefixRules(stylisticRules, "@stylistic")
157
199
  },
158
200
  scss: {
159
201
  "scss/dollar-variable-empty-line-before": null,
160
- "scss/double-slash-comment-empty-line-before": null
202
+ "scss/double-slash-comment-empty-line-before": null,
203
+ ...prefixRules(stylisticRules, "@stylistic/scss")
161
204
  },
162
- less: {},
163
- vue: { ...options.vue?.rules }
205
+ less: { ...prefixRules(stylisticRules, "@stylistic/less") },
206
+ vue: {
207
+ ...options.vue?.lang === "scss" ? prefixRules(stylisticRules, "@stylistic/scss") : void 0,
208
+ ...options.vue?.rules
209
+ }
164
210
  };
165
- if (options.rules) for (const [name, rule] of Object.entries(options.rules)) {
166
- const key = name.split("/")[0];
167
- (rules[key] ?? rules.base)[name] = rule;
211
+ for (const [name, rule] of customRules) if (!STYLISTIC_RULE_RE.test(name)) {
212
+ const key = name.replace(/^@stylistic\//, "").split("/")[0];
213
+ (rules$1[key] ?? rules$1.base)[name] = rule;
168
214
  }
169
215
  const overrides = [
170
216
  {
171
217
  files: ["**/*.scss"],
172
218
  extends: extensions.scss,
173
- rules: rules.scss
219
+ rules: rules$1.scss
174
220
  },
175
221
  {
176
222
  files: ["**/*.less"],
177
223
  extends: extensions.less,
178
- rules: rules.less
224
+ rules: rules$1.less
179
225
  },
180
226
  {
181
227
  files: ["**/*.vue"],
182
228
  extends: extensions.vue,
183
- rules: rules.vue
229
+ rules: rules$1.vue
184
230
  }
185
231
  ];
186
232
  if (options.license) overrides.push({
@@ -195,7 +241,7 @@ function defineConfig(options) {
195
241
  reportNeedlessDisables: true,
196
242
  reportUnscopedDisables: true,
197
243
  extends: extensions.base,
198
- rules: rules.base,
244
+ rules: rules$1.base,
199
245
  overrides
200
246
  };
201
247
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["licensePlugin"],"sources":["../../src/stylelint/rules/license-header.ts","../../src/stylelint/package-utils.ts","../../src/stylelint/index.ts"],"sourcesContent":["\nimport { readFile } from 'node:fs/promises'\nimport stylelint from 'stylelint'\n\nconst { createPlugin, utils: { ruleMessages, validateOptions, report } } = stylelint\n\n// types ======================================================================\n\ntype RuleMeta = stylelint.RuleMeta\ntype RuleFunction = stylelint.RuleBase<string, unknown>\n\n// constants ==================================================================\n\nconst ruleName = 'license-header/header'\n\nconst messages = ruleMessages(ruleName, {\n rejectedMissing: 'Missing license header',\n rejectedInvalid: 'Invalid license header',\n})\n\nconst meta: RuleMeta = {\n url: 'https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/blob/main/packages/linter-presets/docs/stylelint/README.md',\n fixable: true,\n}\n\n/**\n * Cache for the contents of license header files, keyed by file path.\n */\nconst promiseCache = new Map<string, Promise<string>>()\n\n// functions ==================================================================\n\n/**\n * Reads the license header file once per file path.\n *\n * @param path\n * The path to the license header file.\n *\n * @returns\n * A promise that will resolve with the contents of the license header file.\n */\nconst readLicenseHeaderOnce = async (path: string): Promise<string> => {\n let promise = promiseCache.get(path)\n if (!promise) {\n promise = readFile(path, 'utf-8')\n promiseCache.set(path, promise)\n }\n return await promise\n}\n\n/**\n * Implementation of the linter rule.\n *\n * @param primary\n * The path to the license header file.\n *\n * @returns\n * The callback function for the linter.\n */\nconst ruleFunc: RuleFunction = (primary) => async (root, result) => {\n\n // validate rule options\n if (!validateOptions(result, ruleName, {\n actual: primary,\n possible: path => (typeof path === 'string') && (path.length > 0),\n })) return\n\n // find the first comment in the linted file\n type Comment = Parameters<Parameters<typeof root.walkComments>[0]>[0]\n let comment: Comment | undefined\n root.walkComments(node => {\n if (node.parent === root) comment = node // must be a top-level comment\n return false // always stop iteration after first comment\n })\n\n // read the license header file\n const license = await readLicenseHeaderOnce(primary)\n\n // exit successfully if comment found and matches the license header file\n if (comment) {\n // strip block comment markers for comparison\n const stripped = license.trim().replace(/^\\/\\*|\\*\\/$/g, '').trim()\n if (comment.text === stripped) return\n }\n\n // report missing or mismatching comment\n report({\n ruleName,\n result,\n message: comment ? messages.rejectedInvalid : messages.rejectedMissing,\n node: comment ?? root,\n fix: () => { root.prepend(license) },\n })\n}\n\n// exports ====================================================================\n\nexport default createPlugin(ruleName, Object.assign(ruleFunc, { meta, ruleName, messages }))\n","import { fileURLToPath } from 'node:url'\n\n// functions ==================================================================\n\n/**\n * Resolves the name of an extension or plugin package to the absolute path of\n * its entry file, as seen from this package.\n *\n * StyleLint resolves package names in the options `extends` and `plugins`\n * relative to the configuration file of the consumer project. With the strict\n * `node_modules` layout of pnpm, the packages installed as dependencies of\n * this package are not visible from there. An absolute path circumvents this\n * resolution. StyleLint resolves nested `extends` entries of the referenced\n * package relative to that package's own location, so the transitive packages\n * do not need any special handling.\n *\n * @param name\n * The name of the package to be resolved, optionally with a subpath (e.g.\n * 'stylelint-config-standard-vue/scss').\n *\n * @returns\n * The absolute path of the entry file of the package.\n */\nexport function resolvePackage(name: string): string {\n return fileURLToPath(import.meta.resolve(name))\n}\n","\nimport type { Config } from 'stylelint'\n\nimport licensePlugin from '@/stylelint/rules/license-header.ts'\nimport { resolvePackage } from '@/stylelint/package-utils.ts'\nimport { PathResolver } from '@/utils/resolver.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for multiple rules.\n */\nexport type RuleRecord = NonNullable<Config['rules']>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for StyleLint code style rules.\n */\nexport interface StylisticOptions {\n\n /**\n * Default indentation size (number of space characters).\n *\n * @default 2\n */\n indent?: number\n\n /**\n * The quote character for string literals, or 'off' to disable the quote\n * check.\n *\n * @default 'single'\n */\n quotes?: 'single' | 'double' | 'off'\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting vue files.\n */\nexport interface VueOptions {\n\n /**\n * The language variant of `stylelint-config-standard-vue` to be used.\n *\n * @default 'css'\n */\n lang?: 'css' | 'scss'\n\n /**\n * Additional linter rules for Vue source files to be added to the global\n * configuration.\n */\n rules?: RuleRecord\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting the entire project with StyleLint.\n */\nexport interface ProjectOptions {\n\n /**\n * The URL of the StyleLint configuration file in the project root. Should\n * usually be set to `import.meta.url`.\n */\n root: string\n\n /**\n * Glob patterns for all files to be ignored by StyleLint (the patterns must\n * match files, plain directory names are not supported).\n */\n ignores?: string[]\n\n /**\n * Path to the template file containing the license header to be used in all\n * linted stylesheet files. May be a path relative to the project root.\n */\n license?: string\n\n /**\n * Whether the project uses TailwindCSS. If set, the configuration package\n * `stylelint-config-tailwindcss` will be added.\n */\n tailwind?: boolean\n\n /**\n * Configuration options for code style.\n */\n stylistic?: StylisticOptions\n\n /**\n * Options for linting styles in Vue files.\n */\n vue?: VueOptions\n\n /**\n * Additional linter rules to be added to the global configuration. Rule\n * names starting with `scss/` or `less/` will automatically be assigned to\n * the respective language override configuration.\n */\n rules?: RuleRecord\n}\n\n// functions ==================================================================\n\n/**\n * Generates a StyleLint configuration object targeting the source files in the\n * entire project.\n *\n * @param options\n * Project configuration options.\n *\n * @returns\n * The configuration object to be exported from the project's configuration\n * file (e.g. `stylelint.config.ts`).\n */\nexport function defineConfig(options: ProjectOptions): Config {\n\n const ignoreFiles: string[] = [\n 'node_modules/**/*',\n 'dist/**/*',\n 'output/**/*',\n 'coverage/**/*', // Vitest\n '.nuxt/**/*', // NuxtJS\n '.output/**/*', // NuxtJS\n ...(options.ignores ?? []),\n ]\n\n // resolve stylistic configuration options\n const stylistic: StylisticOptions = {\n indent: 2,\n quotes: 'single',\n ...options.stylistic,\n }\n\n // the resolver for relative file paths\n const resolver = new PathResolver(options.root)\n\n // custom extensions, grouped by language type (resolved to absolute paths,\n // see function 'resolvePackage' for details)\n const extensions = {\n base: [\n resolvePackage('stylelint-config-standard'),\n resolvePackage('@stylistic/stylelint-config'),\n ],\n scss: [\n resolvePackage('stylelint-config-standard-scss'),\n ],\n less: [\n resolvePackage('stylelint-config-standard-less'),\n ],\n vue: [\n resolvePackage((options.vue?.lang === 'scss') ? 'stylelint-config-standard-vue/scss' : 'stylelint-config-standard-vue'),\n ],\n } satisfies Record<string, Config['extends']>\n\n // add TailwindCSS extension if specified\n if (options.tailwind) {\n extensions.base.push(resolvePackage('stylelint-config-tailwindcss'))\n }\n\n // custom rules, grouped by language type\n const rules: Record<string, RuleRecord> = {\n base: {\n 'at-rule-empty-line-before': null,\n 'color-function-notation': ['modern', { ignore: ['with-var-inside'] }],\n 'color-hex-length': null,\n 'comment-empty-line-before': null,\n 'custom-property-empty-line-before': null,\n 'declaration-block-no-redundant-longhand-properties': [true, { ignoreShorthands: ['inset'] }], // Safari does not support 'inset'\n 'declaration-block-single-line-max-declarations': null,\n 'declaration-empty-line-before': null,\n 'function-url-no-scheme-relative': true,\n 'function-url-scheme-allowed-list': ['data'],\n 'media-feature-range-notation': 'prefix', // Safari 16.3 does not work with this notation\n 'no-descending-specificity': null,\n 'no-unknown-animations': true,\n 'rule-empty-line-before': null,\n 'shorthand-property-no-redundant-values': [true, { ignore: ['four-into-three-edge-values'] }],\n // override rules of @stylistic plugin\n '@stylistic/declaration-colon-newline-after': null,\n '@stylistic/indentation': [stylistic.indent, { ignore: ['inside-parens'] }],\n '@stylistic/max-line-length': null,\n '@stylistic/no-empty-first-line': null,\n '@stylistic/selector-list-comma-newline-after': null,\n '@stylistic/string-quotes': (stylistic.quotes === 'off') ? null : [stylistic.quotes, { avoidEscape: true }],\n },\n scss: {\n 'scss/dollar-variable-empty-line-before': null,\n 'scss/double-slash-comment-empty-line-before': null,\n },\n less: {},\n vue: {\n ...options.vue?.rules,\n },\n }\n\n // distribute custom rules by language type\n if (options.rules) {\n for (const [name, rule] of Object.entries(options.rules)) {\n const key = name.split('/')[0];\n (rules[key] ?? rules.base)[name] = rule as unknown\n }\n }\n\n // custom overrides\n const overrides: Config['overrides'] = [{\n files: ['**/*.scss'],\n extends: extensions.scss,\n rules: rules.scss,\n }, {\n files: ['**/*.less'],\n extends: extensions.less,\n rules: rules.less,\n }, {\n files: ['**/*.vue'],\n extends: extensions.vue,\n rules: rules.vue,\n }]\n\n // license header plugin\n if (options.license) {\n overrides.push({\n files: ['**/*.{css,scss,less}'], // not for Vue files\n plugins: licensePlugin,\n rules: {\n 'license-header/header': resolver.path(options.license),\n },\n })\n }\n\n return {\n\n // ignore certain files and folders\n ignoreFiles,\n\n // check inline directives\n reportDescriptionlessDisables: null,\n reportInvalidScopeDisables: true,\n reportNeedlessDisables: true,\n reportUnscopedDisables: true,\n\n // add all extensions, rules, and overrides configured above\n extends: extensions.base,\n rules: rules.base,\n overrides,\n }\n}\n"],"mappings":";;;;;AAIA,MAAM,EAAE,cAAc,OAAO,EAAE,cAAc,iBAAiB,aAAa;AAS3E,MAAM,WAAW;AAEjB,MAAM,WAAW,aAAa,UAAU;CACtC,iBAAiB;CACjB,iBAAiB;AACnB,CAAC;AAED,MAAM,OAAiB;CACrB,KAAK;CACL,SAAS;AACX;;;;AAKA,MAAM,+BAAe,IAAI,IAA6B;;;;;;;;;;AAatD,MAAM,wBAAwB,OAAO,SAAkC;CACrE,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;GACpB,OAAO,MAAM;EACf;EAAG;GACD,OAAO,CAAC,WAAW;GACnB,SAAS,WAAW;GACpB,OAAO,MAAM;EACf;EAAG;GACD,OAAO,CAAC,UAAU;GAClB,SAAS,WAAW;GACpB,OAAO,MAAM;EACf;CAAC;CAGD,IAAI,QAAQ,SACV,UAAU,KAAK;EACb,OAAO,CAAC,sBAAsB;EAC9B,SAASA;EACT,OAAO,EACL,yBAAyB,SAAS,KAAK,QAAQ,OAAO,EACxD;CACF,CAAC;CAGH,OAAO;EAGL;EAGA,+BAA+B;EAC/B,4BAA4B;EAC5B,wBAAwB;EACxB,wBAAwB;EAGxB,SAAS,WAAW;EACpB,OAAO,MAAM;EACb;CACF;AACF"}
1
+ {"version":3,"file":"index.mjs","names":["stylisticConfigRules","rules","licensePlugin"],"sources":["../../src/stylelint/rules/license-header.ts","../../src/stylelint/package-utils.ts","../../src/stylelint/index.ts"],"sourcesContent":["\nimport { readFile } from 'node:fs/promises'\nimport stylelint from 'stylelint'\n\nconst { createPlugin, utils: { ruleMessages, validateOptions, report } } = stylelint\n\n// types ======================================================================\n\ntype RuleMeta = stylelint.RuleMeta\ntype RuleFunction = stylelint.RuleBase<string, unknown>\n\n// constants ==================================================================\n\nconst ruleName = 'license-header/header'\n\nconst messages = ruleMessages(ruleName, {\n rejectedMissing: 'Missing license header',\n rejectedInvalid: 'Invalid license header',\n})\n\nconst meta: RuleMeta = {\n url: 'https://gitlab.com/openxchange/appsuite/documents/commons/plugins/-/blob/main/packages/linter-presets/docs/stylelint/README.md',\n fixable: true,\n}\n\n/**\n * Cache for the contents of license header files, keyed by file path.\n */\nconst promiseCache = new Map<string, Promise<string>>()\n\n// functions ==================================================================\n\n/**\n * Reads the license header file once per file path.\n *\n * @param path\n * The path to the license header file.\n *\n * @returns\n * A promise that will resolve with the contents of the license header file.\n */\nconst readLicenseHeaderOnce = async (path: string): Promise<string> => {\n let promise = promiseCache.get(path)\n if (!promise) {\n promise = readFile(path, 'utf-8')\n promiseCache.set(path, promise)\n }\n return await promise\n}\n\n/**\n * Implementation of the linter rule.\n *\n * @param primary\n * The path to the license header file.\n *\n * @returns\n * The callback function for the linter.\n */\nconst ruleFunc: RuleFunction = (primary) => async (root, result) => {\n\n // validate rule options\n if (!validateOptions(result, ruleName, {\n actual: primary,\n possible: path => (typeof path === 'string') && (path.length > 0),\n })) return\n\n // find the first comment in the linted file\n type Comment = Parameters<Parameters<typeof root.walkComments>[0]>[0]\n let comment: Comment | undefined\n root.walkComments(node => {\n if (node.parent === root) comment = node // must be a top-level comment\n return false // always stop iteration after first comment\n })\n\n // read the license header file\n const license = await readLicenseHeaderOnce(primary)\n\n // exit successfully if comment found and matches the license header file\n if (comment) {\n // strip block comment markers for comparison\n const stripped = license.trim().replace(/^\\/\\*|\\*\\/$/g, '').trim()\n if (comment.text === stripped) return\n }\n\n // report missing or mismatching comment\n report({\n ruleName,\n result,\n message: comment ? messages.rejectedInvalid : messages.rejectedMissing,\n node: comment ?? root,\n fix: () => { root.prepend(license) },\n })\n}\n\n// exports ====================================================================\n\nexport default createPlugin(ruleName, Object.assign(ruleFunc, { meta, ruleName, messages }))\n","import { fileURLToPath } from 'node:url'\n\n// functions ==================================================================\n\n/**\n * Resolves the name of an extension or plugin package to the absolute path of\n * its entry file, as seen from this package.\n *\n * StyleLint resolves package names in the options `extends` and `plugins`\n * relative to the configuration file of the consumer project. With the strict\n * `node_modules` layout of pnpm, the packages installed as dependencies of\n * this package are not visible from there. An absolute path circumvents this\n * resolution. StyleLint resolves nested `extends` entries of the referenced\n * package relative to that package's own location, so the transitive packages\n * do not need any special handling.\n *\n * @param name\n * The name of the package to be resolved, optionally with a subpath (e.g.\n * 'stylelint-config-standard-vue/scss').\n *\n * @returns\n * The absolute path of the entry file of the package.\n */\nexport function resolvePackage(name: string): string {\n return fileURLToPath(import.meta.resolve(name))\n}\n","\nimport type { Config } from 'stylelint'\nimport standardScssConfig from 'stylelint-config-standard-scss'\nimport { rules as stylisticConfigRules } from '@stylistic/stylelint-config'\n\nimport licensePlugin from '@/stylelint/rules/license-header.ts'\nimport { resolvePackage } from '@/stylelint/package-utils.ts'\nimport { PathResolver } from '@/utils/resolver.ts'\n\n// types ======================================================================\n\n/**\n * Configuration for multiple rules.\n */\nexport type RuleRecord = NonNullable<Config['rules']>\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for StyleLint code style rules.\n */\nexport interface StylisticOptions {\n\n /**\n * Default indentation size (number of space characters).\n *\n * @default 2\n */\n indent?: number\n\n /**\n * The quote character for string literals, or 'off' to disable the quote\n * check.\n *\n * @default 'single'\n */\n quotes?: 'single' | 'double' | 'off'\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting vue files.\n */\nexport interface VueOptions {\n\n /**\n * The language variant of `stylelint-config-standard-vue` to be used.\n *\n * @default 'css'\n */\n lang?: 'css' | 'scss'\n\n /**\n * Additional linter rules for Vue source files to be added to the global\n * configuration.\n */\n rules?: RuleRecord\n}\n\n// ----------------------------------------------------------------------------\n\n/**\n * Configuration options for linting the entire project with StyleLint.\n */\nexport interface ProjectOptions {\n\n /**\n * The URL of the StyleLint configuration file in the project root. Should\n * usually be set to `import.meta.url`.\n */\n root: string\n\n /**\n * Glob patterns for all files to be ignored by StyleLint (the patterns must\n * match files, plain directory names are not supported).\n */\n ignores?: string[]\n\n /**\n * Path to the template file containing the license header to be used in all\n * linted stylesheet files. May be a path relative to the project root.\n */\n license?: string\n\n /**\n * Whether the project uses TailwindCSS. If set, the configuration package\n * `stylelint-config-tailwindcss` will be added.\n */\n tailwind?: boolean\n\n /**\n * Configuration options for code style.\n */\n stylistic?: StylisticOptions\n\n /**\n * Options for linting styles in Vue files.\n */\n vue?: VueOptions\n\n /**\n * Additional linter rules to be added to the global configuration. Rule\n * names starting with `scss/` or `less/` (also `@stylistic/scss/` or\n * `@stylistic/less/`) will automatically be assigned to the respective\n * language override configuration. Rules of the `@stylistic` plugin without\n * syntax namespace (e.g. `@stylistic/indentation`) will be applied to SCSS\n * and Less files too.\n */\n rules?: RuleRecord\n}\n\n// constants ==================================================================\n\n// matches names of @stylistic rules without syntax namespace, and captures the short rule name\nconst STYLISTIC_RULE_RE = /^@stylistic\\/([^/]+)$/\n\n// rules of `stylelint-config-recommended` that report valid SCSS syntax\nconst SCSS_DISABLED_RULES: RuleRecord = {\n 'value-no-invalid': null, // e.g. keyword arguments in `rgba($color: #000, $alpha: 50%)`\n}\n\n// rules of `stylelint-config-recommended` that report valid Less syntax\nconst LESS_DISABLED_RULES: RuleRecord = {\n 'selector-no-invalid': null, // mixin definitions with parameters\n 'selector-no-unmatchable': null, // parent selector `&` resolving to pseudo-elements\n 'value-no-invalid': null, // variables, operations, and functions of Less\n}\n\n// helpers ====================================================================\n\n/**\n * Adds a namespace prefix to the names of all passed rules.\n *\n * @param rules\n * The rule settings to be prefixed.\n *\n * @param prefix\n * The namespace prefix for all rule names, without trailing slash.\n *\n * @returns\n * The rule settings with prefixed rule names.\n */\nfunction prefixRules(rules: RuleRecord, prefix: string): RuleRecord {\n return Object.fromEntries(Object.entries(rules).map(([name, rule]) => [`${prefix}/${name}`, rule]))\n}\n\n// functions ==================================================================\n\n/**\n * Generates a StyleLint configuration object targeting the source files in the\n * entire project.\n *\n * @param options\n * Project configuration options.\n *\n * @returns\n * The configuration object to be exported from the project's configuration\n * file (e.g. `stylelint.config.ts`).\n */\nexport function defineConfig(options: ProjectOptions): Config {\n\n const ignoreFiles: string[] = [\n 'node_modules/**/*',\n 'dist/**/*',\n 'output/**/*',\n 'coverage/**/*', // Vitest\n '.nuxt/**/*', // NuxtJS\n '.output/**/*', // NuxtJS\n ...(options.ignores ?? []),\n ]\n\n // resolve stylistic configuration options\n const stylistic: StylisticOptions = {\n indent: 2,\n quotes: 'single',\n ...options.stylistic,\n }\n\n // the resolver for relative file paths\n const resolver = new PathResolver(options.root)\n\n // The package 'stylelint-config-standard-scss' extends version 40 of\n // 'stylelint-config-standard' which enables a rule removed in StyleLint 18\n // (reported as unknown rule in every file). Until it supports StyleLint 18,\n // extend its base package and add its own rules only, the package\n // 'stylelint-config-standard' is already extended for all languages.\n // TODO: extend the package directly when it supports StyleLint 18\n const standardScss = [\n resolvePackage('stylelint-config-recommended-scss'),\n { rules: standardScssConfig.rules },\n { rules: SCSS_DISABLED_RULES },\n ]\n\n // custom extensions, grouped by language type (packages resolved to absolute\n // paths, see function 'resolvePackage' for details)\n const extensions = {\n base: [\n resolvePackage('stylelint-config-standard'),\n resolvePackage('@stylistic/stylelint-config'),\n ],\n scss: standardScss,\n less: [\n resolvePackage('stylelint-config-standard-less'),\n { rules: LESS_DISABLED_RULES },\n ],\n vue: (options.vue?.lang === 'scss') ? [\n // replaces 'stylelint-config-standard-vue/scss' which extends 'stylelint-config-standard-scss'\n // (package 'stylelint-config-recommended-vue/scss' must follow to restore the syntax 'postcss-html')\n resolvePackage('stylelint-config-standard-vue'),\n ...standardScss,\n resolvePackage('stylelint-config-recommended-vue/scss'),\n // '@stylistic/stylelint-config' sets the SCSS namespace for `*.scss` files only\n { rules: prefixRules(stylisticConfigRules, '@stylistic/scss') },\n ] : [\n resolvePackage('stylelint-config-standard-vue'),\n ],\n } satisfies Record<string, Config['extends']>\n\n // add TailwindCSS extension if specified\n if (options.tailwind) {\n extensions.base.push(resolvePackage('stylelint-config-tailwindcss'))\n }\n\n // overrides for rules of the @stylistic plugin, by short rule name\n const stylisticRules: RuleRecord = {\n 'declaration-block-single-line-max-declarations': null,\n 'declaration-colon-newline-after': null,\n indentation: [stylistic.indent, { ignore: ['inside-parens'] }],\n 'max-line-length': null,\n 'no-empty-first-line': null,\n 'selector-list-comma-newline-after': null,\n 'string-quotes': (stylistic.quotes === 'off') ? null : [stylistic.quotes, { avoidEscape: true }],\n }\n\n // custom rules of the @stylistic plugin without syntax namespace apply to all languages\n const customRules = Object.entries(options.rules ?? {})\n for (const [name, rule] of customRules) {\n const match = STYLISTIC_RULE_RE.exec(name)\n if (match) { stylisticRules[match[1]] = rule as unknown }\n }\n\n // custom rules, grouped by language type (the @stylistic plugin checks SCSS\n // and Less files with copies of its rules in syntax namespaces, e.g.\n // '@stylistic/scss/indentation', the overrides must be set for all of them)\n const rules: Record<string, RuleRecord> = {\n base: {\n 'at-rule-empty-line-before': null,\n 'color-function-notation': ['modern', { ignore: ['with-var-inside'] }],\n 'color-hex-length': null,\n 'comment-empty-line-before': null,\n 'custom-property-empty-line-before': null,\n 'declaration-block-no-redundant-longhand-properties': [true, { ignoreShorthands: ['inset'] }], // Safari does not support 'inset'\n 'declaration-empty-line-before': null,\n 'function-url-no-scheme-relative': true,\n 'function-url-scheme-allowed-list': ['data'],\n 'media-feature-range-notation': 'prefix', // Safari 16.3 does not work with this notation\n 'no-descending-specificity': null,\n 'no-unknown-animations': true,\n 'rule-empty-line-before': null,\n 'shorthand-property-no-redundant-values': [true, { ignore: ['four-into-three-edge-values'] }],\n ...prefixRules(stylisticRules, '@stylistic'),\n },\n scss: {\n 'scss/dollar-variable-empty-line-before': null,\n 'scss/double-slash-comment-empty-line-before': null,\n ...prefixRules(stylisticRules, '@stylistic/scss'),\n },\n less: {\n ...prefixRules(stylisticRules, '@stylistic/less'),\n },\n vue: {\n ...((options.vue?.lang === 'scss') ? prefixRules(stylisticRules, '@stylistic/scss') : undefined),\n ...options.vue?.rules,\n },\n }\n\n // distribute the other custom rules by language type (namespace of the rule\n // name, e.g. 'scss/' or '@stylistic/scss/')\n for (const [name, rule] of customRules) {\n if (!STYLISTIC_RULE_RE.test(name)) {\n const key = name.replace(/^@stylistic\\//, '').split('/')[0];\n (rules[key] ?? rules.base)[name] = rule as unknown\n }\n }\n\n // custom overrides\n const overrides: Config['overrides'] = [{\n files: ['**/*.scss'],\n extends: extensions.scss,\n rules: rules.scss,\n }, {\n files: ['**/*.less'],\n extends: extensions.less,\n rules: rules.less,\n }, {\n files: ['**/*.vue'],\n extends: extensions.vue,\n rules: rules.vue,\n }]\n\n // license header plugin\n if (options.license) {\n overrides.push({\n files: ['**/*.{css,scss,less}'], // not for Vue files\n plugins: licensePlugin,\n rules: {\n 'license-header/header': resolver.path(options.license),\n },\n })\n }\n\n return {\n\n // ignore certain files and folders\n ignoreFiles,\n\n // check inline directives\n reportDescriptionlessDisables: null,\n reportInvalidScopeDisables: true,\n reportNeedlessDisables: true,\n reportUnscopedDisables: true,\n\n // add all extensions, rules, and overrides configured above\n extends: extensions.base,\n rules: rules.base,\n overrides,\n }\n}\n"],"mappings":";;;;;;;AAIA,MAAM,EAAE,cAAc,OAAO,EAAE,cAAc,iBAAiB,aAAa;AAS3E,MAAM,WAAW;AAEjB,MAAM,WAAW,aAAa,UAAU;CACtC,iBAAiB;CACjB,iBAAiB;AACnB,CAAC;AAED,MAAM,OAAiB;CACrB,KAAK;CACL,SAAS;AACX;;;;AAKA,MAAM,+BAAe,IAAI,IAA6B;;;;;;;;;;AAatD,MAAM,wBAAwB,OAAO,SAAkC;CACrE,IAAI,UAAU,aAAa,IAAI,IAAI;CACnC,IAAI,CAAC,SAAS;EACZ,UAAU,SAAS,MAAM,OAAO;EAChC,aAAa,IAAI,MAAM,OAAO;CAChC;CACA,OAAO,MAAM;AACf;;;;;;;;;;AAWA,MAAM,YAA0B,YAAY,OAAO,MAAM,WAAW;CAGlE,IAAI,CAAC,gBAAgB,QAAQ,UAAU;EACrC,QAAQ;EACR,WAAU,SAAS,OAAO,SAAS,YAAc,KAAK,SAAS;CACjE,CAAC,GAAG;CAIJ,IAAI;CACJ,KAAK,cAAa,SAAQ;EACxB,IAAI,KAAK,WAAW,MAAM,UAAU;EACpC,OAAO;CACT,CAAC;CAGD,MAAM,UAAU,MAAM,sBAAsB,OAAO;CAGnD,IAAI,SAAS;EAEX,MAAM,WAAW,QAAQ,KAAK,CAAC,CAAC,QAAQ,gBAAgB,EAAE,CAAC,CAAC,KAAK;EACjE,IAAI,QAAQ,SAAS,UAAU;CACjC;CAGA,OAAO;EACL;EACA;EACA,SAAS,UAAU,SAAS,kBAAkB,SAAS;EACvD,MAAM,WAAW;EACjB,WAAW;GAAE,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,aACzB,IAAI,CAAC,kBAAkB,KAAK,IAAI,GAAG;EACjC,MAAM,MAAM,KAAK,QAAQ,iBAAiB,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;EACzD,CAACA,QAAM,QAAQA,QAAM,KAAA,CAAM,QAAQ;CACrC;CAIF,MAAM,YAAiC;EAAC;GACtC,OAAO,CAAC,WAAW;GACnB,SAAS,WAAW;GACpB,OAAOA,QAAM;EACf;EAAG;GACD,OAAO,CAAC,WAAW;GACnB,SAAS,WAAW;GACpB,OAAOA,QAAM;EACf;EAAG;GACD,OAAO,CAAC,UAAU;GAClB,SAAS,WAAW;GACpB,OAAOA,QAAM;EACf;CAAC;CAGD,IAAI,QAAQ,SACV,UAAU,KAAK;EACb,OAAO,CAAC,sBAAsB;EAC9B,SAASC;EACT,OAAO,EACL,yBAAyB,SAAS,KAAK,QAAQ,OAAO,EACxD;CACF,CAAC;CAGH,OAAO;EAGL;EAGA,+BAA+B;EAC/B,4BAA4B;EAC5B,wBAAwB;EACxB,wBAAwB;EAGxB,SAAS,WAAW;EACpB,OAAOD,QAAM;EACb;CACF;AACF"}
@@ -39,7 +39,7 @@ function defineConfig(options: ProjectOptions): Config
39
39
  | `vue` | `VueOptions` | | Configuration options for linting `<style>` elements in Vue single component files. |
40
40
  | `vue.lang` | `'css'\|'scss'` | `'css'` | The style language used in the Vue files. |
41
41
  | `vue.rules` | `RuleRecord` | `{}` | Additional linter rules for Vue files. |
42
- | `rules` | `RuleRecord` | `{}` | Additional linter rules to be added to the global configuration. Rule names starting with `scss/` or `less/` will automatically be assigned to the respective language override configuration. |
42
+ | `rules` | `RuleRecord` | `{}` | Additional linter rules to be added to the global configuration. Rule names starting with `scss/` or `less/` (also `@stylistic/scss/` or `@stylistic/less/`) will automatically be assigned to the respective language override configuration. Rules of the `@stylistic` plugin without syntax namespace (e.g. `@stylistic/indentation`) will be applied to SCSS and Less files too. |
43
43
 
44
44
  #### Built-in Ignore Globs
45
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-xchange/linter-presets",
3
- "version": "1.31.2",
3
+ "version": "1.33.0",
4
4
  "description": "Configuration presets for ESLint and StyleLint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "license": "MIT",
11
11
  "engines": {
12
- "node": ">=22.18"
12
+ "node": "^24.15.0 || >=26.0.0"
13
13
  },
14
14
  "type": "module",
15
15
  "exports": {
@@ -26,7 +26,7 @@
26
26
  "CHANGELOG.*"
27
27
  ],
28
28
  "dependencies": {
29
- "@babel/core": "^8.0.10",
29
+ "@babel/core": "^8.1.0",
30
30
  "@babel/eslint-parser": "^8.0.7",
31
31
  "@eslint-community/eslint-plugin-eslint-comments": "^4.8.1",
32
32
  "@eslint-react/eslint-plugin": "^5.28.8",
@@ -38,8 +38,8 @@
38
38
  "@eslint/markdown": "^8.0.3",
39
39
  "@stylistic/eslint-plugin": "^5.10.0",
40
40
  "@stylistic/eslint-plugin-migrate": "^4.4.1",
41
- "@stylistic/stylelint-config": "^5.0.0",
42
- "@stylistic/stylelint-plugin": "^5.3.1",
41
+ "@stylistic/stylelint-config": "^6.0.0",
42
+ "@stylistic/stylelint-plugin": "^6.0.1",
43
43
  "@types/json-schema": "^7.0.15",
44
44
  "@types/picomatch": "^4.0.3",
45
45
  "@vitest/eslint-plugin": "^1.6.28",
@@ -52,7 +52,7 @@
52
52
  "eslint-plugin-jest": "^29.17.0",
53
53
  "eslint-plugin-jest-dom": "^5.10.1",
54
54
  "eslint-plugin-jest-extended": "^3.0.1",
55
- "eslint-plugin-jsdoc": "^65.4.2",
55
+ "eslint-plugin-jsdoc": "^65.4.5",
56
56
  "eslint-plugin-jsonc": "^3.4.2",
57
57
  "eslint-plugin-jsx-a11y": "^6.10.2",
58
58
  "eslint-plugin-license-header": "^0.9.0",
@@ -64,39 +64,39 @@
64
64
  "eslint-plugin-regexp": "^3.3.3",
65
65
  "eslint-plugin-testing-library": "^7.16.2",
66
66
  "eslint-plugin-vue": "^10.12.0",
67
- "eslint-plugin-yml": "^3.9.0",
67
+ "eslint-plugin-yml": "^3.10.0",
68
68
  "globals": "^17.14.0",
69
69
  "picomatch": "^4.0.7",
70
70
  "postcss-html": "^2.0.0",
71
71
  "stylelint-config-html": "^2.0.0",
72
- "stylelint-config-recommended": "^18.0.0",
73
- "stylelint-config-recommended-less": "^4.2.1",
72
+ "stylelint-config-recommended": "^19.0.0",
73
+ "stylelint-config-recommended-less": "^5.0.0",
74
74
  "stylelint-config-recommended-scss": "^17.0.1",
75
75
  "stylelint-config-recommended-vue": "^2.0.0",
76
- "stylelint-config-standard": "^40.0.0",
77
- "stylelint-config-standard-less": "^4.1.0",
76
+ "stylelint-config-standard": "^41.0.0",
77
+ "stylelint-config-standard-less": "^5.0.0",
78
78
  "stylelint-config-standard-scss": "^17.0.0",
79
79
  "stylelint-config-standard-vue": "^2.0.0",
80
80
  "stylelint-config-tailwindcss": "^1.0.1",
81
- "stylelint-less": "^4.2.2",
81
+ "stylelint-less": "^5.0.0",
82
82
  "stylelint-scss": "^7.4.0",
83
83
  "typescript-eslint": "^8.72.1"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@jest/globals": "^30.5.2",
87
- "@open-xchange/tsconfig": "^0.2.4",
87
+ "@open-xchange/tsconfig": "^0.3.0",
88
88
  "@types/confusing-browser-globals": "^1.0.3",
89
89
  "@types/react": "^19.3.0",
90
90
  "@typescript-eslint/utils": "^8.72.1",
91
91
  "eslint": "^10.14.0",
92
92
  "jest": "^30.5.2",
93
- "stylelint": "^17.16.0",
94
- "vitest": "^5.0.5"
93
+ "stylelint": "^18.0.0",
94
+ "vitest": "^5.1.0"
95
95
  },
96
96
  "peerDependencies": {
97
97
  "eslint": "^9.35.0 || ^10.0.0",
98
- "postcss": "^8.4.0",
99
- "stylelint": "^17.1.0",
98
+ "postcss": "^8.5.0",
99
+ "stylelint": "^18.0.0",
100
100
  "typescript": "^5.9.0 || ^6.0.0 || ^7.0.0"
101
101
  },
102
102
  "peerDependenciesMeta": {