Skip to content

Commit 68705e0

Browse files
committed
tooling upgrades
1 parent 4585a35 commit 68705e0

File tree

8 files changed

+102
-100
lines changed

8 files changed

+102
-100
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'CodeQL'
22

33
on:
44
schedule:
5-
- cron: '16 2 * * *'
5+
- cron: '16 2 * * 1'
66

77
jobs:
88
analyze:
@@ -13,26 +13,16 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
language: ['javascript']
16-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
17-
# Learn more:
18-
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
1916

2017
steps:
2118
- name: Checkout repository
2219
uses: actions/checkout@v4
2320

24-
# Initializes the CodeQL tools for scanning.
2521
- name: Initialize CodeQL
2622
uses: github/codeql-action/init@v3
2723
with:
2824
languages: ${{ matrix.language }}
29-
# If you wish to specify custom queries, you can do so here or in a config file.
30-
# By default, queries listed here will override any specified in a config file.
31-
# Prefix the list here with "+" to use these queries and those in the config file.
32-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
3325

34-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
35-
# If this step fails, then you should remove it and run the build manually (see below)
3626
- name: Autobuild
3727
uses: github/codeql-action/autobuild@v3
3828

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
strategy:
2424
fail-fast: true
2525
matrix:
26-
node-version: [18, 20]
26+
node-version: [20, 22]
2727

2828
steps:
2929
- name: Checkout repository
3030
uses: actions/checkout@v4
3131

32-
- uses: oven-sh/setup-bun@v1
32+
- uses: oven-sh/setup-bun@v2
3333
with:
3434
bun-version: latest
3535

biome.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
33
"files": {
44
"include": ["./*.cjs", "./*.js", "./*.mjs", "src/**/*.js", "src/**/*.ts"],
55
"ignore": [".vscode/**", ".idea/**", ".git/**", ".husky/**", "build/**", "configure-package.js", "dist/**", "node_modules/**", "scripts/**"]
@@ -40,7 +40,7 @@
4040
"quoteProperties": "asNeeded",
4141
"quoteStyle": "single",
4242
"semicolons": "always",
43-
"trailingComma": "all"
43+
"trailingCommas": "all"
4444
}
4545
},
4646
"json": {

eslint.config.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import tsParser from '@typescript-eslint/parser';
2+
import tsPlugin from '@typescript-eslint/eslint-plugin';
3+
import jestPlugin from 'eslint-plugin-jest';
4+
import nodePlugin from 'eslint-plugin-node';
5+
import globals from 'globals';
6+
import { Linter } from 'eslint';
7+
import { FlatESLint } from '@typescript-eslint/utils/ts-eslint';
8+
9+
/** @type {Linter.Config} */
10+
const config = [
11+
{
12+
files: [ 'src/*.js', 'src/**/*.js', 'src/**/*.ts', 'src/*.ts' ],
13+
ignores: [ 'node_modules', 'dist' ],
14+
env: {node: true,},
15+
languageOptions: {
16+
ecmaVersion: 2020,
17+
sourceType: 'script',
18+
parser: tsParser,
19+
parserOptions: {
20+
ecmaVersion: 2020,
21+
sourceType: 'module',
22+
},
23+
globals: {
24+
...globals.browser,
25+
...globals.node,
26+
...globals.es2020,
27+
},
28+
},
29+
},
30+
{
31+
plugins: {
32+
'@typescript-eslint': tsPlugin,
33+
jest: jestPlugin,
34+
node: nodePlugin,
35+
},
36+
rules: {
37+
'@typescript-eslint/ban-ts-comment': 'off',
38+
'@typescript-eslint/explicit-function-return-type': 'off',
39+
'@typescript-eslint/explicit-module-boundary-types': 'off',
40+
'@typescript-eslint/no-empty-function': 'off',
41+
'@typescript-eslint/no-empty-interface': 'error',
42+
'@typescript-eslint/no-explicit-any': 'off',
43+
'@typescript-eslint/no-inferrable-types': 'off',
44+
'@typescript-eslint/no-var-requires': 'off',
45+
'jest/no-disabled-tests': 'warn',
46+
'jest/no-identical-title': 'error',
47+
'newline-per-chained-call': [ 'warn', { ignoreChainWithDepth: 2 }],
48+
'node/no-missing-import': 'off',
49+
'node/no-missing-require': 'off',
50+
'node/no-process-exit': 'off',
51+
'node/no-unpublished-import': 'off',
52+
'node/no-unpublished-require': 'off',
53+
'node/no-unsupported-features/es-syntax': 'off',
54+
'array-bracket-newline': [ 'warn', { multiline: true, minItems: 6 }],
55+
'array-bracket-spacing': [ 'warn', 'always', { objectsInArrays: false }],
56+
'array-element-newline': [ 'warn', { multiline: true, minItems: 6 }],
57+
eqeqeq: [ 'error', 'smart' ],
58+
indent: [ 'warn', 4, { SwitchCase: 1 }],
59+
'no-eval': 'error',
60+
'no-var': 'error',
61+
'object-curly-newline': [
62+
'warn',
63+
{
64+
ObjectExpression: { multiline: true, minProperties: 4 },
65+
ObjectPattern: { multiline: true, minProperties: 4 },
66+
ImportDeclaration: 'never',
67+
},
68+
],
69+
},
70+
},
71+
new FlatESLint(),
72+
// tsPlugin.configs.recommended,
73+
// jestPlugin.configs.recommended,
74+
// nodePlugin.configs.recommended,
75+
];
76+
77+
export default config;

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"*.{js,ts}": [
2424
"biome format --no-errors-on-unmatched --write",
2525
"prettier --config prettier.config.js --write",
26-
"eslint --config .eslintrc.cjs --fix"
26+
"eslint --config eslint.config.js --fix"
2727
],
2828
"*.{css,gql,graphql,html,json,less,md,mdx,sass,scss}": [
2929
"prettier --config prettier.config.js --write"
@@ -39,8 +39,8 @@
3939
"test": "jest tests --verbose",
4040
"test:coverage": "jest tests --coverage",
4141
"fmt": "biome format --no-errors-on-unmatched --write . && prettier --config prettier.config.js --write .",
42-
"lint": "eslint --config .eslintrc.cjs --ext ts,js src/",
43-
"lint:fix": "biome lint --apply-unsafe src/ && eslint --config .eslintrc.cjs --ext ts,js --fix src/",
42+
"lint": "eslint --config eslint.config.js --ext ts,js src/",
43+
"lint:fix": "biome lint --apply-unsafe src/ && eslint --config eslint.config.js --ext ts,js --fix src/",
4444
"lint:staged": "lint-staged",
4545
"fix": "npm run fmt && npm run lint:fix",
4646
"build:api-docs": "typedoc --plugin typedoc-plugin-markdown --out docs/api src/index.ts",
@@ -54,29 +54,29 @@
5454
"version": "auto-changelog -p -o CHANGELOG.md --hide-credit --release-summary --hide-empty-releases --sort-commits date-desc && git add CHANGELOG.md"
5555
},
5656
"devDependencies": {
57-
"@biomejs/biome": "1.8.3",
58-
"@types/jest": "^29.5.11",
59-
"@types/node": "^20.11.0",
60-
"@typescript-eslint/eslint-plugin": "^7.0.0",
61-
"@typescript-eslint/parser": "^7.1.0",
57+
"@biomejs/biome": "^1.9.4",
58+
"@types/jest": "^29.5.14",
59+
"@types/node": "^22.9.0",
60+
"@typescript-eslint/eslint-plugin": "^8.14.0",
61+
"@typescript-eslint/parser": "^8.14.0",
6262
"auto-changelog": "^2.4.0",
6363
"dts-bundle-generator": "^9.2.4",
64-
"esbuild": "^0.23.0",
65-
"eslint": "^8.56.0",
66-
"eslint-plugin-jest": "^27.6.3",
64+
"esbuild": "^0.24.0",
65+
"eslint": "^9.15.0",
66+
"eslint-plugin-jest": "^28.9.0",
6767
"eslint-plugin-node": "^11.1.0",
6868
"husky": "^9.0.11",
6969
"jest": "^29.7.0",
7070
"lint-staged": "^15.2.0",
71-
"madge": "^7.0.0",
71+
"madge": "^8.0.0",
7272
"prettier": "^3.2.1",
7373
"ts-jest": "^29.1.1",
7474
"typedoc": "^0.26.2",
7575
"typedoc-plugin-markdown": "^3.17.1",
76-
"typescript": "^5.3.3"
76+
"typescript": "^5.6.3"
7777
},
7878
"bin": "bin/{{package.name}}",
7979
"engines": {
80-
"node": ">=14.0.0"
80+
"node": ">=18.0.0"
8181
}
8282
}

tsconfig.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
//
32
"compilerOptions": {
4-
/* Visit https://aka.ms/tsconfig.json to read more about this file */
5-
6-
/* Basic Options */
7-
// "incremental": true, /* Enable incremental compilation */
8-
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
9-
"module": "NodeNext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
10-
"lib": ["esnext"] /* Specify library files to be included in the compilation. */,
3+
"target": "esnext",
4+
"module": "ESNext",
5+
"lib": ["esnext", "Decorators"] /* Specify library files to be included in the compilation. */,
116
"allowJs": true /* Allow javascript files to be compiled. */,
127
"checkJs": true /* Report errors in .js files. */,
138

@@ -44,8 +39,8 @@
4439
// "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
4540

4641
/* Module Resolution Options */
47-
"moduleResolution": "NodeNext" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
48-
"baseUrl": "." /* Base directory to resolve non-absolute module names. */,
42+
"moduleResolution": "bundler",
43+
"baseUrl": ".",
4944
"paths": {
5045
"@/*": ["src/*"],
5146
"@tests/*": ["tests/*"]
@@ -73,5 +68,5 @@
7368
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
7469
"resolveJsonModule": true
7570
},
76-
"exclude": ["configure-package.js", "features/*", "*.config.js", ".eslintrc.cjs", "scripts/*"]
71+
"exclude": ["configure-package.js", "features/*", "*.config.js", "eslint.config.js", "scripts/*"]
7772
}

0 commit comments

Comments
 (0)