Skip to content
Merged
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
10 changes: 10 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Description

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## Motivation and Context
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Commit Lint

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Lint Commit Messages
uses: wagoid/commitlint-github-action@v6
permissions:
contents: read
pull-requests: read
35 changes: 35 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Node.js CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
- run: cp exampleconfig.json config.json
- run: npm ci
- run: npx tsc

lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
- run: npm ci
- run: npm run lint
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ node_modules

# build files
*.js
*.d.ts
*.d.ts
dist
27 changes: 27 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export default {
extends: ['@commitlint/config-conventional'],
rules: {
// nice number smile (emote)
'header-max-length': [2, 'always', 64],
'body-max-line-length': [2, 'always', 72],
// including a custom type "impr".
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'impr',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
},
};
82 changes: 82 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import { defineConfig } from 'eslint/config';


export default defineConfig([
{ files: ['**/*.{ts}'], plugins: { js }, extends: ['js/recommended'] },
{ files: ['**/*.{ts}'], languageOptions: { globals: globals.browser } },
// @ts-expect-error i dont care
tseslint.configs.recommended,
{
languageOptions: {
globals: {
...globals.browser,
...Object.fromEntries(Object.entries(globals.commonjs).map(([key]) => [key, 'off'])),
},

ecmaVersion: 2025,
sourceType: 'module',

parserOptions: {
requireConfigFile: false,
babelOptions: { plugins: ['@typescript-eslint/eslint-plugin'] },
},
},

rules: {
strict: ['error', 'global'],

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

'no-eval': 'off',
'new-cap': 'off',
'no-promise-executor-return': 'off',
'no-plusplus': 'off',

'no-await-in-loop': 'off',
'no-restricted-syntax': 'off',
'no-continue': 'off',
'global-require': 'off',
'no-unused-expressions': 'off',
'one-var': 'off',
'no-void': 'off',
'no-param-reassign': 'off',
'no-global-assign': 'off',
'no-unsafe-optional-chaining': 'off',
'consistent-return': 'off',
'no-new': 'off',
'no-bitwise': 'off',
'class-methods-use-this': 'off',
'no-new-object': 'off',
'func-names': 'off',
'no-underscore-dangle': 'off',
'no-use-before-define': 'off',
'no-return-assign': 'off',
'operator-linebreak': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'array-callback-return': 'off',
'max-classes-per-file': 'off',
semi: ['error', 'always'],
'linebreak-style': ['error', 'unix'],
radix: 'off',

'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'always-multiline',
}],
},
}, {
files: ['tests/**/*', '**/*.d.ts'],
},
]);
9 changes: 9 additions & 0 deletions exampleconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"auth": "",
"port": 1234,
"wssPort": 5678,
"maxFetchConcurrency": 5,

"redisHost": "localhost",
"redisPort": 6777
}
Loading