Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS eslint rules cleanup #1749

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9f41065
Improve HttpRequests
flevi29 Oct 9, 2024
a32ed2d
Convert props to private, refactor, adapt tests
flevi29 Oct 9, 2024
118534d
Fix type issue
flevi29 Oct 9, 2024
942e889
Improve timeout, refactor
flevi29 Oct 10, 2024
455d8c3
Misc
flevi29 Oct 10, 2024
d1b442b
Fix browser env test
flevi29 Oct 10, 2024
c044319
Fix Node.js 18 fetch signal issue
flevi29 Oct 10, 2024
e6236f6
Add extra RequestInit for search
flevi29 Oct 11, 2024
4a49790
Refactor
flevi29 Oct 11, 2024
0e41c86
Fix type issues
flevi29 Oct 11, 2024
1949134
Fix some types
flevi29 Oct 11, 2024
ace3412
Make extraRequestInit function as it originally did
flevi29 Oct 11, 2024
3854e13
Remove unnecessary transformation
flevi29 Oct 11, 2024
d73d58d
Revert some type changes
flevi29 Oct 11, 2024
2d4849d
Optimize
flevi29 Oct 11, 2024
8825781
Merge branch 'main' into improve-http-request
flevi29 Oct 14, 2024
a1adb88
const comments ans unsafe calls removed
Barabasbalazs Oct 21, 2024
af14ef9
cast some any's
Barabasbalazs Oct 21, 2024
ecd3c18
removed and fixed no-unsafe-member-access
Barabasbalazs Oct 21, 2024
81b1357
removed no unsafe args, and cast some unsafe ones
Barabasbalazs Oct 21, 2024
764e70a
Merge commit '8825781' into ts-eslint-rules-cleanup
Barabasbalazs Oct 21, 2024
604bfcb
adjusted all no-unsafe-member-access
Barabasbalazs Oct 21, 2024
0fae2c3
removed floating promises
Barabasbalazs Oct 21, 2024
89da8ff
removed and adjusted unsafe returns and unsafe assignenments
Barabasbalazs Oct 21, 2024
9c716ba
cleaned up unused rules
Barabasbalazs Oct 22, 2024
586ec54
fixed up unused vars
Barabasbalazs Oct 22, 2024
4777929
removed explicit any's
Barabasbalazs Oct 22, 2024
e250666
changed void to promise.all for unawaited promises
Barabasbalazs Oct 22, 2024
2764b91
correctly casting error and put back the eslint exception so the clie…
Barabasbalazs Oct 22, 2024
4c6678c
updated node-ts test
Barabasbalazs Oct 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,10 @@ module.exports = [
rules: {
...config.rules,
"tsdoc/syntax": "error",
// @TODO: Remove the ones between "~~", adapt code
// ~~
"@typescript-eslint/prefer-as-const": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-floating-promises": "off",
// ~~
"@typescript-eslint/array-type": ["warn", { default: "array-simple" }],
// @TODO: Should be careful with this rule, should leave it be and disable
// it within files where necessary with explanations
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": [
"error",
// argsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#argsignorepattern
// varsIgnorePattern: https://eslint.org/docs/latest/rules/no-unused-vars#varsignorepattern
{ args: "all", argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
],
// @TODO: Not recommended to disable rule, should instead disable locally
// with explanation
"@typescript-eslint/ban-ts-ignore": "off",
},
})),
// Vitest linting for test files
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"test": "vitest run --coverage",
"types:watch": "nodemon --config nodemon.json",
"types": "yarn tsc",
"test:env:browser": "yarn build && yarn --cwd tests/env/express && yarn --cwd tests/env/express test",
"test:env:browser": "yarn build && node scripts/copy-umd-file.js --to ./tests/env/express/public && yarn --cwd tests/env/express && yarn --cwd tests/env/express test",
"test:watch": "vitest watch",
"test:coverage": "yarn test",
"test:ci": "yarn test",
Expand Down
16 changes: 16 additions & 0 deletions scripts/copy-umd-file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { parseArgs } = require("node:util");
const { resolve, join, basename } = require("node:path");
const { copyFileSync } = require("node:fs");
const pkg = require("../package.json");

const {
values: { to },
} = parseArgs({ options: { to: { type: "string" } } });

if (to === undefined) {
throw new Error("required argument `to` missing");
}

const umdAbsolutePath = resolve(__dirname, join("..", pkg.jsdelivr));

copyFileSync(umdAbsolutePath, join(to, basename(pkg.jsdelivr)));
Loading