Skip to content

Commit 978f965

Browse files
committed
Upgrade all dependencies
1 parent 95c4d4d commit 978f965

File tree

6 files changed

+1571
-1099
lines changed

6 files changed

+1571
-1099
lines changed

eslint.config.ts

Lines changed: 36 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,62 @@
1-
import js from '@eslint/js';
2-
import tseslint from '@typescript-eslint/eslint-plugin';
3-
import tsparser from '@typescript-eslint/parser';
4-
// @ts-ignore - Plugin doesn't have proper ESLint 9 types yet
5-
import importPlugin from 'eslint-plugin-import';
6-
// @ts-ignore - Plugin doesn't have proper ESLint 9 types yet
7-
import react from 'eslint-plugin-react';
8-
// @ts-ignore - Plugin doesn't have proper ESLint 9 types yet
9-
import reactHooks from 'eslint-plugin-react-hooks';
10-
import prettierConfig from 'eslint-config-prettier';
1+
import js from "@eslint/js";
2+
import tseslint from "@typescript-eslint/eslint-plugin";
3+
import tsparser from "@typescript-eslint/parser";
4+
import react from "eslint-plugin-react";
5+
import reactHooks from "eslint-plugin-react-hooks";
6+
import importPlugin from "eslint-plugin-import";
7+
import type { Linter } from "eslint";
118

129
export default [
13-
// Base recommended configurations
1410
js.configs.recommended,
15-
16-
// TypeScript configuration for all TypeScript files
1711
{
18-
files: ['src/**/*.{ts,tsx}'],
12+
files: ["**/*.{js,jsx,ts,tsx}"],
1913
languageOptions: {
2014
parser: tsparser,
2115
parserOptions: {
22-
ecmaVersion: 'latest',
23-
sourceType: 'module',
24-
project: './tsconfig.json',
16+
ecmaVersion: "latest",
17+
sourceType: "module",
2518
ecmaFeatures: {
2619
jsx: true,
2720
},
2821
},
2922
globals: {
30-
// Only keep React global for JSX without explicit React imports
31-
React: 'writable',
23+
// Node.js globals
24+
process: "readonly",
25+
console: "readonly",
26+
// TypeScript/React globals
27+
React: "readonly",
28+
JSX: "readonly",
3229
},
3330
},
3431
plugins: {
35-
'@typescript-eslint': tseslint,
32+
"@typescript-eslint": tseslint as any,
33+
react: react as any,
34+
"react-hooks": reactHooks as any,
35+
import: importPlugin as any,
3636
},
3737
rules: {
38-
// Disable core ESLint rules that are covered by TypeScript
39-
'no-unused-vars': 'off',
40-
'no-undef': 'off', // TypeScript handles this
41-
42-
// Apply TypeScript ESLint recommended rules
4338
...tseslint.configs.recommended.rules,
44-
// Override specific rules for our project needs
45-
'@typescript-eslint/ban-ts-comment': 'off',
46-
'@typescript-eslint/no-explicit-any': 'warn',
47-
},
48-
},
49-
50-
// Node.js CLI configuration
51-
{
52-
files: ['src/cli/**/*.{ts,tsx}'],
53-
languageOptions: {
54-
parser: tsparser,
55-
parserOptions: {
56-
ecmaVersion: 'latest',
57-
sourceType: 'module',
58-
project: './tsconfig.json',
59-
},
60-
globals: {
61-
// Only the Node.js globals actually used in CLI files
62-
process: 'readonly',
63-
console: 'readonly',
64-
},
65-
},
66-
plugins: {
67-
'@typescript-eslint': tseslint,
68-
},
69-
rules: {
70-
'no-unused-vars': 'off',
71-
'no-undef': 'off',
72-
...tseslint.configs.recommended.rules,
73-
'@typescript-eslint/ban-ts-comment': 'off',
74-
'@typescript-eslint/no-explicit-any': 'warn',
75-
},
76-
},
77-
78-
// React configuration
79-
{
80-
files: ['src/**/*.{js,jsx,ts,tsx}'],
81-
languageOptions: {
82-
parser: tsparser,
83-
parserOptions: {
84-
ecmaVersion: 'latest',
85-
sourceType: 'module',
86-
project: './tsconfig.json',
87-
ecmaFeatures: {
88-
jsx: true,
89-
},
90-
},
91-
globals: {
92-
React: 'writable',
93-
},
94-
},
95-
plugins: {
96-
react,
97-
'react-hooks': reactHooks,
98-
import: importPlugin,
39+
...react.configs.recommended.rules,
40+
...reactHooks.configs.recommended.rules,
41+
"react/react-in-jsx-scope": "off",
42+
"react/prop-types": "off",
43+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
44+
"@typescript-eslint/explicit-function-return-type": "off",
45+
"@typescript-eslint/explicit-module-boundary-types": "off",
46+
"@typescript-eslint/no-explicit-any": "warn",
47+
// Allow regex escape characters
48+
"no-useless-escape": "off",
9949
},
10050
settings: {
10151
react: {
102-
version: 'detect',
52+
version: "detect",
10353
},
104-
'import/resolver': {
105-
typescript: {
106-
project: './tsconfig.json',
107-
},
108-
node: {
109-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
110-
},
54+
"import/resolver": {
55+
typescript: {},
11156
},
11257
},
113-
rules: {
114-
// Apply React recommended rules
115-
...react.configs.recommended.rules,
116-
...react.configs['jsx-runtime'].rules,
117-
118-
// Apply React Hooks recommended rules
119-
...reactHooks.configs.recommended.rules,
120-
121-
// Apply Import recommended rules with custom order
122-
'import/no-unresolved': 'off', // TypeScript handles this
123-
'import/order': [
124-
'error',
125-
{
126-
groups: ['builtin', 'external', 'internal'],
127-
pathGroups: [
128-
{
129-
pattern: 'react',
130-
group: 'external',
131-
position: 'before',
132-
},
133-
],
134-
pathGroupsExcludedImportTypes: ['react'],
135-
'newlines-between': 'always',
136-
alphabetize: {
137-
order: 'asc',
138-
caseInsensitive: true,
139-
},
140-
},
141-
],
142-
},
14358
},
144-
145-
// Prettier configuration (disables conflicting rules)
146-
prettierConfig,
59+
{
60+
ignores: ["lib/**", "node_modules/**", "coverage/**"],
61+
},
14762
];

jest.config.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ module.exports = {
55
roots: ["<rootDir>/test"],
66
testEnvironment: "jsdom",
77
transform: {
8-
"^.+\\.tsx?$": "ts-jest",
8+
"^.+\\.tsx?$": ["ts-jest", {
9+
tsconfig: {
10+
jsx: "react",
11+
target: "es2018",
12+
lib: ["dom", "es2018"],
13+
types: ["jest", "@testing-library/jest-dom"],
14+
esModuleInterop: true,
15+
allowSyntheticDefaultImports: true,
16+
},
17+
}],
918
},
10-
setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect"],
19+
setupFilesAfterEnv: ["@testing-library/jest-dom"],
1120
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
1221
};

0 commit comments

Comments
 (0)