Skip to content
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

Add linting #37

Merged
merged 2 commits into from
Nov 2, 2024
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ jobs:

- name: Run tests
run: npm test

- name: Run lint check
run: npm run lint

- name: Run format check
run: npm run format:check
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
node-version: 22.x

- name: Install dependencies
run: npm install
run: npm ci

- name: Run tests
run: npx jest --coverage
run: npm run test:coverage

- name: Upload results to Codecov
uses: codecov/codecov-action@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm test
- run: npm run lint && npm run format:check
- name: Check if package version matches release
run: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
Expand Down
2 changes: 1 addition & 1 deletion bench/Queue.bench.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Bench } from 'tinybench';
import { Queue } from '../src/index.js';

type BenchmarkType = Record<string, any>;
type BenchmarkType = Record<string, number>;

// Set up
let q = new Queue<BenchmarkType>();
Expand Down
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @ts-check

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default tseslint.config(
{
ignores: ['dist/**'],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
);
Loading