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
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ jobs:

- name: Build package
run: npm run build

- name: Lint package
run: npm run lint:package
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ jobs:
- name: Install dependencies
run: npm ci --prefer-offline

- name: Build package
run: npm run build

- name: Run ESLint
run: npm run lint

- name: Type check
run: npm run lint:tsc

- name: Lint package
run: npm run lint:package

- name: Check types
run: |
npx @arethetypeswrong/cli --pack
if [[ "$(npx @arethetypeswrong/cli --pack -f json | jq '.problems != {}')" == 'true' ]]; then
npx @arethetypeswrong/cli --pack -f json | jq
exit 1
fi
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ jobs:
run: npm ci --prefer-offline

- name: Run server test
run: npm run test:server
run: npm run test:coverage

- name: Generate coverage report
run: |
mkdir -p coverage
npx nyc report --reporter=text-lcov > coverage/lcov.info
run: npx nyc report --reporter=text-lcov > coverage/lcov.info

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
Expand Down
46 changes: 23 additions & 23 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';

import { includeIgnoreFile } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import eslint from '@eslint/js';
import { defineConfig } from 'eslint/config';
import prettier from 'eslint-plugin-prettier';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import tsdoc from 'eslint-plugin-tsdoc';
import globals from 'globals';
import tseslint from 'typescript-eslint';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, '.gitignore');
const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url));

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
export default defineConfig([
includeIgnoreFile(gitignorePath),

...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
),

{
files: ['**/*.{cjs,cts,js,jsx,mjs,mts,ts,tsx}'],

plugins: {
'@typescript-eslint': typescriptEslint,
'simple-import-sort': simpleImportSort,
eslint,
prettier,
tsdoc,
},

extends: [
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
],

languageOptions: {
globals: {
...globals.browser,
...globals.mocha,
...globals.node,
},
parser: tsParser,
parserOptions: {
project: ['tsconfig.build.json', 'tsconfig.test.json'],
tsconfigRootDir: import.meta.dirname,
},
},

rules: {
Expand All @@ -62,4 +62,4 @@ export default [
'@typescript-eslint/no-require-imports': 'off',
},
},
];
]);
2 changes: 2 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* @see https://karma-runner.github.io/6.4/config/configuration-file.html
*
* @param {{LOG_INFO: string; set: () => void}} config
*/
module.exports = (config) => {
config.set({
Expand Down
Loading