Skip to content

Commit

Permalink
Merge pull request SpaceyaTech#41 from SpaceyaTech:setup-linting-and-…
Browse files Browse the repository at this point in the history
…testing

Configure ESLint, enhance routing and error handling, and refactor tests
  • Loading branch information
tigawanna authored Dec 1, 2024
2 parents 15e2324 + 1d807a5 commit c332150
Show file tree
Hide file tree
Showing 60 changed files with 1,404 additions and 248 deletions.
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.
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

0 comments on commit c332150

Please sign in to comment.