Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure ESLint, enhance routing and error handling, and refactor tests #41

Merged
merged 5 commits into from
Dec 1, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ tsconfig.node.tsbuildinfo
/playwright-report/
/blob-report/
/playwright/.cache/
tsconfig.app.tsbuildinfo
File renamed without changes.
27 changes: 20 additions & 7 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,39 @@ import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import pluginQuery from '@tanstack/eslint-plugin-query'

export default tseslint.config(
{ ignores: ['dist'] },
...pluginQuery.configs["flat/recommended"],
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
'no-empty-pattern': 'off',
'no-empty-object-type': 'off',
'allowEmptyCatch': 'off',
'allowInterface': 'off',
'no-unused-vars': 'off',
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/no-unused-vars": "off",
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-expressions': 'off'

},

},
)
);
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint . --fix",
"format": "prettier --write --ignore-unknown src",
"page": "tsx src/scripts/scafold-pages/script.ts",
"playwright":"playwright test --ui",
"vitest": "vitest --ui",
"playwright": "playwright test --ui",
"test": "npm run vitest && npm run playwright",
"build": "tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
Expand Down Expand Up @@ -66,13 +68,16 @@
"devDependencies": {
"@eslint/js": "^9.13.0",
"@playwright/test": "^1.49.0",
"@tanstack/eslint-plugin-query": "^5.61.6",
"@tanstack/react-query-devtools": "^5.59.19",
"@tanstack/router-devtools": "^1.79.0",
"@tanstack/router-plugin": "^1.79.0",
"@types/node": "^22.10.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"@vitest/coverage-v8": "2.1.6",
"@vitest/ui": "2.1.6",
"autoprefixer": "^10.4.20",
"daisyui": "^4.12.14",
"dotenv": "^16.4.5",
Expand All @@ -90,6 +95,7 @@
"typescript": "~5.6.2",
"typescript-eslint": "^8.10.0",
"vite": "^5.4.9",
"vite-tsconfig-paths": "^5.1.0"
"vite-tsconfig-paths": "^5.1.0",
"vitest": "^2.1.6"
}
}
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dotenv.config({ path: path.resolve(__dirname, ".env") });
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
testDir: "./e2e-tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand Down
Loading