Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/actions/ci-checks/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ runs:
run: pnpm build
shell: bash

- name: ESLint
run: pnpm lint --no-cache
- name: Oxlint
run: pnpm lint
shell: bash

- name: Oxfmt
run: pnpm format:check
shell: bash

- name: Typecheck
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Node CI

on:
push:
branches:
- main
- next
pull_request:
branches:
- '**'
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# eslint
.eslintcache

# Coverage directory used by tools like istanbul
coverage
.nyc_output
Expand Down Expand Up @@ -40,4 +37,4 @@ api/
.pnpm-lock.yaml

.claude
.scratch
.scratch
26 changes: 3 additions & 23 deletions .knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,22 @@
"entry": ["scripts/*.js"],
"project": ["scripts/*.js"]
},
"packages/core": {
"entry": [
"src/index.ts",
"src/actions.ts",
"src/actors/index.ts",
"src/guards.ts",
"src/dev/index.ts",
"src/graph/index.ts"
]
},
"packages/xstate-inspect": {
"entry": ["src/index.ts", "src/server.ts"]
},
"packages/xstate-store": {
"entry": ["src/index.ts"]
},
"packages/xstate-svelte": {
"typescript": "test/tsconfig.json"
}
},
"ignore": [
// used for `#is-development` conditional import
"packages/**/{true,false}.ts",
// file acts as a type test
"packages/xstate-svelte/test/interpreterAsReadable.svelte",
"docs/**",
// copy-pasted implementation from alien-signals
"packages/xstate-store/src/alien.ts",
"scripts/**"
"packages/xstate-store/src/alien.ts"
],
"ignoreDependencies": [
"synckit",
// loaded by the Oxlint JS plugin configuration
"eslint-plugin-jsdoc",
// package.json#exports aren't added as entry points, because `dist/` is .gitignored
"react",
"xstate",
"@types/ws",
// peer dependencies that may be needed but not directly imported
"@angular/compiler-cli",
"@sveltejs/vite-plugin-svelte",
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.14.0
24.16.0
14 changes: 14 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"jsdoc": false,
"tsdoc": true,
"sortPackageJson": false,
"ignorePatterns": ["pnpm-lock.yaml", "/docs"]
}
230 changes: 230 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript"],
"jsPlugins": [
{
"name": "jsdoc-js",
"specifier": "eslint-plugin-jsdoc"
}
],
"categories": {
"correctness": "off"
},
"options": {
"typeAware": true
},
"env": {
"builtin": true,
"browser": true,
"node": true
},
"ignorePatterns": [
"{docs,examples,templates}/",
"**/dist",
"**/*.test.*",
"**/*.svelte",
"scripts/jest-utils/"
],
"rules": {
"constructor-super": "error",
"for-direction": "error",
"getter-return": "error",
"jsdoc-js/no-undefined-types": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-new-native-nonconstructor": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-prototype-builtins": "error",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unexpected-multiline": "error",
"no-undef": "off",
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-array-constructor": "error",
"no-unused-expressions": "error",
"prefer-const": ["error", { "destructuring": "all" }],
"typescript/await-thenable": "error",
"typescript/ban-ts-comment": "error",
"typescript/no-array-delete": "error",
"typescript/no-base-to-string": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-duplicate-type-constituents": "error",
"typescript/no-empty-object-type": [
"error",
{
"allowInterfaces": "with-single-extends",
"allowObjectTypes": "always"
}
],
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-floating-promises": "error",
"typescript/no-for-in-array": "error",
"typescript/no-implied-eval": "error",
"typescript/no-misused-new": "error",
"typescript/no-misused-promises": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-require-imports": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-assertion": "warn",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-enum-comparison": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-unsafe-unary-minus": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/only-throw-error": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/prefer-promise-reject-errors": "error",
"typescript/require-await": "error",
"typescript/restrict-plus-operands": "error",
"typescript/restrict-template-expressions": "error",
"typescript/triple-slash-reference": "error"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
"rules": {
"constructor-super": "off",
"getter-return": "off",
"no-class-assign": "off",
"no-const-assign": "off",
"no-dupe-class-members": "off",
"no-dupe-keys": "off",
"no-func-assign": "off",
"no-import-assign": "off",
"no-new-native-nonconstructor": "off",
"no-obj-calls": "off",
"no-redeclare": "off",
"no-setter-return": "off",
"no-this-before-super": "off",
"no-unreachable": "off",
"no-unsafe-negation": "off",
"no-var": "error",
"no-with": "off",
"prefer-rest-params": "error",
"prefer-spread": "error"
}
},
{
"files": ["**/*.{js,cjs,mjs}"],
"rules": {
"no-undef": "error",
"typescript/await-thenable": "off",
"typescript/consistent-return": "off",
"typescript/consistent-type-exports": "off",
"typescript/dot-notation": "off",
"typescript/no-array-delete": "off",
"typescript/no-base-to-string": "off",
"typescript/no-confusing-void-expression": "off",
"typescript/no-deprecated": "off",
"typescript/no-duplicate-type-constituents": "off",
"typescript/no-floating-promises": "off",
"typescript/no-for-in-array": "off",
"typescript/no-implied-eval": "off",
"typescript/no-meaningless-void-operator": "off",
"typescript/no-misused-promises": "off",
"typescript/no-misused-spread": "off",
"typescript/no-mixed-enums": "off",
"typescript/no-unnecessary-boolean-literal-compare": "off",
"typescript/no-unnecessary-qualifier": "off",
"typescript/no-unnecessary-template-expression": "off",
"typescript/no-unnecessary-type-arguments": "off",
"typescript/no-unnecessary-type-assertion": "off",
"typescript/no-unnecessary-type-conversion": "off",
"typescript/no-unnecessary-type-parameters": "off",
"typescript/no-unsafe-enum-comparison": "off",
"typescript/no-unsafe-type-assertion": "off",
"typescript/no-unsafe-unary-minus": "off",
"typescript/no-useless-default-assignment": "off",
"typescript/non-nullable-type-assertion-style": "off",
"typescript/only-throw-error": "off",
"typescript/prefer-find": "off",
"typescript/prefer-includes": "off",
"typescript/prefer-nullish-coalescing": "off",
"typescript/prefer-promise-reject-errors": "off",
"typescript/prefer-readonly": "off",
"typescript/prefer-readonly-parameter-types": "off",
"typescript/prefer-reduce-type-parameter": "off",
"typescript/prefer-regexp-exec": "off",
"typescript/prefer-return-this-type": "off",
"typescript/prefer-string-starts-ends-with": "off",
"typescript/promise-function-async": "off",
"typescript/related-getter-setter-pairs": "off",
"typescript/require-array-sort-compare": "off",
"typescript/require-await": "off",
"typescript/restrict-plus-operands": "off",
"typescript/restrict-template-expressions": "off",
"typescript/return-await": "off",
"typescript/strict-boolean-expressions": "off",
"typescript/strict-void-return": "off",
"typescript/switch-exhaustiveness-check": "off",
"typescript/use-unknown-in-catch-callback-variable": "off"
}
},
{
"files": ["**/*.{js,cjs}"],
"rules": {
"typescript/no-require-imports": "off"
}
}
]
}
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

11 changes: 0 additions & 11 deletions .prettierrc

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["oxc.oxc-vscode"]
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
}
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ This is a monorepo containing XState, @xstate/store, and related packages.
- Run `pnpm test` to run the tests in all packages, only for changes that affect mulitple packages.
- Run `pnpm test:core` to only run core XState tests.
- Run `pnpm test:store` to only run @xstate/store tests.
- Run `pnpm lint` and `pnpm format:check` to check linting and formatting.
- Run `pnpm typecheck` to make sure that there are no type errors.
- Before making a PR, run `pnpm changeset` to create a changeset with a short description of the changes, and a code example if applicable. Do not include implementation details; only pertinent details for developers using the package.
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,22 @@ Please read [our code of conduct](https://github.com/statelyai/xstate/blob/main/

## Environment

- Ensure you have the latest version of Node and Yarn.
- Run `pnpm i` to install all needed dev dependencies.
<!-- runtime and package manager versions matching .node-version and package.json#packageManager -->

- Use Node 24.16.0.
- Enable Corepack and run `pnpm install`. The repository pins pnpm 9.15.9.

## Making changes

Pull requests are encouraged. If you want to add a feature or fix a bug:

<!-- contributor verification commands matching package.json#scripts -->

1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) and [clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) the [repository](https://github.com/statelyai/xstate).
1. [Create a separate branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-branches) for your changes.
1. Make your changes, and write tests that validate your change and/or fix.
1. Run `pnpm test` (for all packages) or `pnpm test:core` (for only changes to core XState).
1. Run `pnpm lint` and `pnpm format:check`.
1. Run `pnpm typecheck` to make sure that there are no type errors.
1. Create a changeset by running `pnpm changeset`. [More about changesets](https://github.com/atlassian/changesets).
1. Push your branch and open a PR 🚀
Expand Down
2 changes: 1 addition & 1 deletion ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ I also strongly encourage you to [create a pull request](https://github.com/stat

## Link to reproduction or proof-of-concept:

You can use [CodePen](codepen.io) or [CodeSandbox template](https://codesandbox.io/s/6dsws) to create a reproduction/POC.
You can use [CodePen](https://codepen.io) or [CodeSandbox template](https://codesandbox.io/s/6dsws) to create a reproduction/POC.
Loading