{"id":30228920,"url":"https://github.com/protonmail/eslint-plugin-enforce-uint8array-arraybuffer","last_synced_at":"2026-01-20T17:37:31.675Z","repository":{"id":309634020,"uuid":"1036670140","full_name":"ProtonMail/eslint-plugin-enforce-uint8array-arraybuffer","owner":"ProtonMail","description":"ESLint plugin for typescript to enforce declaring `Uint8Array\u003cArrayBuffer\u003e` types over `Uint8Array`","archived":false,"fork":false,"pushed_at":"2025-08-12T14:55:17.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-13T01:29:29.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ProtonMail.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-12T12:16:51.000Z","updated_at":"2025-08-12T14:55:20.000Z","dependencies_parsed_at":"2025-08-13T01:29:31.679Z","dependency_job_id":"a1cf3bc6-4d56-40d0-8da5-3937d8f68bc7","html_url":"https://github.com/ProtonMail/eslint-plugin-enforce-uint8array-arraybuffer","commit_stats":null,"previous_names":["protonmail/eslint-plugin-enforce-uint8array-arraybuffer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ProtonMail/eslint-plugin-enforce-uint8array-arraybuffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Feslint-plugin-enforce-uint8array-arraybuffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Feslint-plugin-enforce-uint8array-arraybuffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Feslint-plugin-enforce-uint8array-arraybuffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Feslint-plugin-enforce-uint8array-arraybuffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProtonMail","download_url":"https://codeload.github.com/ProtonMail/eslint-plugin-enforce-uint8array-arraybuffer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProtonMail%2Feslint-plugin-enforce-uint8array-arraybuffer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270475448,"owners_count":24590079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-14T20:06:53.603Z","updated_at":"2026-01-20T17:37:31.662Z","avatar_url":"https://github.com/ProtonMail.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eslint-plugin-enforce-uint8array-arraybuffer\n\nThis ESLint rule enforces that any `Uint8Array` type declaration explicitly includes `\u003cArrayBuffer\u003e` as its generic parameter.\nAn auto-fix feature is also implemented.\n\nUsing `\u003cArrayBuffer\u003e` ensures compatibility with WebCrypto APIs, `Blob`s, and other browser features, following a TS [change](https://github.com/microsoft/TypeScript/pull/59417) in v5.9 the default `ArrayBufferLike` parameter is no longer guaranteed to be compatible with `ArrayBuffer` (due to differences with `SharedArrayBuffer`) .\n\n## Installation\n\n```sh\nnpm i --save-dev @protontech/eslint-plugin-enforce-uint8array-arraybuffer\n```\n\n## Usage\n\nAdd the plugin and rule to your ESLint config:\n\n```js\nimport pluginEnforceUint8ArrayArrayBuffer from '@protontech/eslint-plugin-enforce-uint8array-arraybuffer';\n\nexport default defineConfig({\n  plugins: {\n    '@protontech/enforce-uint8array-arraybuffer': pluginEnforceUint8ArrayArrayBuffer,\n  },\n  rules: {\n    '@protontech/enforce-uint8array-arraybuffer/enforce-uint8array-arraybuffer': 'error',\n  }\n})\n```\n\n## Example behavior\n\nThese usages are correct:\n\n```ts\nconst a = new Uint8Array(); // this is automatically instantiated as Uint8Array\u003cArrayBuffer\u003e\nfunction f(data: Uint8Array\u003cArrayBuffer\u003e) {}\ntype T = Promise\u003cUint8Array\u003cArrayBuffer\u003e[]\u003e;\n```\n\nWhile these will trigger eslint errors (`Uint8Array must be used as Uint8Array\u003cArrayBuffer\u003e`), but can be auto-fixed.\n\n```ts\nfunction f(data: Uint8Array) {} // missingGeneric error\ntype T = Promise\u003cUint8Array[]\u003e; // missingGeneric error\n```\n\nIf a generic argument is specified other than `ArrayBuffer`, the linter will also error (`Uint8Array generic argument must be exactly 'ArrayBuffer'`), but it will require manual resolution:\n\n```ts\nfunction f(data: Uint8Array\u003cArrayBufferLike\u003e) {} // wrongGeneric error\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonmail%2Feslint-plugin-enforce-uint8array-arraybuffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotonmail%2Feslint-plugin-enforce-uint8array-arraybuffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotonmail%2Feslint-plugin-enforce-uint8array-arraybuffer/lists"}