Skip to content

Commit

Permalink
feat: add support for xstate v5
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
rlaffers committed Aug 14, 2023
1 parent 10e1e0c commit 0637a6f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down
22 changes: 22 additions & 0 deletions tests/lib/utils/settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
withVersion(version, testCase) {
if (typeof testCase === 'string') {
return {
code: testCase,
settings: {
xstate: {
version,
},
},
}
}
return {
...testCase,
settings: {
xstate: {
version,
},
},
}
},
}

0 comments on commit 0637a6f

Please sign in to comment.