Skip to content

Commit 6ea5d10

Browse files
committed
chore: install eslint and style-migrate
1 parent fbb02e8 commit 6ea5d10

32 files changed

Lines changed: 2133 additions & 535 deletions

.devcontainer/devcontainer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@
88
"vscode": {
99
"extensions": [
1010
"rebornix.ruby",
11-
"esbenp.prettier-vscode"
11+
"esbenp.prettier-vscode",
12+
"dbaeumer.vscode-eslint"
1213
],
1314
"settings": {
1415
"editor.formatOnSave": true,
1516
"editor.defaultFormatter": "esbenp.prettier-vscode",
17+
"editor.codeActionsOnSave": {
18+
"source.fixAll.eslint": "explicit"
19+
},
20+
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
1621
"prettier.configPath": "./frontend/prettier.config.js",
1722
"ruby.format": "rubocop",
1823
"ruby.lint": { "rubocop": true },

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
# Ignore rack cache
3636
/tmp/rack-cache-*
3737

38-
3938
# Ignore frontend build output and tooling caches
4039
/frontend/dist/
4140
/frontend/node_modules/

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ lint-ruby: ## Run Ruby linter (RuboCop) - errors when issues found
6767
bundle exec rake yard:verify_public_docs
6868
@echo "Ruby linting complete!"
6969

70-
lint-js: ## Run JavaScript/Frontend linter (Prettier) - errors when issues found
70+
lint-js: ## Run JavaScript/Frontend linting (TypeScript + ESLint + Prettier) - errors when issues found
7171
@echo "Running TypeScript typecheck..."
7272
@cd frontend && npm run typecheck
73+
@echo "Running ESLint..."
74+
@cd frontend && npm run lint
7375
@echo "Running Prettier format check..."
7476
@cd frontend && npm run format:check
7577
@echo "JavaScript linting complete!"
@@ -83,6 +85,8 @@ lintfix-ruby: ## Auto-fix Ruby linting issues
8385
@echo "Ruby lintfix complete!"
8486

8587
lintfix-js: ## Auto-fix JavaScript/Frontend linting issues
88+
@echo "Running ESLint auto-fix..."
89+
@cd frontend && npm run lint:fix
8690
@echo "Running Prettier formatting..."
8791
@cd frontend && npm run format
8892
@echo "JavaScript lintfix complete!"

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Running the app directly on the host is not supported.
5353
| ----------------------- | -------------------------------------------- |
5454
| `npm run dev` | Vite dev server with hot reload (port 4001). |
5555
| `npm run build` | Build static assets into `frontend/dist/`. |
56+
| `npm run lint` | Run ESLint across the frontend workspace. |
5657
| `npm run test:run` | Unit tests (Vitest). |
5758
| `npm run test:contract` | Contract tests with MSW. |
5859

frontend/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist/
3+
.astro

frontend/eslint.config.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import reactHooks from 'eslint-plugin-react-hooks';
4+
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
5+
import tseslint from 'typescript-eslint';
6+
7+
export default tseslint.config(
8+
{
9+
ignores: ['.astro/**', 'dist/**', 'node_modules/**', 'src/api/generated/**', 'test-results/**'],
10+
},
11+
{
12+
files: ['src/**/*.{js,jsx,ts,tsx}', 'e2e/**/*.ts', './*.{js,ts}'],
13+
extends: [
14+
js.configs.recommended,
15+
...tseslint.configs.recommended,
16+
eslintPluginUnicorn.configs.recommended,
17+
],
18+
languageOptions: {
19+
ecmaVersion: 'latest',
20+
sourceType: 'module',
21+
globals: {
22+
...globals.browser,
23+
...globals.node,
24+
...globals.vitest,
25+
},
26+
},
27+
plugins: {
28+
'react-hooks': reactHooks,
29+
},
30+
rules: {
31+
'react-hooks/rules-of-hooks': 'error',
32+
'react-hooks/exhaustive-deps': 'off',
33+
'@typescript-eslint/no-explicit-any': 'off',
34+
'unicorn/filename-case': 'off',
35+
'unicorn/better-regex': 'warn',
36+
},
37+
}
38+
);

0 commit comments

Comments
 (0)