Skip to content

Commit

Permalink
Add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
stirante committed Feb 27, 2024
1 parent 13d2639 commit 147d480
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": [
"@typescript-eslint",
"minecraft-linting"
],
"overrides": [
{
"files": [
"*.ts"
]
}
],
"rules": {
"minecraft-linting/avoid-unnecessary-command": "error"
// "prefer-const": "warn",
// "@typescript-eslint/no-explicit-any": "off"
}
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@
"@types/jest": "^29.5.6",
"jest": "^29.7.0",
"ts-jest": "^29.1.1",
"tsup": "^7.2.0"
"tsup": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"eslint": "^8.57.0",
"eslint-plugin-minecraft-linting": "^1.1.0"
},
"dependencies": {
"@minecraft/server": "beta",
Expand Down
2 changes: 1 addition & 1 deletion src/Vec3.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LogLevel, Logger } from './Logging';
/* eslint-disable @typescript-eslint/no-explicit-any */
import Vec3 from './Vec3';
import { Direction } from '@minecraft/server';

Expand Down
2 changes: 1 addition & 1 deletion src/scheduling/PulseScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default class PulseScheduler<T> {
return;
}
// Number of items to process this tick
let scheduledExecutions = this.executionSchedule[this.currentTick];
const scheduledExecutions = this.executionSchedule[this.currentTick];
if (scheduledExecutions === 0) {
log.debug("No items to process this tick.");
// Increment the tick counter
Expand Down

0 comments on commit 147d480

Please sign in to comment.