From d946e252d77c3bd1ee0f40c5bb51519b03dd100b Mon Sep 17 00:00:00 2001 From: Richard Laffers Date: Wed, 18 Oct 2023 10:29:15 +0200 Subject: [PATCH] feat(no-invalid-state-props): add "output" as a valid prop on the root state --- lib/rules/no-invalid-state-props.js | 3 ++- tests/lib/rules/no-invalid-state-props.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rules/no-invalid-state-props.js b/lib/rules/no-invalid-state-props.js index 305fb56..006814e 100644 --- a/lib/rules/no-invalid-state-props.js +++ b/lib/rules/no-invalid-state-props.js @@ -55,7 +55,7 @@ const validProperties = { function isValidStateProperty(property, version) { return ( - validRootProperties[version] && + validProperties[version] && validProperties[version].includes(property.key.name) ) } @@ -100,6 +100,7 @@ const validRootProperties = { 'target', // only when type=history 'types', 'type', + 'output', ], } function isValidRootStateProperty(property, version) { diff --git a/tests/lib/rules/no-invalid-state-props.js b/tests/lib/rules/no-invalid-state-props.js index e1f8893..0bb0524 100644 --- a/tests/lib/rules/no-invalid-state-props.js +++ b/tests/lib/rules/no-invalid-state-props.js @@ -71,6 +71,7 @@ const tests = { types: {}, entry: 'log', exit: 'log', + output: { answer: 42 }, states: { idle: { type: 'parallel',