Skip to content

Commit e1854cd

Browse files
authored
Merge pull request #449 from DrJacobHolden/switch-eslint-for-biome
Replace ESLint with Biome
2 parents 4926deb + 32312bc commit e1854cd

File tree

362 files changed

+22142
-25171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+22142
-25171
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Lint & Build Project
1+
name: Check & Build Project
22

33
on:
44
pull_request:
@@ -23,7 +23,13 @@ jobs:
2323
run: npm i
2424

2525
- name: Run Linter
26-
run: npm run lint
26+
run: npm run lint:fin
27+
28+
- name: Run Formatter
29+
run: npm run format:fin
30+
31+
- name: Run Tests
32+
run: npm run test:fin
2733

2834
- name: Run Typecheck
2935
run: npm run typecheck

.swcrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
"dynamicImport": false
2121
}
2222
}
23-
}
23+
}

.vscode/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"editor.tabSize": 4,
3-
"files.trimTrailingWhitespace": true,
4-
"files.trimFinalNewlines": true,
5-
"files.insertFinalNewline": true
2+
"editor.tabSize": 4,
3+
"files.trimTrailingWhitespace": true,
4+
"files.trimFinalNewlines": true,
5+
"files.insertFinalNewline": true
66
}

CONTRIBUTING.md

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,15 @@ RuneJS was created with the intention of utilizing JavaScript/TypeScript and Nod
66
- This defeats the purpose of RuneJS by implementing basic flows that any regular Java-based server would use. Think outside the box and really utilize ES6, TypeScript, Node, and RxJS! :)
77
2. Additional/outside dependencies
88
- Sometimes additional dependencies cannot be avoided, but we'd like to avoid them as much as possible. RuneJS intends to be simple and easy for anyone to pick up, without requiring the user to set up any databases or additional third party systems.
9-
- In some cases this is of course unavoidable, as such we'll handle them on a case-by-case basis.
10-
9+
- In some cases this is of course unavoidable, as such we'll handle them on a case-by-case basis.
10+
1111
Ultimately if you're looking to contribute, it's best to check in with us on Discord to see if we're already working on a specific feature or have plans for it already. Add us at **Tyn#0001**
12-
12+
1313
## Code Style
1414

15-
We do have a few coding styles and lint rules we'd like all contributors to adhere to. **Please run the linter via `npm run lint` before submitting any Pull Requests**:
16-
17-
- 4 space indentation
18-
- Spaces between TS/ES6 import/export braces
19-
- `import { this } from 'that';` instead of `import {this} from 'that';`
20-
- Semicolon line endings
21-
- `let myVariable = true;` instead of only `let myVariable = true`
22-
- Single quotes instead of double quotes
23-
- `let myString = 'hello world!';` instead of `let myString = "hello world";`
24-
- `import { this } from 'that';` instead of `import { this } from "that";`
25-
- Avoid the `var` keyword
26-
- `let myVariable;` instead of `var myVariable;`
27-
- Prefer `const` to `let`
28-
- If a variable is never going to be modified, please declare it using `const` instead of `let`
29-
- `const neverChanged = true;` instead of `let neverChanged = true;`
30-
- Add types to all method parameters and return types to all methods
31-
- `public myMethod(firstParam: string, secondParam: number): void {` instead of `public myMethod(firstParam, secondParam) {`
32-
- Add `public`, `private`, or `protected` to every class variable or method
33-
- `public myMethod(): void {` instead of `myMethod(): void {`
34-
- `private myVar: number;` instead of `myVar: number;`
35-
- Use TypeScript getters/setters instead of specific getter/setter methods
36-
- `public get myVar(): number` instead of `public getMyVar(): number`
37-
- `public set myVar(myVar: number)` instead of `public setMyVar(myVar: number)`
15+
Code style (linting and formatting) are handled by [Biome](https://biomejs.dev/). It is recommended that you install [the Biome extension for your IDE](https://biomejs.dev/guides/editors/first-party-extensions/).
16+
17+
Running `npm run fin` will perform all necessary checks (linting, formatting, typechecking and tests).
3818

3919
## Testing
4020

@@ -75,4 +55,6 @@ describe('when there is a player', () => {
7555
There are two main benefits to this kind of design:
7656

7757
- It serves as living documentation: from reading the `beforeEach` block you can clearly see how the prerequisite of "player is wearing a hat" is achieved
78-
- It allows for easy expansion of test cases: future developers can add further statements inside "when player is wearing a hat" if they want to make use of that setup
58+
- It allows for easy expansion of test cases: future developers can add further
59+
statements inside "when player is wearing a hat" if they want to make use of
60+
that setup

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ Before running these commands, you must:
4848
* `npm run standalone` Launches all three servers concurrently without building
4949
* `npm run build:watch` Builds the application and watches for changes
5050
* `npm run build` Builds the application
51-
* `npm run lint` Runs the linter against the codebase to look for code style issues
51+
* `npm run lint` Runs Biome in linting mode, use `lint:fix` to autofix
52+
* `npm run format` Runs Biome in formatting mode, use `format:fix` to autofix
53+
* `npm run test` Runs all tests with Jest
54+
* `npm run typecheck` Typechecks the project
55+
* `npm run fin` Combines lint:fix, format:fix, test and typecheck into a single command

biome.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": []
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 4,
16+
"lineWidth": 140
17+
},
18+
"organizeImports": {
19+
"enabled": true
20+
},
21+
"linter": {
22+
"enabled": true,
23+
"rules": {
24+
"recommended": true,
25+
"complexity": {
26+
"recommended": true,
27+
"noBannedTypes": "off",
28+
"noForEach": "off",
29+
"noStaticOnlyClass": "off",
30+
"noUselessConstructor": "off",
31+
"noUselessSwitchCase": "off",
32+
"useLiteralKeys": "off",
33+
"useOptionalChain": "off"
34+
},
35+
"correctness": {
36+
"recommended": true,
37+
"noSwitchDeclarations": "off"
38+
},
39+
"performance": {
40+
"recommended": true,
41+
"noAccumulatingSpread": "off",
42+
"noDelete": "off"
43+
},
44+
"suspicious": {
45+
"recommended": true,
46+
"noAssignInExpressions": "off",
47+
"noConfusingVoidType": "off",
48+
"noDoubleEquals": "off",
49+
"noDuplicateObjectKeys": "off",
50+
"noExplicitAny": "off",
51+
"noGlobalIsNan": "off",
52+
"noImplicitAnyLet": "off",
53+
"noSelfCompare": "off",
54+
"noUnsafeDeclarationMerging": "off"
55+
},
56+
"style": {
57+
"recommended": true,
58+
"noInferrableTypes": "off",
59+
"noNonNullAssertion": "off",
60+
"noParameterAssign": "off",
61+
"noUnusedTemplateLiteral": "off",
62+
"noUselessElse": "off",
63+
"useEnumInitializers": "off",
64+
"useImportType": "off",
65+
"useNodejsImportProtocol": "off",
66+
"useNumberNamespace": "off",
67+
"useSingleVarDeclarator": "off",
68+
"useTemplate": "off"
69+
}
70+
}
71+
},
72+
"javascript": {
73+
"formatter": {
74+
"quoteStyle": "single",
75+
"arrowParentheses": "asNeeded"
76+
}
77+
}
78+
}

data/config/items/barrows/dharoks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"rs:dharoks_axe" : {
2+
"rs:dharoks_axe": {
33
"tradable": true,
44
"equippable": true,
55
"equipment_data": {

data/config/items/currency.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"game_id": 995,
44
"tradable": true
55
}
6-
}
6+
}
Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,54 @@
11
{
2-
"rs:amulet_of_glory": {
3-
"game_id": 1704,
4-
"examine": "A very powerful dragonstone amulet.",
5-
"tradable": true,
6-
"weight": 0.01,
7-
"equippable": true,
8-
"equipment_data": {
9-
"equipment_slot": "neck",
10-
"offensive_bonuses": {
11-
"stab": 10,
12-
"slash": 10,
13-
"crush": 10,
14-
"magic": 10,
15-
"ranged": 10
16-
},
17-
"defensive_bonuses": {
18-
"stab": 3,
19-
"slash": 3,
20-
"crush": 3,
21-
"magic": 3,
22-
"ranged": 3
23-
},
24-
"skill_bonuses": {
25-
"prayer": 3,
26-
"strength": 6,
27-
"ranged": 0,
28-
"magic": 0
29-
}
30-
},
31-
"variations": [
32-
{
33-
"game_id": 1706,
34-
"examine": "A dragonstone amulet with 1 magic charge.",
35-
"suffix": "charged_1"
36-
},
37-
{
38-
"game_id": 1708,
39-
"examine": "A dragonstone amulet with 2 magic charges.",
40-
"suffix": "charged_2"
41-
},
42-
{
43-
"game_id": 1710,
44-
"examine": "A dragonstone amulet with 3 magic charges.",
45-
"suffix": "charged_3"
46-
},
47-
{
48-
"game_id": 1712,
49-
"examine": "A dragonstone amulet with 4 magic charges.",
50-
"suffix": "charged_4"
51-
}
52-
]
53-
}
2+
"rs:amulet_of_glory": {
3+
"game_id": 1704,
4+
"examine": "A very powerful dragonstone amulet.",
5+
"tradable": true,
6+
"weight": 0.01,
7+
"equippable": true,
8+
"equipment_data": {
9+
"equipment_slot": "neck",
10+
"offensive_bonuses": {
11+
"stab": 10,
12+
"slash": 10,
13+
"crush": 10,
14+
"magic": 10,
15+
"ranged": 10
16+
},
17+
"defensive_bonuses": {
18+
"stab": 3,
19+
"slash": 3,
20+
"crush": 3,
21+
"magic": 3,
22+
"ranged": 3
23+
},
24+
"skill_bonuses": {
25+
"prayer": 3,
26+
"strength": 6,
27+
"ranged": 0,
28+
"magic": 0
29+
}
30+
},
31+
"variations": [
32+
{
33+
"game_id": 1706,
34+
"examine": "A dragonstone amulet with 1 magic charge.",
35+
"suffix": "charged_1"
36+
},
37+
{
38+
"game_id": 1708,
39+
"examine": "A dragonstone amulet with 2 magic charges.",
40+
"suffix": "charged_2"
41+
},
42+
{
43+
"game_id": 1710,
44+
"examine": "A dragonstone amulet with 3 magic charges.",
45+
"suffix": "charged_3"
46+
},
47+
{
48+
"game_id": 1712,
49+
"examine": "A dragonstone amulet with 4 magic charges.",
50+
"suffix": "charged_4"
51+
}
52+
]
53+
}
5454
}

data/config/items/equipment/halberd.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"style": "halberd"
3232
}
3333
}
34-
3534
},
3635
"rs:steel_halberd": {
3736
"game_id": 3194,
@@ -261,8 +260,7 @@
261260
},
262261
"weapon_info": {
263262
"style": "halberd"
264-
}
265-
263+
}
266264
}
267265
}
268-
}
266+
}

0 commit comments

Comments
 (0)