add new eslint

This commit is contained in:
2025-01-20 09:53:59 -06:00
parent 128b0a8a11
commit 3f77e88c62
4 changed files with 1509 additions and 8 deletions
+13
View File
@@ -0,0 +1,13 @@
import pluginJs from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';
/** @type {import('eslint').Linter.Config[]} */
export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
];
+1486 -4
View File
File diff suppressed because it is too large Load Diff
+8 -2
View File
@@ -21,7 +21,7 @@
"example:client": "node examples/psn_client.js",
"example:server": "node examples/psn_server.js",
"prepublishOnly": "npm run build",
"lint:check": "eslint ./",
"lint:check": "eslint ./src",
"format:check": "prettier ./ --check",
"format:write": "prettier ./ --write"
},
@@ -36,9 +36,15 @@
"repository": "https://github.com/jwetzell/psn-js",
"license": "MIT",
"devDependencies": {
"@eslint/js": "^9.18.0",
"@types/node": "22.10.2",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"globals": "^15.14.0",
"prettier": "3.4.2",
"rimraf": "6.0.1",
"typescript": "5.7.2"
"typescript": "5.7.2",
"typescript-eslint": "^8.20.0"
}
}
+2 -2
View File
@@ -11,7 +11,7 @@ export default (buffer: Uint8Array): InfoTrackerChunk => {
const view = new DataView(chunk.chunkData.buffer, chunk.chunkData.byteOffset, chunk.chunkData.byteLength);
const chunkId = view.getUint16(offset, true);
switch (chunkId) {
case 0x0000:
case 0x0000: {
const data: InfoTrackerChunkData = {
trackerName: Decoders.InfoTrackerNameChunk(chunk.chunkData.subarray(offset)),
};
@@ -23,7 +23,7 @@ export default (buffer: Uint8Array): InfoTrackerChunk => {
chunk,
data,
};
}
default:
break;
}