Skip to content

Commit

Permalink
fix(makefile): use proper typecheck (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
s0up4200 authored Nov 11, 2024
1 parent b06deb5 commit b3aa44f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ lint:
# Type check frontend code
type-check:
@echo "Type checking frontend code..."
cd web && $(PNPM) run tsc -b
cd web && $(PNPM) run build --mode=typecheck

# Preview frontend build
preview:
Expand Down
47 changes: 32 additions & 15 deletions web/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import js from "@eslint/js";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import * as tseslint from "typescript-eslint";

export default tseslint.config(
{ ignores: ['dist'] },
{ ignores: ["dist", "dev-dist"] },
js.configs.recommended,
...tseslint.configs.recommended,
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
files: ["scripts/**/*.js"],
languageOptions: {
globals: {
...globals.node,
process: true,
console: true,
},
},
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
globals: {
...globals.browser,
},
parser: tseslint.parser,
parserOptions: {
project: ["./tsconfig.app.json", "./tsconfig.node.json"],
},
},
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 },
],
},
},
)
}
);
3 changes: 1 addition & 2 deletions web/tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
"noFallthroughCasesInSwitch": true
},
"include": ["./vite.config.ts"]
}

0 comments on commit b3aa44f

Please sign in to comment.