Skip to content

Commit

Permalink
Upgrade devDependencies (#76)
Browse files Browse the repository at this point in the history
* Upgrade node and pnpm for local dev

* Upgrade devDependencies other than eslint and RTL

* Upgrade Vitest and related libraries

* Upgrade ESLint and migrate to flat config

* Upgrade remaining dependencies and fix all scripts
  • Loading branch information
spautz authored Oct 25, 2024
1 parent 4c99675 commit 6731b26
Show file tree
Hide file tree
Showing 9 changed files with 6,973 additions and 3,958 deletions.
41 changes: 0 additions & 41 deletions .eslintrc.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11.0
22.10.0
26 changes: 11 additions & 15 deletions demos/vite-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"____ FROM VITE _____________________________________________________": "",
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint . --max-warnings 0 --report-unused-disable-directives",
"lint:fix": "eslint . --max-warnings 0 --report-unused-disable-directives --fix",
"preview": "vite preview",
"____ WORKSPACE INTEGRATION _________________________________________": "",
"clean": "rimraf ./build",
Expand All @@ -21,21 +22,16 @@
},
"dependencies": {
"limited-cache": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"typescript": "^5.3.3",
"vite": "^5.1.8"
"@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.10"
}
}
1 change: 0 additions & 1 deletion demos/vite-react-app/src/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'react';
import { afterEach, describe, expect, test, vitest } from 'vitest';
import { cleanup, fireEvent, render, screen, Screen } from '@testing-library/react';

Expand Down
5 changes: 5 additions & 0 deletions demos/vite-react-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"extends": "../../tsconfig-base.typecheck.json",

"compilerOptions": {
"types": ["@testing-library/jest-dom"]
},

"include": ["*.ts", "src"]
}
68 changes: 68 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
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 typescriptEslint from 'typescript-eslint';

const buildOutputs = [
'.docusaurus',
'build',
'coverage',
'dist',
'legacy-types',
'node_modules',
'storybook-static',
];
const projectDirectoriesToIgnore = `{${buildOutputs.join(',')}}/**`;

const eslintConfig = [
{
ignores: [
projectDirectoriesToIgnore,
`demos/*/${projectDirectoriesToIgnore}`,
`docs-website/${projectDirectoriesToIgnore}`,
`packages/*/${projectDirectoriesToIgnore}`,
// Each external-test has its own eslint config, following the conventions of its framework, so they're not included
'external-tests/*/**',
],
},
{
plugins: {
// These plugins are all needed for eslint-config-react-app
flowtype: fixupPluginRules(eslintPluginFlowtype),
'jsx-a11y': eslintPluginJsxA11y,
import: fixupPluginRules(eslintPluginImport),
'react-hooks': eslintPluginReactHooks,
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
settings: {
react: {
version: 'detect',
},
},
},

eslintJs.configs.recommended,
eslintConfigPrettier,
reactRecommended,
...typescriptEslint.configs.recommended,

// Overrides:
{
files: ['**/*.{js,ts,jsx,tsx,cjs,mjs}'],
rules: {
...eslintConfigReactApp.rules,
...eslintConfigReactApp.overrides[0].rules,
'react/react-in-jsx-scope': 'off',
},
},
];

export default eslintConfig;
51 changes: 28 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
},
"engines": {
"node": "^18 || ^20 || ^22 || ^23",
"pnpm": "^8"
"pnpm": "^9"
},
"packageManager": "pnpm@8.15.1",
"packageManager": "pnpm@9.12.2",
"type": "module",
"scripts": {
"____ HOOKS _________________________________________________________": "",
Expand Down Expand Up @@ -53,8 +53,8 @@
"changelog:status:ci": "changeset status --since=origin/main --verbose",
"format": "prettier --write .",
"format:verify": "prettier --list-different .",
"lint": "eslint . --max-warnings 0",
"lint:fix": "eslint . --max-warnings 0 --fix",
"lint": "eslint . --max-warnings 0 --report-unused-disable-directives",
"lint:fix": "eslint . --max-warnings 0 --report-unused-disable-directives --fix",
"release:prep": "pnpm run changelog:status && changeset version",
"test": "pnpm run test:coverage",
"test:clean": "rimraf ./coverage",
Expand All @@ -67,29 +67,34 @@
"typecheck": "tsc -p ./tsconfig.json --noEmit"
},
"devDependencies": {
"@arethetypeswrong/cli": "0.13.8",
"@changesets/cli": "2.27.1",
"@arethetypeswrong/cli": "0.16.4",
"@changesets/cli": "2.27.9",
"@changesets/types": "6.0.0",
"@size-limit/preset-small-lib": "11.0.2",
"@testing-library/jest-dom": "6.4.2",
"@types/node": "20.11.17",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"@vitest/coverage-v8": "1.2.2",
"@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",
"changesets-format-with-issue-links": "0.3.0",
"downlevel-dts": "0.11.0",
"eslint": "8.56.0",
"eslint": "9.13.0",
"eslint-config-prettier": "9.1.0",
"husky": "9.0.10",
"jsdom": "24.0.0",
"lint-staged": "15.2.2",
"prettier": "3.2.5",
"publint": "0.2.7",
"rimraf": "5.0.5",
"size-limit": "11.0.2",
"tsup": "8.0.2",
"typescript": "5.3.3",
"vitest": "1.2.2",
"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",
"yalc": "1.0.0-pre.53"
},
"lint-staged": {
Expand Down
Loading

0 comments on commit 6731b26

Please sign in to comment.