diff --git a/src/rules/use-baseline.js b/src/rules/use-baseline.js index 1107a170..e1c340e3 100644 --- a/src/rules/use-baseline.js +++ b/src/rules/use-baseline.js @@ -543,26 +543,16 @@ export default /** @satisfies {UseBaselineRuleDefinition} */ ({ }, allowPropertyValues: { type: "object", - properties: Object.fromEntries( - Array.from(properties.keys()).map(prop => { - const values = new Set([ - ...globalKeywords.keys(), - ...(propertyValues.get(prop)?.keys() ?? []), - ]); - - return [ - prop, - { - type: "array", - items: { - enum: Array.from(values), - }, - uniqueItems: true, - }, - ]; - }), - ), - additionalProperties: false, + propertyNames: { + enum: Array.from(properties.keys()), + }, + additionalProperties: { + type: "array", + items: { + type: "string", + }, + uniqueItems: true, + }, }, allowSelectors: { type: "array", diff --git a/tests/plugin/eslint.test.js b/tests/plugin/eslint.test.js index 8c60fec0..3b7d55d5 100644 --- a/tests/plugin/eslint.test.js +++ b/tests/plugin/eslint.test.js @@ -12,6 +12,7 @@ import ESLintAPI from "eslint"; const { ESLint } = ESLintAPI; import assert from "node:assert"; +import { execFileSync } from "node:child_process"; //----------------------------------------------------------------------------- // Tests @@ -71,6 +72,45 @@ describe("Plugin", () => { ); assert.strictEqual(results[0].messages[0].messageId, "emptyBlock"); }); + + it("use-baseline config should compile with limited stack space", () => { + const pluginUrl = new URL("../../src/index.js", import.meta.url) + .href; + const nodeExecutable = process.versions.bun + ? "node" + : process.execPath; + const output = execFileSync( + nodeExecutable, + [ + "--stack_size=100", + "--input-type=module", + "--eval", + ` + import css from ${JSON.stringify(pluginUrl)}; + import ESLintAPI from "eslint"; + + const { ESLint } = ESLintAPI; + const eslint = new ESLint({ + overrideConfigFile: true, + overrideConfig: { + files: ["**/*.css"], + plugins: { css }, + language: "css/css", + rules: { + "css/use-baseline": "error", + }, + }, + }); + + await eslint.calculateConfigForFile("test.css"); + process.stdout.write("ok"); + `, + ], + { encoding: "utf8", cwd: process.cwd() }, + ); + + assert.strictEqual(output, "ok"); + }); }); describe("languageOptions", () => {