Skip to content
This repository was archived by the owner on Oct 4, 2025. It is now read-only.

Commit 343dac5

Browse files
committed
ts pass mostly done, lint warnings remain, ipfs types not fully resolved
1 parent bded247 commit 343dac5

File tree

11 files changed

+1040
-390
lines changed

11 files changed

+1040
-390
lines changed

.eslintrc.cjs

Lines changed: 108 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,111 @@
1+
/* eslint-env node */
2+
/** @type {import('eslint').Linter.Config} */
13
module.exports = {
2-
"env": {
3-
"browser": true,
4-
"es6": true,
5-
"webextensions": true
4+
parser: "@typescript-eslint/parser",
5+
env: {
6+
browser: true,
7+
commonjs: true,
8+
es2017: true,
9+
},
10+
extends: [
11+
"eslint:recommended",
12+
"plugin:@typescript-eslint/eslint-recommended",
13+
],
14+
plugins: ["@typescript-eslint"],
15+
parserOptions: {
16+
project: ["./tsconfig.eslint.json"],
17+
tsconfigRootDir: __dirname,
18+
},
19+
root: true,
20+
rules: {
21+
/* start stylistic rules */
22+
"@typescript-eslint/adjacent-overload-signatures": "error",
23+
"@typescript-eslint/array-type": "error",
24+
"@typescript-eslint/consistent-type-imports": [
25+
"error",
26+
{
27+
fixStyle: "inline-type-imports",
28+
},
29+
],
30+
"@typescript-eslint/consistent-type-exports": "error",
31+
"@typescript-eslint/prefer-readonly": "warn",
32+
"@typescript-eslint/class-literal-property-style": ["warn", "getters"],
33+
"@typescript-eslint/consistent-generic-constructors": "error",
34+
"@typescript-eslint/consistent-type-assertions": "error",
35+
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
36+
"@typescript-eslint/no-inferrable-types": "warn",
37+
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
38+
"@typescript-eslint/prefer-for-of": "warn",
39+
// "@typescript-eslint/prefer-nullish-coalescing": "warn",
40+
"@typescript-eslint/prefer-optional-chain": "warn",
41+
"@typescript-eslint/prefer-string-starts-ends-with": "error",
42+
"@typescript-eslint/no-meaningless-void-operator": "error",
43+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
44+
"@typescript-eslint/no-unnecessary-condition": "warn",
45+
"@typescript-eslint/no-unnecessary-qualifier": "warn",
46+
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
47+
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
48+
"@typescript-eslint/promise-function-async": "warn",
49+
/* end stylistic rules */
50+
51+
/* start recommended rules */
52+
"no-restricted-globals": [2, "event", "error"],
53+
"@typescript-eslint/no-base-to-string": "warn",
54+
"@typescript-eslint/no-duplicate-enum-values": "error",
55+
"@typescript-eslint/no-duplicate-type-constituents": "warn",
56+
"@typescript-eslint/no-explicit-any": "error",
57+
"@typescript-eslint/no-extra-non-null-assertion": "error",
58+
"@typescript-eslint/no-floating-promises": "warn",
59+
"@typescript-eslint/no-for-in-array": "warn",
60+
"no-unused-vars": "off",
61+
"@typescript-eslint/no-unused-vars": [
62+
"error",
63+
{
64+
argsIgnorePattern: "^_",
65+
varsIgnorePattern: "^_",
66+
destructuredArrayIgnorePattern: "^_",
67+
caughtErrorsIgnorePattern: "^_",
68+
},
69+
],
70+
"no-implied-eval": "off",
71+
"@typescript-eslint/no-implied-eval": "error",
72+
"no-loss-of-precision": "off",
73+
"@typescript-eslint/no-loss-of-precision": "warn",
74+
"@typescript-eslint/no-misused-new": "error",
75+
"@typescript-eslint/no-misused-promises": [
76+
"error",
77+
{ checksVoidReturn: false },
78+
],
79+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
80+
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn",
81+
"@typescript-eslint/no-redundant-type-constituents": "warn",
82+
"@typescript-eslint/no-this-alias": "warn",
83+
"@typescript-eslint/no-unnecessary-type-assertion": "warn",
84+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
85+
/* TODO eventually turn all these on */
86+
"@typescript-eslint/no-unsafe-argument": "warn",
87+
// "@typescript-eslint/no-unsafe-assignment": "warn",
88+
// "@typescript-eslint/no-unsafe-call": "warn",
89+
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
90+
"@typescript-eslint/no-unsafe-enum-comparison": "warn",
91+
// "@typescript-eslint/no-unsafe-member-access": "warn",
92+
"@typescript-eslint/no-unsafe-return": "warn",
93+
"@typescript-eslint/prefer-as-const": "warn",
94+
"require-await": "off",
95+
// "@typescript-eslint/require-await": "warn",
96+
"@typescript-eslint/restrict-template-expressions": "warn",
97+
"@typescript-eslint/unbound-method": "off",
98+
"@typescript-eslint/method-signature-style": "error",
99+
},
100+
reportUnusedDisableDirectives: true,
101+
ignorePatterns: ["__generated__", "__mocks__", "dist", "static"],
102+
overrides: [
103+
{
104+
extends: ["plugin:@typescript-eslint/disable-type-checked"],
105+
files: ["webpack.*.js", ".*.cjs"],
106+
rules: {
107+
"@typescript-eslint/no-var-requires": "off",
108+
},
6109
},
7-
"extends": "eslint:recommended",
8-
"parserOptions": {
9-
"ecmaVersion": 2018,
10-
"sourceType": "module"
11-
},
12-
"rules": {
13-
"no-restricted-globals": [
14-
2,
15-
"event", "error"
16-
],
17-
"indent": [
18-
"error",
19-
2
20-
],
21-
"linebreak-style": [
22-
"error",
23-
"unix"
24-
],
25-
"quotes": [
26-
"error",
27-
"double"
28-
],
29-
"semi": [
30-
"error",
31-
"always"
32-
]
33-
}
110+
],
34111
};

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
"src/*"
1717
],
1818
"dependencies": {
19+
"@ipld/car": "^5.3.2",
20+
"@ipld/unixfs": "^3.0.0",
1921
"@webrecorder/wabac": "^2.20.0-beta.1",
2022
"auto-js-ipfs": "^2.3.0",
2123
"client-zip": "^2.3.0",
2224
"hash-wasm": "^4.9.0",
2325
"idb": "^7.1.1",
26+
"p-queue": "^8.0.1",
2427
"uuid": "^9.0.0",
2528
"warcio": "^2.3.1"
2629
},
@@ -32,7 +35,9 @@
3235
},
3336
"devDependencies": {
3437
"@types/uuid": "^10.0.0",
35-
"eslint": "^8.28.0",
38+
"@typescript-eslint/eslint-plugin": "^8.4.0",
39+
"@typescript-eslint/parser": "^8.4.0",
40+
"eslint": "^8.56.1",
3641
"raw-loader": "^4.0.2",
3742
"ts-loader": "^9.5.1",
3843
"tsconfig-paths-webpack-plugin": "^4.1.0",

0 commit comments

Comments
 (0)