-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Convert all of wabac.js to typescript! - wombat built as separate phase, then bundled in second phase. - types added where possible, including for IDB - added @ts-expect-error comments / todos added for further type work - deps: bump warcio to 2.3.1 - add two exports: default export for rewriting / multiwacz loading, swlib export for extending service worker functionality --------- Co-authored-by: Ilya Kreymer <[email protected]>
- Loading branch information
Showing
118 changed files
with
21,453 additions
and
10,501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,112 @@ | ||
/* eslint-env node */ | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
"env": { | ||
"browser": true, | ||
"es6": true | ||
parser: "@typescript-eslint/parser", | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es2017: true, | ||
}, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"prettier", | ||
], | ||
plugins: ["@typescript-eslint"], | ||
parserOptions: { | ||
project: ["./tsconfig.eslint.json"], | ||
tsconfigRootDir: __dirname, | ||
}, | ||
root: true, | ||
rules: { | ||
/* start stylistic rules */ | ||
"@typescript-eslint/adjacent-overload-signatures": "error", | ||
"@typescript-eslint/array-type": "error", | ||
"@typescript-eslint/consistent-type-imports": [ | ||
"error", | ||
{ | ||
fixStyle: "inline-type-imports", | ||
}, | ||
], | ||
"@typescript-eslint/consistent-type-exports": "error", | ||
"@typescript-eslint/prefer-readonly": "warn", | ||
"@typescript-eslint/class-literal-property-style": ["warn", "getters"], | ||
"@typescript-eslint/consistent-generic-constructors": "error", | ||
"@typescript-eslint/consistent-type-assertions": "error", | ||
"@typescript-eslint/no-confusing-non-null-assertion": "warn", | ||
"@typescript-eslint/no-inferrable-types": "warn", | ||
"@typescript-eslint/non-nullable-type-assertion-style": "warn", | ||
"@typescript-eslint/prefer-for-of": "warn", | ||
// "@typescript-eslint/prefer-nullish-coalescing": "warn", | ||
"@typescript-eslint/prefer-optional-chain": "warn", | ||
"@typescript-eslint/prefer-string-starts-ends-with": "error", | ||
"@typescript-eslint/no-meaningless-void-operator": "error", | ||
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn", | ||
"@typescript-eslint/no-unnecessary-condition": "warn", | ||
"@typescript-eslint/no-unnecessary-qualifier": "warn", | ||
"@typescript-eslint/no-unnecessary-type-arguments": "warn", | ||
"@typescript-eslint/prefer-reduce-type-parameter": "warn", | ||
"@typescript-eslint/promise-function-async": "warn", | ||
/* end stylistic rules */ | ||
|
||
/* start recommended rules */ | ||
"no-restricted-globals": [2, "event", "error"], | ||
"@typescript-eslint/no-base-to-string": "warn", | ||
"@typescript-eslint/no-duplicate-enum-values": "error", | ||
"@typescript-eslint/no-duplicate-type-constituents": "warn", | ||
"@typescript-eslint/no-explicit-any": "error", | ||
"@typescript-eslint/no-extra-non-null-assertion": "error", | ||
"@typescript-eslint/no-floating-promises": "warn", | ||
"@typescript-eslint/no-for-in-array": "warn", | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error", | ||
{ | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
destructuredArrayIgnorePattern: "^_", | ||
caughtErrorsIgnorePattern: "^_", | ||
}, | ||
], | ||
"no-implied-eval": "off", | ||
"@typescript-eslint/no-implied-eval": "error", | ||
"no-loss-of-precision": "off", | ||
"@typescript-eslint/no-loss-of-precision": "warn", | ||
"@typescript-eslint/no-misused-new": "error", | ||
"@typescript-eslint/no-misused-promises": [ | ||
"error", | ||
{ checksVoidReturn: false }, | ||
], | ||
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error", | ||
"@typescript-eslint/no-non-null-asserted-optional-chain": "warn", | ||
"@typescript-eslint/no-redundant-type-constituents": "warn", | ||
"@typescript-eslint/no-this-alias": "warn", | ||
"@typescript-eslint/no-unnecessary-type-assertion": "warn", | ||
"@typescript-eslint/no-unnecessary-type-constraint": "warn", | ||
/* TODO eventually turn all these on */ | ||
"@typescript-eslint/no-unsafe-argument": "warn", | ||
// "@typescript-eslint/no-unsafe-assignment": "warn", | ||
// "@typescript-eslint/no-unsafe-call": "warn", | ||
"@typescript-eslint/no-unsafe-declaration-merging": "warn", | ||
"@typescript-eslint/no-unsafe-enum-comparison": "warn", | ||
// "@typescript-eslint/no-unsafe-member-access": "warn", | ||
"@typescript-eslint/no-unsafe-return": "warn", | ||
"@typescript-eslint/prefer-as-const": "warn", | ||
"require-await": "off", | ||
// "@typescript-eslint/require-await": "warn", | ||
"@typescript-eslint/restrict-template-expressions": "warn", | ||
"@typescript-eslint/unbound-method": "off", | ||
"@typescript-eslint/method-signature-style": "error", | ||
}, | ||
reportUnusedDisableDirectives: true, | ||
ignorePatterns: ["__generated__", "__mocks__", "dist", "static"], | ||
overrides: [ | ||
{ | ||
extends: ["plugin:@typescript-eslint/disable-type-checked"], | ||
files: ["webpack.*.js", ".*.cjs"], | ||
rules: { | ||
"@typescript-eslint/no-var-requires": "off", | ||
}, | ||
}, | ||
"extends": "eslint:recommended", | ||
"parserOptions": { | ||
"ecmaVersion": 2021, | ||
"sourceType": "module" | ||
}, | ||
"globals": { | ||
"globalThis": false, //not writable | ||
}, | ||
"rules": { | ||
"no-restricted-globals": [ | ||
2, | ||
"event", "window" | ||
], | ||
"indent": [ | ||
"error", | ||
2 | ||
], | ||
"linebreak-style": [ | ||
"error", | ||
"unix" | ||
], | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"semi": [ | ||
"error", | ||
"always" | ||
] | ||
} | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ | |
**/*.wacz | ||
**/adblock.gz | ||
**/node_modules | ||
**/dist | ||
.tsimp | ||
coverage | ||
dist-wombat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
static/wombat*.js |
Oops, something went wrong.