Skip to content
61 changes: 0 additions & 61 deletions .eslintrc.js

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on:
- '@rtk-query/codegen-openapi'
- '@rtk-query/graphql-request-base-query'
- '@reduxjs/rtk-codemods'
- '@reduxjs/eslint-config'
- '@reduxjs/prettier-config'
- '@reduxjs/tsconfig'
- '@reduxjs/vitest-config'
jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -28,7 +32,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn workspace ${{ inputs.package }} test
- run: yarn workspaces foreach --include "${{ inputs.package }}" run test
- run: yarn workspace ${{ inputs.package }} exec npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
117 changes: 117 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Test Configs

on: [push, pull_request, workflow_dispatch]

jobs:
test-types:
name: Test types with TypeScript ${{ matrix.ts }} on ${{ matrix.os }} and Node.js ${{ matrix.node }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
package:
[
'@reduxjs/eslint-config',
'@reduxjs/prettier-config',
'@reduxjs/vitest-config',
]
node: ['22.x']
os: [ubuntu-latest]
ts: ['5.3', '5.4', '5.5', '5.6', '5.7', '5.8']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Install TypeScript ${{ matrix.ts }}
run: yarn up typescript@${{ matrix.ts }}

- name: Run type tests
run: yarn workspace ${{ matrix.package }} run test-types

are-the-types-wrong:
name: Check if the type definitions for ${{ matrix.package }} are correct with Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
node: ['22.x']
package:
[
'@reduxjs/eslint-config',
'@reduxjs/prettier-config',
'@reduxjs/tsconfig',
'@reduxjs/vitest-config',
]
os: [ubuntu-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Run are-the-types-wrong for ${{ matrix.package }} with Node.js ${{ matrix.node }} on ${{ matrix.os }}
run: yarn workspace ${{ matrix.package }} run check-exports --format table

- name: Did we fail?
if: failure()
run: ls -R

publint:
name: Check if the package.json for ${{ matrix.package }} is correct with Node.js ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

matrix:
node: ['22.x']
package:
[
'@reduxjs/eslint-config',
'@reduxjs/prettier-config',
'@reduxjs/tsconfig',
'@reduxjs/vitest-config',
]
os: [ubuntu-latest]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'yarn'

- name: Install dependencies
run: yarn install

- name: Run publint for ${{ matrix.package }} with Node.js ${{ matrix.node }} on ${{ matrix.os }}
run: yarn workspace ${{ matrix.package }} run check-package-json

- name: Did we fail?
if: failure()
run: ls -R
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ tsconfig.vitest-temp.json

# node version manager files
.node-version
.nvmrc
.nvmrc

.eslintcache
9 changes: 5 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
**/dist/**
**/etc/**
**/temp/**
**/__testfixtures__/**
__testfixtures__/
.docusaurus/
.next/
examples/publish-ci/
.yarn/
4 changes: 0 additions & 4 deletions .prettierrc.json

This file was deleted.

4 changes: 3 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "docs",
"devDependencies": {
"@manaflair/redux-batch": "^1.0.0",
"@reduxjs/tsconfig": "workspace:^",
"@types/nanoid": "^2.1.0",
"@types/react": "^19.0.1",
"async-mutex": "^0.3.2",
Expand All @@ -12,6 +13,7 @@
"nanoid": "^3.1.23",
"next-redux-wrapper": "^7.0.5",
"redux-persist": "^6.0.0",
"rxjs": "^6.6.2"
"rxjs": "^6.6.2",
"typescript": "^5.9.3"
}
}
1 change: 1 addition & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"extends": "@reduxjs/tsconfig/base",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
Expand Down
104 changes: 104 additions & 0 deletions eslint.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import { createESLintConfig } from '@reduxjs/eslint-config'
import eslintConfigPackageJson from '@reduxjs/eslint-config/package.json' with { type: 'json' }

const basename = `${eslintConfigPackageJson.name}/overrides`

const eslintConfig = createESLintConfig([
{
name: `${basename}/global-ignores`,
ignores: [
'packages/rtk-codemods/transforms/*/__testfixtures__/',
'packages/toolkit/.size-limit.cjs',
'packages/rtk-query-codegen-openapi/lib/',
'packages/rtk-query-codegen-openapi/test/config.example.js',
'examples/publish-ci/',

// TODO: Remove this later.
'examples/',
],
},

{
name: `${basename}/main`,
files: ['**/*.?(c|m)[jt]s?(x)'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// TODO: Enable this later.
'@typescript-eslint/consistent-type-definitions': [0, 'type'],
'@typescript-eslint/prefer-nullish-coalescing': [0],
'@typescript-eslint/no-namespace': [0],
'@typescript-eslint/require-await': [0],
'@typescript-eslint/unified-signatures': [0],
'@typescript-eslint/no-unnecessary-type-parameters': [0],
'@typescript-eslint/no-invalid-void-type': [0],
'@typescript-eslint/no-unnecessary-type-arguments': [0],
'@typescript-eslint/no-confusing-void-expression': [0],
'@typescript-eslint/no-duplicate-type-constituents': [0],
'@typescript-eslint/no-redundant-type-constituents': [0],
'@typescript-eslint/no-unnecessary-type-assertion': [0],
'object-shorthand': [0],
'@typescript-eslint/no-explicit-any': [
0,
{
fixToUnknown: false,
ignoreRestArgs: false,
},
],
},
},

{
name: `${basename}/vitest-custom-matchers-declaration-file`,
files: ['packages/toolkit/src/tests/utils/CustomMatchers.d.ts'],
rules: {
'@typescript-eslint/no-empty-object-type': [
2,
{
allowInterfaces: 'with-single-extends',
allowObjectTypes: 'never',
},
],
},
},

{
name: `${basename}/no-require-imports`,
files: ['examples/query/react/graphql-codegen/src/mocks/schema.js'],
languageOptions: {
sourceType: 'commonjs',
},
rules: {
'@typescript-eslint/no-require-imports': [
2,
{
allow: ['ts-node', '\\./db(.c?[tj]s)?$'],
allowAsImport: false,
},
],
},
},

{
name: `${basename}/examples/type-portability/nodenext-cjs`,
files: ['examples/type-portability/nodenext-cjs/**/*.?(c)ts?(x)'],
languageOptions: {
sourceType: 'commonjs',
},
rules: {
'@typescript-eslint/no-namespace': [
0,
{
allowDeclarations: false,
allowDefinitionFiles: true,
},
],
},
},
])

export default eslintConfig
5 changes: 3 additions & 2 deletions examples/action-listener/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^1.8.0",
"@types/node": "^12.0.0",
"@types/node": "^24.9.1",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"clsx": "1.1.1",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-redux": "^9.1.2",
"react-scripts": "5.0.1",
"typescript": "^5.8.2"
"typescript": "^5.9.3"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -41,6 +41,7 @@
]
},
"devDependencies": {
"@reduxjs/tsconfig": "workspace:^",
"jest-watch-typeahead": "^1.1.0"
}
}
Loading
Loading