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
5 changes: 5 additions & 0 deletions .changeset/spicy-webs-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'limited-cache': minor
---

Update devtools and repo setup to match newer standards. Includes typing updates but no functional changes.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x, latest]
node-version: [20.x, 22.x, 24.x, latest]

steps:
- uses: actions/checkout@v4.1.7
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
engine-strict=true
link-workspace-packages=true
package-manager-strict=true
provenance=true
save-dev=true
save-exact=true
verify-deps-before-run=error
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.10.0
24.6.0
14 changes: 7 additions & 7 deletions demos/vite-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.6.2",
"@testing-library/react": "^16.0.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"typescript": "^5.6.3",
"vite": "^5.4.12"
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.1",
"@types/react": "^18.3.27",
"@types/react-dom": "^18.3.7",
"@vitejs/plugin-react": "^5.1.2",
"typescript": "^5.9.3",
"vite": "^7.3.0"
}
}
1 change: 0 additions & 1 deletion demos/vite-react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ function App() {
);
}

export default App;
export { App };
2 changes: 1 addition & 1 deletion demos/vite-react-app/src/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, describe, expect, test, vitest } from 'vitest';
import { cleanup, fireEvent, render, screen, Screen } from '@testing-library/react';
import { cleanup, fireEvent, render, screen, type Screen } from '@testing-library/react';

import { App } from '../App.js';

Expand Down
6 changes: 3 additions & 3 deletions demos/vite-react-app/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import { createRoot } from 'react-dom/client';

import App from './App.js';
import { App } from './App.js';

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
Expand Down
100 changes: 74 additions & 26 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { fixupPluginRules } from '@eslint/compat';
import eslintJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintConfigReactApp from 'eslint-config-react-app';
import eslintPluginFlowtype from 'eslint-plugin-flowtype';
import eslintPluginImport from 'eslint-plugin-import';
import eslintPluginJsxA11y from 'eslint-plugin-jsx-a11y';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
import eslintPluginReactHooks from 'eslint-plugin-react-hooks';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import importPlugin from 'eslint-plugin-import';
import globals from 'globals';
import typescriptEslint from 'typescript-eslint';

const buildOutputs = [
Expand All @@ -20,7 +18,7 @@ const buildOutputs = [
];
const projectDirectoriesToIgnore = `{${buildOutputs.join(',')}}/**`;

const eslintConfig = [
export default typescriptEslint.config(
{
ignores: [
projectDirectoriesToIgnore,
Expand All @@ -31,38 +29,88 @@ const eslintConfig = [
'external-tests/*/**',
],
},

// Global settings
{
plugins: {
// These plugins are all needed for eslint-config-react-app
flowtype: fixupPluginRules(eslintPluginFlowtype),
'jsx-a11y': eslintPluginJsxA11y,
import: fixupPluginRules(eslintPluginImport),
'react-hooks': eslintPluginReactHooks,
languageOptions: {
parser: typescriptEslint.parser,
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
settings: {
react: {
version: 'detect',
react: { version: 'detect' },
'import/resolver': {
typescript: true,
node: true,
},
},
},

// Base configs for all files
eslintJs.configs.recommended,
eslintConfigPrettier,
reactRecommended,
...typescriptEslint.configs.recommended,
importPlugin.flatConfigs.recommended,

//CJS
{
files: ['**/*.{cjs,cts}'],
languageOptions: {
globals: {
...globals.node,
},
},
},

// React
{
files: ['**/*.{jsx,tsx}'],
extends: [jsxA11yPlugin.flatConfigs.recommended],
languageOptions: {
globals: {
react: 'readonly',
},
},
// We have to set things up manually for the react and react-hooks plugins to work in flat config
plugins: {
react: reactPlugin,
'react-hooks': reactHooksPlugin,
},
rules: {
...reactPlugin.configs.recommended.rules,
...reactPlugin.configs['jsx-runtime'].rules,
...reactHooksPlugin.configs.recommended.rules,
},
},

// Overrides:
// Typescript
{
files: ['**/*.{js,ts,jsx,tsx,cjs,mjs}'],
files: ['**/*.{ts,tsx,cts,mts}'],
languageOptions: {
parser: typescriptEslint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
extends: [
importPlugin.flatConfigs.typescript,
typescriptEslint.configs.strict,
typescriptEslint.configs.strictTypeChecked,
],
rules: {
...eslintConfigReactApp.rules,
...eslintConfigReactApp.overrides[0].rules,
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowNumber: true,
allowBoolean: false,
allowNullish: false,
allowAny: false,
allowRegExp: false,
},
],
},
},
];

export default eslintConfig;
// Prettier always comes last
eslintConfigPrettier,
);
68 changes: 40 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"url": "https://github.com/spautz/"
},
"engines": {
"node": "^18 || ^20 || ^22 || ^23",
"pnpm": "^9"
"node": "^20 || ^22 || ^24 || ^25",
"pnpm": ">=10.14.0 < 11"
},
"packageManager": "pnpm@9.12.2",
"packageManager": "pnpm@10.15.0+sha512.486ebc259d3e999a4e8691ce03b5cac4a71cbeca39372a9b762cb500cfdf0873e2cb16abe3d951b1ee2cf012503f027b98b6584e4df22524e0c7450d9ec7aa7b",
"type": "module",
"scripts": {
"____ HOOKS _________________________________________________________": "",
Expand Down Expand Up @@ -67,34 +67,38 @@
"typecheck": "tsc -p ./tsconfig.json --noEmit"
},
"devDependencies": {
"@arethetypeswrong/cli": "0.16.4",
"@changesets/cli": "2.27.9",
"@changesets/types": "6.0.0",
"@eslint/compat": "1.2.1",
"@size-limit/preset-small-lib": "11.1.6",
"@testing-library/jest-dom": "^6.6.2",
"@types/node": "22.7.9",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@typescript-eslint/parser": "^8.11.0",
"@vitest/coverage-v8": "2.1.3",
"@arethetypeswrong/cli": "0.18.2",
"@changesets/cli": "2.29.6",
"@changesets/types": "6.1.0",
"@eslint/js": "9.39.2",
"@size-limit/preset-small-lib": "11.2.0",
"@testing-library/jest-dom": "6.8.0",
"@types/node": "24.3.0",
"@typescript-eslint/eslint-plugin": "8.50.0",
"@typescript-eslint/parser": "8.50.0",
"@vitest/coverage-v8": "3.2.4",
"changesets-format-with-issue-links": "0.3.0",
"downlevel-dts": "0.11.0",
"eslint": "9.13.0",
"eslint-config-prettier": "9.1.0",
"eslint": "9.39.2",
"eslint-config-prettier": "10.1.8",
"eslint-config-react-app": "7.0.1",
"eslint-plugin-react": "7.37.2",
"eslint-plugin-react-hooks": "5.0.0",
"husky": "9.1.6",
"jsdom": "25.0.1",
"lint-staged": "15.2.10",
"prettier": "3.3.3",
"publint": "0.2.12",
"rimraf": "5.0.10",
"size-limit": "11.1.6",
"tsup": "8.3.0",
"typescript": "5.6.3",
"typescript-eslint": "8.11.0",
"vitest": "2.1.3",
"eslint-import-resolver-typescript": "4.4.4",
"eslint-plugin-import": "2.32.0",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "5.2.0",
"globals": "16.3.0",
"husky": "9.1.7",
"jsdom": "26.1.0",
"lint-staged": "16.1.5",
"prettier": "3.6.2",
"publint": "0.3.12",
"rimraf": "6.0.1",
"size-limit": "11.2.0",
"tsup": "8.5.0",
"typescript": "5.9.3",
"typescript-eslint": "8.50.0",
"vitest": "3.2.4",
"yalc": "1.0.0-pre.53"
},
"lint-staged": {
Expand All @@ -104,5 +108,13 @@
"*.{js,jsx,ts,tsx}": [
"eslint --max-warnings 0"
]
},
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"
],
"ignoredBuiltDependencies": [
"unrs-resolver"
]
}
}
4 changes: 3 additions & 1 deletion packages/limited-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@
"typecheck": "tsc -p ./tsconfig.json --noEmit"
},
"dependencies": {},
"devDependencies": {},
"devDependencies": {
"@types/node": "24.3.0"
},
"peerDependencies": {},
"size-limit": [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/limited-cache/src/__tests__/LimitedCache.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, beforeEach, expect, it } from 'vitest';
import { defaultOptions } from '../core/defaultOptions.js';
import { LimitedCache } from '../core/LimitedCache.js';
import { LimitedCacheInstance } from '../types.js';
import { type LimitedCacheInstance } from '../types.js';

describe('LimitedCache', () => {
it('initializes without options', () => {
Expand Down
Loading
Loading