Skip to content

Commit

Permalink
Update dependencies and TypeScript configurations
Browse files Browse the repository at this point in the history
Update eslint to v9
Update typescript-eslint to v8
Remove eslint-plugin-lingui due to incompatibility with flat config
  • Loading branch information
SBence committed Sep 22, 2024
1 parent bc25adb commit baf5e81
Show file tree
Hide file tree
Showing 7 changed files with 405 additions and 1,347 deletions.
48 changes: 0 additions & 48 deletions .eslintrc.cjs

This file was deleted.

46 changes: 46 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import js from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ["dist", "src/locales"] },
{
extends: [
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
projectService: { allowDefaultProject: ["lingui.config.ts"] },
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
attributes: false,
},
},
],
},
},
eslintConfigPrettier,
);
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview",
"formatting:check": "yarn prettier --check .",
"formatting:apply": "yarn prettier --write .",
Expand All @@ -30,25 +30,24 @@
"uuid": "^10.0.0"
},
"devDependencies": {
"@eslint/js": "^9.11.0",
"@lingui/cli": "^4.11.4",
"@lingui/vite-plugin": "^4.11.4",
"@types/react": "^18.3.8",
"@types/react-dom": "^18.0.11",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitejs/plugin-react": "^4.0.0",
"babel-plugin-macros": "^3.1.0",
"eslint": "^8.57.1",
"eslint": "^9.11.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-lingui": "^0.3.0",
"eslint-plugin-react": "^7.36.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.9.0",
"postcss": "^8.4.47",
"postcss-preset-mantine": "^1.17.0",
"postcss-simple-vars": "^7.0.1",
"prettier": "^3.0.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.6.0",
"vite": "^5.4.6",
"vite-plugin-html": "^3.2.0"
}
Expand Down
24 changes: 24 additions & 0 deletions tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
29 changes: 6 additions & 23 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src", "postcss.config.js"],
"references": [{ "path": "./tsconfig.node.json" }]
"compilerOptions": { "strictNullChecks": true },
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
19 changes: 15 additions & 4 deletions tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"strictNullChecks": true
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["vite.config.ts"]
}
Loading

0 comments on commit baf5e81

Please sign in to comment.