Skip to content

init github actions #30

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .github/workflows/ci.yml
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '22.5'

- name: Install dependencies
run: npm install

- name: Run lint
run: npm run lint

- name: Run tests
run: xvfb-run -a npm test
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run openapi-ts
npx lint-staged
80 changes: 80 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import prettier from 'eslint-plugin-prettier';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: ['**/out', '**/dist', '**/*.d.ts'],
},
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier'
),
{
plugins: {
'@typescript-eslint': typescriptEslint,
prettier,
},

languageOptions: {
globals: {
console: 'readonly',
__dirname: 'readonly',
module: 'readonly',
require: 'readonly',
},

parser: tsParser,
ecmaVersion: 6,
sourceType: 'module',
},

rules: {
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'import',
format: ['camelCase', 'PascalCase'],
},
],
curly: 'warn',
'no-throw-literal': 'warn',
semi: ['error', 'always'],

quotes: [
'error',
'single',
{
avoidEscape: true,
},
],

indent: [
'error',
4,
{
SwitchCase: 1,
},
],

'no-unused-vars': 'off',
eqeqeq: ['error', 'always'],
'no-console': 'warn',
'prettier/prettier': ['error'],
},
},
];
Loading
Loading