Skip to content

Commit 9e11292

Browse files
committed
Update biome config
1 parent 669cf10 commit 9e11292

File tree

11 files changed

+5874
-921
lines changed

11 files changed

+5874
-921
lines changed

.github/workflows/push.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ jobs:
3434
- name: Build project
3535
run: pnpm run build
3636
- name: Biome Lint Check
37-
run: pnpm run lint
37+
run: pnpm run lint
38+
- name: Tests
39+
run: pnpm test

babel.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
presets: [
3+
["@babel/preset-env", { targets: { node: "current" } }],
4+
"@babel/preset-typescript",
5+
],
6+
};

biome.json

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,38 @@
66
"linter": {
77
"enabled": true,
88
"rules": {
9-
"recommended": true
9+
"recommended": true,
10+
"correctness": {
11+
"noUnusedVariables": "off",
12+
"noConstructorReturn": "off"
13+
},
14+
"performance": {
15+
"noDelete": "off"
16+
},
17+
"style": {
18+
"noNonNullAssertion": "off",
19+
"useShorthandArrayType": "error",
20+
"useNodejsImportProtocol": "off",
21+
"noUselessElse": "off",
22+
"useImportType": "off",
23+
"noInferrableTypes": "off",
24+
"useNumberNamespace": "off"
25+
},
26+
"suspicious": {
27+
"noArrayIndexKey": "off",
28+
"noImplicitAnyLet": "off",
29+
"noExplicitAny": "off",
30+
"noAssignInExpressions": "off",
31+
"noConfusingVoidType": "off",
32+
"noExportsInTest": "off"
33+
},
34+
"complexity": {
35+
"noForEach": "off",
36+
"useLiteralKeys": "off"
37+
},
38+
"a11y": {
39+
"noSvgWithoutTitle": "off"
40+
}
1041
}
1142
},
1243
"formatter": {

jest.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// For jest.config.js
2+
/** @type {import('ts-jest').JestConfigWithTsJest} */
3+
module.exports = {
4+
preset: "ts-jest/presets/default-esm", // Use the ESM preset for ts-jest
5+
testEnvironment: "node",
6+
testMatch: ["**/?(*.)+(spec|test).[jt]s?(x)"],
7+
// This is crucial for resolving imports in ESM when 'type: module' is set
8+
moduleNameMapper: {
9+
// This maps any .js import to its corresponding .ts file for ts-jest
10+
// It's often helpful when you have imports ending in .js in your TS source.
11+
"^(\\.{1,2}/.*)\\.js$": "$1",
12+
},
13+
extensionsToTreatAsEsm: [".ts", ".tsx"], // Tell Jest to treat .ts and .tsx files as ESM
14+
transform: {
15+
"^.+\\.(ts|tsx)$": [
16+
"ts-jest",
17+
{
18+
useESM: true, // Crucial for ts-jest to emit ESM compatible code
19+
},
20+
],
21+
},
22+
};

package.json

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"start": "node dist/index.js",
1616
"publish-packages": "pnpm run build && changeset publish",
1717
"format": "biome format . --write",
18+
"test": "jest --passWithNoTests",
1819
"lint": "biome check ."
1920
},
2021
"author": "IQAI",
@@ -34,20 +35,26 @@
3435
"dependencies": {
3536
"dedent": "^1.6.0",
3637
"fastmcp": "^1.27.7",
37-
"graphql-request": "^6.1.0",
38-
"graphql": "^16.8.1",
3938
"gql.tada": "^1.4.3",
39+
"graphql": "^16.8.1",
40+
"graphql-request": "^6.1.0",
41+
"ts-node": "^10.9.2",
4042
"zod": "^3.25.7"
4143
},
4244
"devDependencies": {
45+
"@0no-co/graphqlsp": "^1.8.0",
46+
"@babel/preset-env": "^7.27.2",
47+
"@babel/preset-typescript": "^7.27.1",
4348
"@biomejs/biome": "*",
4449
"@changesets/cli": "^2.29.4",
45-
"@types/node": "^22.15.19",
50+
"@types/jest": "^30.0.0",
51+
"@types/node": "^24.0.3",
4652
"husky": "^9.0.0",
53+
"jest": "^30.0.2",
4754
"lint-staged": "^15.0.0",
4855
"shx": "^0.3.4",
49-
"typescript": "^5.8.3",
50-
"@0no-co/graphqlsp": "^1.8.0"
56+
"ts-jest": "^29.4.0",
57+
"typescript": "^5.8.3"
5158
},
5259
"lint-staged": {
5360
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [

0 commit comments

Comments
 (0)