Skip to content

Commit a909399

Browse files
authored
Merge pull request #5 from Borewit/switch-eslint-to-biome
Switch eslint to Biome
2 parents dcd6c89 + ac795bb commit a909399

File tree

4 files changed

+170
-1181
lines changed

4 files changed

+170
-1181
lines changed

biome.jsonc

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.3/schema.json",
3+
"organizeImports": {
4+
"enabled": false
5+
},
6+
"formatter": {
7+
"enabled": false
8+
},
9+
"linter": {
10+
"enabled": true,
11+
"rules": {
12+
"correctness": {
13+
"noUnusedImports": "error",
14+
"noNodejsModules": "error"
15+
},
16+
"recommended": true,
17+
"complexity": {
18+
"noForEach": "off"
19+
},
20+
"suspicious": {
21+
"noEmptyBlockStatements": "error",
22+
"useErrorMessage": "error"
23+
},
24+
"nursery":{
25+
"noRestrictedImports": {
26+
"level": "error",
27+
"options": {
28+
"paths": {
29+
"node:buffer": "Use Uint8Array instead of Buffer"
30+
}
31+
}
32+
}},
33+
"style":{
34+
"useConsistentBuiltinInstantiation": "error",
35+
"useThrowNewError": "error",
36+
"useThrowOnlyError": "error"
37+
}
38+
}
39+
},
40+
"files": {
41+
"ignoreUnknown": true,
42+
"ignore": [
43+
"./coverage",
44+
"./yarn",
45+
"./.pnp.*",
46+
"./lib/**/*.d.ts",
47+
"./lib/**/*.js",
48+
"./test/**/*.d.ts",
49+
"./test/**/*.js"
50+
]
51+
},
52+
"overrides": [
53+
{
54+
"include": ["./test/**/*", "./lib/index.ts", "./lib/FileTokenizer.ts"],
55+
"linter": {
56+
"rules": {
57+
"correctness": {
58+
"noNodejsModules": "off"
59+
}
60+
}
61+
}
62+
}
63+
]
64+
}

package.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,23 @@
4646
"clean": "del-cli 'src/**/*.js' 'src/**/*.js.map' 'src/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map' 'test/**/*.d.ts'",
4747
"compile-src": "tsc -p src",
4848
"build": "yarn run clean && npm run compile-src",
49-
"lint": "eslint src test --ext .ts",
49+
"lint-ts": "biome check",
50+
"lint": "yarn run lint-ts ",
5051
"test": "mocha"
5152
},
5253
"devDependencies": {
5354
"@types/chai": "^4.3.9",
5455
"@types/mocha": "^10.0.3",
5556
"@types/node": "^20.8.10",
56-
"@typescript-eslint/eslint-plugin": "^6.9.1",
57-
"@typescript-eslint/parser": "^6.9.1",
5857
"chai": "^4.3.10",
5958
"del-cli": "^5.1.0",
60-
"eslint": "^8.52.0",
61-
"eslint-config-prettier": "^9.0.0",
62-
"eslint-import-resolver-typescript": "^3.6.1",
63-
"eslint-plugin-import": "^2.29.0",
64-
"eslint-plugin-jsdoc": "^46.8.2",
65-
"eslint-plugin-unicorn": "^49.0.0",
6659
"mocha": "^10.0.0",
6760
"npm-run-all": "^4.1.5",
6861
"ts-node": "^10.9.1",
6962
"typescript": "^5.2.2"
7063
},
71-
"packageManager": "yarn@4.6.0"
64+
"packageManager": "yarn@4.6.0",
65+
"dependencies": {
66+
"@biomejs/biome": "^1.9.4"
67+
}
7268
}

test/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class MockProducer<T> {
1616

1717
class MockConsumer<T> {
1818

19-
public itemsReceived: number = 0;
19+
public itemsReceived = 0;
2020

2121
constructor(private timeToProduce: number) {
2222
}

0 commit comments

Comments
 (0)