Skip to content

Commit b0f27d4

Browse files
committed
chore: setup quality check
1 parent 159da49 commit b0f27d4

24 files changed

+2687
-1286
lines changed

.eslintrc.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
jest: true,
8+
},
9+
extends: [
10+
'eslint:recommended',
11+
'plugin:@typescript-eslint/recommended',
12+
'plugin:react/recommended',
13+
'plugin:react-hooks/recommended',
14+
'prettier',
15+
],
16+
parser: '@typescript-eslint/parser',
17+
parserOptions: {
18+
ecmaFeatures: {
19+
jsx: true,
20+
},
21+
ecmaVersion: 'latest',
22+
sourceType: 'module',
23+
},
24+
plugins: [
25+
'react',
26+
'react-hooks',
27+
'@typescript-eslint',
28+
'prettier',
29+
],
30+
rules: {
31+
// Prettier integration
32+
'prettier/prettier': 'error',
33+
34+
// TypeScript specific rules
35+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
36+
'@typescript-eslint/explicit-function-return-type': 'off',
37+
'@typescript-eslint/explicit-module-boundary-types': 'off',
38+
'@typescript-eslint/no-explicit-any': 'warn',
39+
'@typescript-eslint/no-empty-function': 'error',
40+
'@typescript-eslint/no-non-null-assertion': 'warn',
41+
42+
// React specific rules
43+
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
44+
'react/prop-types': 'off', // Using TypeScript for prop validation
45+
'react/jsx-uses-react': 'off',
46+
'react/jsx-uses-vars': 'error',
47+
'react/jsx-key': 'error',
48+
'react/jsx-no-duplicate-props': 'error',
49+
'react/jsx-no-undef': 'error',
50+
'react/no-unescaped-entities': 'warn',
51+
52+
// React Hooks rules
53+
'react-hooks/rules-of-hooks': 'error',
54+
'react-hooks/exhaustive-deps': 'warn',
55+
56+
// General code quality rules
57+
'no-console': 'warn',
58+
'no-debugger': 'error',
59+
'no-unused-vars': 'off', // Using @typescript-eslint/no-unused-vars instead
60+
'prefer-const': 'error',
61+
'no-var': 'error',
62+
'object-shorthand': 'error',
63+
'prefer-template': 'error',
64+
},
65+
settings: {
66+
react: {
67+
version: 'detect',
68+
},
69+
},
70+
ignorePatterns: [
71+
'build/',
72+
'node_modules/',
73+
'*.config.js',
74+
'public/',
75+
],
76+
};

.github/workflows/quality.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Quality Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
quality-check:
13+
name: Code Quality & Tests
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 22
21+
cache: 'npm'
22+
cache-dependency-path: '**/package-lock.json'
23+
- run: npm ci
24+
- name: 🔍 TypeScript check
25+
run: npm run type-check
26+
- name: 🧹 ESLint check
27+
run: npm run lint
28+
- name: 💅 Prettier check
29+
run: npm run format:check
30+
- name: 🧪 Run tests
31+
run: npm test -- --watchAll=false --passWithNoTests
32+
env:
33+
CI: true
34+
- name: 🏗️ Build check
35+
run: npm run build

.gitignore

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ coverage/
5050
# ESLint cache
5151
.eslintcache
5252

53+
# Prettier cache
54+
.prettiercache
55+
56+
# TypeScript cache
57+
*.tsbuildinfo
58+
59+
# Test coverage
60+
coverage/
61+
.nyc_output/
62+
63+
# Quality reports
64+
eslint-report.html
65+
prettier-report.html
66+
5367
# Optional npm cache directory
5468
.npm
5569

@@ -79,4 +93,4 @@ coverage/
7993
.serverless
8094

8195
# FuseBox cache
82-
.fusebox/
96+
.fusebox/
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"enabled": true,
3+
"name": "Lint Check",
4+
"description": "Automatically applies linting and formatting validation after Kiro makes changes to the project files",
5+
"version": "1",
6+
"when": {
7+
"type": "fileEdited",
8+
"patterns": [
9+
"src/**/*.ts",
10+
"src/**/*.tsx",
11+
"src/**/*.js",
12+
"src/**/*.jsx",
13+
"src/**/*.css",
14+
"*.js",
15+
"*.ts",
16+
"*.json"
17+
]
18+
},
19+
"then": {
20+
"type": "askAgent",
21+
"prompt": "Kiro has made changes to the project files. Please run ESLint and Prettier checks on the modified files to ensure code quality and formatting standards are maintained. Check for any linting errors, formatting issues, or TypeScript type errors that need to be addressed. If issues are found, provide specific fixes or suggestions."
22+
}
23+
}

.prettierignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
build/
6+
dist/
7+
8+
# Generated files
9+
*.min.js
10+
*.min.css
11+
12+
# Package files
13+
package-lock.json
14+
yarn.lock
15+
16+
# IDE files
17+
.vscode/
18+
.idea/
19+
20+
# OS files
21+
.DS_Store
22+
Thumbs.db
23+
24+
# Logs
25+
*.log
26+
27+
# Coverage
28+
coverage/
29+
30+
# Cache
31+
.eslintcache
32+
.cache/

.prettierrc.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
// Basic formatting
3+
semi: true,
4+
trailingComma: 'es5',
5+
singleQuote: true,
6+
printWidth: 80,
7+
tabWidth: 2,
8+
useTabs: false,
9+
10+
// JSX specific
11+
jsxSingleQuote: true,
12+
jsxBracketSameLine: false,
13+
14+
// Other options
15+
arrowParens: 'avoid',
16+
bracketSpacing: true,
17+
endOfLine: 'lf',
18+
quoteProps: 'as-needed',
19+
20+
// File-specific overrides
21+
overrides: [
22+
{
23+
files: '*.json',
24+
options: {
25+
printWidth: 120,
26+
},
27+
},
28+
{
29+
files: '*.md',
30+
options: {
31+
printWidth: 100,
32+
proseWrap: 'always',
33+
},
34+
},
35+
],
36+
};

.vscode/settings.json

Lines changed: 97 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,99 @@
11
{
2-
"kiroAgent.configureMCP": "Disabled"
2+
// Editor settings
3+
"editor.formatOnSave": true,
4+
"editor.formatOnPaste": true,
5+
"editor.formatOnType": false,
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.eslint": true,
8+
"source.organizeImports": true
9+
},
10+
"editor.defaultFormatter": "esbenp.prettier-vscode",
11+
12+
// Language-specific settings
13+
"[typescript]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode",
15+
"editor.formatOnSave": true
16+
},
17+
"[typescriptreact]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode",
19+
"editor.formatOnSave": true
20+
},
21+
"[javascript]": {
22+
"editor.defaultFormatter": "vscode.typescript-language-features",
23+
"editor.formatOnSave": true
24+
},
25+
"[javascriptreact]": {
26+
"editor.defaultFormatter": "esbenp.prettier-vscode",
27+
"editor.formatOnSave": true
28+
},
29+
"[css]": {
30+
"editor.defaultFormatter": "esbenp.prettier-vscode"
31+
},
32+
"[json]": {
33+
"editor.defaultFormatter": "vscode.json-language-features"
34+
},
35+
"[markdown]": {
36+
"editor.defaultFormatter": "esbenp.prettier-vscode",
37+
"editor.wordWrap": "on"
38+
},
39+
40+
// ESLint settings
41+
"eslint.validate": [
42+
"javascript",
43+
"javascriptreact",
44+
"typescript",
45+
"typescriptreact"
46+
],
47+
"eslint.format.enable": true,
48+
"eslint.codeActionsOnSave.mode": "problems",
49+
50+
// TypeScript settings
51+
"typescript.preferences.importModuleSpecifier": "relative",
52+
"typescript.suggest.autoImports": true,
53+
"typescript.updateImportsOnFileMove.enabled": "always",
54+
55+
// File associations
56+
"files.associations": {
57+
"*.tsx": "typescriptreact",
58+
"*.ts": "typescript"
59+
},
60+
61+
// Auto-save settings
62+
"files.autoSave": "onFocusChange",
63+
"files.trimTrailingWhitespace": true,
64+
"files.insertFinalNewline": true,
65+
"files.trimFinalNewlines": true,
66+
67+
// Search and file explorer
68+
"search.exclude": {
69+
"**/node_modules": true,
70+
"**/build": true,
71+
"**/dist": true,
72+
"**/.git": true,
73+
"**/coverage": true
74+
},
75+
"files.exclude": {
76+
"**/node_modules": true,
77+
"**/build": true,
78+
"**/dist": true,
79+
"**/.git": true,
80+
"**/coverage": true
81+
},
82+
83+
// Emmet settings
84+
"emmet.includeLanguages": {
85+
"typescript": "html",
86+
"typescriptreact": "html"
87+
},
88+
89+
// Breadcrumbs
90+
"breadcrumbs.enabled": true,
91+
92+
// Problems panel
93+
"problems.decorations.enabled": true,
94+
95+
// Git settings
96+
"git.enableSmartCommit": false,
97+
"git.confirmSync": false,
98+
"git.autofetch": true
399
}

0 commit comments

Comments
 (0)