mirror of
https://github.com/jwetzell/psn-js.git
synced 2026-09-12 09:39:42 +00:00
add new eslint
This commit is contained in:
@@ -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,
|
||||||
|
];
|
||||||
Generated
+1486
-4
File diff suppressed because it is too large
Load Diff
+8
-2
@@ -21,7 +21,7 @@
|
|||||||
"example:client": "node examples/psn_client.js",
|
"example:client": "node examples/psn_client.js",
|
||||||
"example:server": "node examples/psn_server.js",
|
"example:server": "node examples/psn_server.js",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"lint:check": "eslint ./",
|
"lint:check": "eslint ./src",
|
||||||
"format:check": "prettier ./ --check",
|
"format:check": "prettier ./ --check",
|
||||||
"format:write": "prettier ./ --write"
|
"format:write": "prettier ./ --write"
|
||||||
},
|
},
|
||||||
@@ -36,9 +36,15 @@
|
|||||||
"repository": "https://github.com/jwetzell/psn-js",
|
"repository": "https://github.com/jwetzell/psn-js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.18.0",
|
||||||
"@types/node": "22.10.2",
|
"@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",
|
"prettier": "3.4.2",
|
||||||
"rimraf": "6.0.1",
|
"rimraf": "6.0.1",
|
||||||
"typescript": "5.7.2"
|
"typescript": "5.7.2",
|
||||||
|
"typescript-eslint": "^8.20.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export default (buffer: Uint8Array): InfoTrackerChunk => {
|
|||||||
const view = new DataView(chunk.chunkData.buffer, chunk.chunkData.byteOffset, chunk.chunkData.byteLength);
|
const view = new DataView(chunk.chunkData.buffer, chunk.chunkData.byteOffset, chunk.chunkData.byteLength);
|
||||||
const chunkId = view.getUint16(offset, true);
|
const chunkId = view.getUint16(offset, true);
|
||||||
switch (chunkId) {
|
switch (chunkId) {
|
||||||
case 0x0000:
|
case 0x0000: {
|
||||||
const data: InfoTrackerChunkData = {
|
const data: InfoTrackerChunkData = {
|
||||||
trackerName: Decoders.InfoTrackerNameChunk(chunk.chunkData.subarray(offset)),
|
trackerName: Decoders.InfoTrackerNameChunk(chunk.chunkData.subarray(offset)),
|
||||||
};
|
};
|
||||||
@@ -23,7 +23,7 @@ export default (buffer: Uint8Array): InfoTrackerChunk => {
|
|||||||
chunk,
|
chunk,
|
||||||
data,
|
data,
|
||||||
};
|
};
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user