From 0637a6f643673f3bfd7c303a4fbc5f2316da2244 Mon Sep 17 00:00:00 2001 From: Richard Laffers Date: Mon, 14 Aug 2023 23:11:27 +0200 Subject: [PATCH] feat: add support for xstate v5 XState version can be specified in ESLint config with settings.xstate.version item. Default shareable config now support xstate v5. The old v4 is supported by "all_v4" and "recommended_v4". BREAKING CHANGE: The default configs are no longer compatible with xstate v4. To continue working with xstate v4, use new shareable configs "all_v4" or "recommended_v4". --- package.json | 10 +++------- tests/lib/utils/settings.js | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 tests/lib/utils/settings.js diff --git a/package.json b/package.json index ebd96b2..46da9f7 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,7 @@ "name": "eslint-plugin-xstate", "version": "0.0.0-semantically-released", "description": "ESLint rules for XState", - "keywords": [ - "eslint", - "eslintplugin", - "eslint-plugin" - ], + "keywords": ["eslint", "eslintplugin", "eslint-plugin"], "author": "Richard Laffers", "main": "lib/index.js", "scripts": { @@ -40,10 +36,10 @@ "semantic-release": "^21.0.7" }, "peerDependencies": { - "eslint": "^7.1.0||^8.17.0" + "eslint": "^8.17.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=16.0.0" }, "license": "MIT", "repository": { diff --git a/tests/lib/utils/settings.js b/tests/lib/utils/settings.js new file mode 100644 index 0000000..2e6376c --- /dev/null +++ b/tests/lib/utils/settings.js @@ -0,0 +1,22 @@ +module.exports = { + withVersion(version, testCase) { + if (typeof testCase === 'string') { + return { + code: testCase, + settings: { + xstate: { + version, + }, + }, + } + } + return { + ...testCase, + settings: { + xstate: { + version, + }, + }, + } + }, +}