-
Notifications
You must be signed in to change notification settings - Fork 9
Add CI workflow for linting, formatting, and type checks #144
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "env": { | ||
| "node": true, | ||
| "es2021": true | ||
| }, | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended" | ||
| ], | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "ecmaVersion": "latest", | ||
| "sourceType": "module" | ||
| }, | ||
| "plugins": ["@typescript-eslint"], | ||
| "rules": { | ||
| "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }], | ||
| "@typescript-eslint/no-explicit-any": "warn", | ||
| "no-console": "off" | ||
| }, | ||
| "ignorePatterns": ["lib/", "node_modules/", "tabs/", "functions/"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| # CI workflow for code quality checks | ||
| # Runs linting, formatting validation, and type checking | ||
|
|
||
| name: Code Quality Checks | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| lint-and-format-bot: | ||
| name: Lint & Format (Bot/Backend) | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run ESLint | ||
| run: npm run lint | ||
|
|
||
| - name: Check Prettier formatting | ||
| run: npm run format:check | ||
|
|
||
| - name: Run TypeScript type check | ||
| run: npm run typecheck | ||
|
|
||
| lint-and-format-tabs: | ||
| name: Lint & Format (Frontend/Tabs) | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
|
||
| cache: 'npm' | ||
| cache-dependency-path: tabs/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: tabs | ||
| run: npm ci | ||
|
|
||
| - name: Run ESLint | ||
| working-directory: tabs | ||
| run: npm run lint | ||
|
|
||
| - name: Check Prettier formatting | ||
| working-directory: tabs | ||
| run: npm run format:check | ||
|
|
||
| - name: Run TypeScript type check | ||
| working-directory: tabs | ||
| run: npm run typecheck | ||
|
|
||
| build-check: | ||
| name: Build Verification | ||
| runs-on: ubuntu-latest | ||
| needs: [lint-and-format-bot, lint-and-format-tabs] | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
|
||
| cache: 'npm' | ||
|
|
||
| - name: Install Bot dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Build Bot | ||
| run: npm run build | ||
|
|
||
| - name: Install Tabs dependencies | ||
| working-directory: tabs | ||
| run: npm ci | ||
|
|
||
| - name: Build Tabs | ||
| working-directory: tabs | ||
| env: | ||
| CI: false | ||
| run: npm run build | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build outputs | ||
| lib/ | ||
| build/ | ||
| dist/ | ||
|
|
||
| # Tabs (has its own prettier config) | ||
| tabs/ | ||
|
|
||
| # Other | ||
| *.min.js | ||
| *.min.css | ||
| package-lock.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build outputs | ||
| build/ | ||
|
|
||
| # Other | ||
| *.min.js | ||
| *.min.css | ||
| package-lock.json |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "tabWidth": 2, | ||
| "useTabs": false, | ||
| "semi": true, | ||
| "singleQuote": true, | ||
| "trailingComma": "all", | ||
| "bracketSpacing": true, | ||
| "arrowParens": "avoid", | ||
| "printWidth": 80 | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI workflow uses Node.js 20.x, but the package.json specifies "node": "16 || 18" in the engines field. This mismatch could lead to issues where code passes CI but fails in environments using the officially supported Node versions, or vice versa. Consider either updating the engines field to include Node 20, or changing the CI workflow to use a Node version that matches the engines specification.