chore: fix eslint on ts

This commit is contained in:
TonyRL
2024-03-05 14:57:51 +00:00
parent ef800a10bb
commit b360ea9b82
3 changed files with 154 additions and 28 deletions
+26 -25
View File
@@ -2,7 +2,7 @@
"extends": ["eslint:recommended", "plugin:n/recommended", "plugin:unicorn/recommended", "plugin:prettier/recommended", "plugin:yml/recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"root": true,
"plugins": ["prettier", "@stylistic/js", "unicorn", "@typescript-eslint"],
"plugins": ["prettier", "@stylistic", "unicorn", "@typescript-eslint"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
@@ -18,6 +18,7 @@
"no-await-in-loop": 2,
"no-control-regex": 0,
"no-duplicate-imports": 2,
"no-prototype-builtins": 0,
// suggestions
"arrow-body-style": 2,
"block-scoped-var": 2,
@@ -47,6 +48,10 @@
"prefer-object-has-own": 2,
"prefer-regex-literals": ["error", { "disallowRedundantWrapping": true }],
"require-await": 2,
// typescript
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-var-requires": 0,
// plugin specific
"unicorn/consistent-destructuring": 1,
"unicorn/consistent-function-scoping": 1,
@@ -89,37 +94,33 @@
"unicorn/switch-case-braces": ["error", "avoid"],
"unicorn/text-encoding-identifier-case": 0,
// previous eslint formatting rules
"@stylistic/js/arrow-parens": 2,
"@stylistic/js/arrow-spacing": 2,
"@stylistic/js/comma-spacing": 2,
"@stylistic/js/comma-style": 2,
"@stylistic/js/function-call-spacing": 2,
"@stylistic/js/keyword-spacing": 2,
"@stylistic/js/linebreak-style": 2,
"@stylistic/js/lines-around-comment": ["error", { "beforeBlockComment": false }],
"@stylistic/js/no-multiple-empty-lines": 2,
"@stylistic/js/no-trailing-spaces": 2,
"@stylistic/js/rest-spread-spacing": 2,
"@stylistic/js/semi": 2,
"@stylistic/js/space-before-blocks": 2,
"@stylistic/js/space-in-parens": 2,
"@stylistic/js/space-infix-ops": 2,
"@stylistic/js/space-unary-ops": 2,
"@stylistic/js/spaced-comment": 2,
"@stylistic/arrow-parens": 2,
"@stylistic/arrow-spacing": 2,
"@stylistic/comma-spacing": 2,
"@stylistic/comma-style": 2,
"@stylistic/function-call-spacing": 2,
"@stylistic/keyword-spacing": 2,
"@stylistic/linebreak-style": 2,
"@stylistic/lines-around-comment": ["error", { "beforeBlockComment": false }],
"@stylistic/no-multiple-empty-lines": 2,
"@stylistic/no-trailing-spaces": 2,
"@stylistic/rest-spread-spacing": 2,
"@stylistic/semi": 2,
"@stylistic/space-before-blocks": 2,
"@stylistic/space-in-parens": 2,
"@stylistic/space-infix-ops": 2,
"@stylistic/space-unary-ops": 2,
"@stylistic/spaced-comment": 2,
// https://github.com/eslint-community/eslint-plugin-n
"n/no-extraneous-require": ["error", { "allowModules": ["puppeteer-extra-plugin-user-preferences", "puppeteer-extra-plugin-user-data-dir"] }],
"n/no-deprecated-api": 1,
"n/no-missing-import": 0,
"n/no-missing-require": 0,
"n/no-process-exit": 0,
"n/no-unpublished-import": 0,
"n/no-unpublished-require": ["error", { "allowModules": ["tosource"] }],
"prettier/prettier": 0,
"yml/quotes": ["error", { "prefer": "single" }],
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-explicit-any": 0,
"n/no-missing-import": 0,
"n/no-unpublished-import": 0,
"no-prototype-builtins": 0,
"@typescript-eslint/ban-ts-comment": 0
"yml/quotes": ["error", { "prefer": "single" }]
},
"overrides": [
{
+1 -1
View File
@@ -123,7 +123,7 @@
"@babel/preset-env": "7.24.0",
"@babel/preset-typescript": "7.23.3",
"@microsoft/eslint-formatter-sarif": "3.0.0",
"@stylistic/eslint-plugin-js": "1.6.3",
"@stylistic/eslint-plugin": "1.6.3",
"@types/aes-js": "3.1.4",
"@types/crypto-js": "4.2.2",
"@types/eslint": "8.56.5",
+127 -2
View File
@@ -223,9 +223,9 @@ devDependencies:
'@microsoft/eslint-formatter-sarif':
specifier: 3.0.0
version: 3.0.0
'@stylistic/eslint-plugin-js':
'@stylistic/eslint-plugin':
specifier: 1.6.3
version: 1.6.3(eslint@8.57.0)
version: 1.6.3(eslint@8.57.0)(typescript@5.3.3)
'@types/aes-js':
specifier: 3.1.4
version: 3.1.4
@@ -2336,6 +2336,64 @@ packages:
espree: 9.6.1
dev: true
/@stylistic/eslint-plugin-jsx@1.6.3(eslint@8.57.0):
resolution: {integrity: sha512-SRysCIg59Zvn3dJPqHziiHwuni4NNj1et5stAmivmyQ3Cdp2ULCB7tGxCF1OxpkwRlZQue3ZgdiM7EXfJKaf9w==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
eslint: '>=8.40.0'
dependencies:
'@stylistic/eslint-plugin-js': 1.6.3(eslint@8.57.0)
'@types/eslint': 8.56.5
eslint: 8.57.0
estraverse: 5.3.0
picomatch: 4.0.1
dev: true
/@stylistic/eslint-plugin-plus@1.6.3(eslint@8.57.0)(typescript@5.3.3):
resolution: {integrity: sha512-TuwQOdyVGycDPw5XeF7W4f3ZonAVzOAzORSaD2yGAJ0fRAbJ+l/v3CkKzIAqBBwWkc+c2aRMsWtLP2+viBnmlQ==}
peerDependencies:
eslint: '*'
dependencies:
'@types/eslint': 8.56.5
'@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.3.3)
eslint: 8.57.0
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/@stylistic/eslint-plugin-ts@1.6.3(eslint@8.57.0)(typescript@5.3.3):
resolution: {integrity: sha512-v5GwZsPLblWM9uAIdaSi31Sed3XBWlTFQJ3b5upEmj6QsKYivA5nmIYutwqqL133QdVWjmC86pINlx2Muq3uNQ==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
eslint: '>=8.40.0'
dependencies:
'@stylistic/eslint-plugin-js': 1.6.3(eslint@8.57.0)
'@types/eslint': 8.56.5
'@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.3.3)
eslint: 8.57.0
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/@stylistic/eslint-plugin@1.6.3(eslint@8.57.0)(typescript@5.3.3):
resolution: {integrity: sha512-WDa4FjhImp7YcztRaMG09svhKYYhi2Hc4p9ltQRSqyB4fsUUFm+GKzStqqH7xfjHnxacMJaOnaMGRTUqIIZDLA==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
eslint: '>=8.40.0'
dependencies:
'@stylistic/eslint-plugin-js': 1.6.3(eslint@8.57.0)
'@stylistic/eslint-plugin-jsx': 1.6.3(eslint@8.57.0)
'@stylistic/eslint-plugin-plus': 1.6.3(eslint@8.57.0)(typescript@5.3.3)
'@stylistic/eslint-plugin-ts': 1.6.3(eslint@8.57.0)(typescript@5.3.3)
'@types/eslint': 8.56.5
eslint: 8.57.0
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/@szmarczak/http-timer@4.0.6:
resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==}
engines: {node: '>=10'}
@@ -2691,6 +2749,14 @@ packages:
- supports-color
dev: true
/@typescript-eslint/scope-manager@6.21.0:
resolution: {integrity: sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==}
engines: {node: ^16.0.0 || >=18.0.0}
dependencies:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/visitor-keys': 6.21.0
dev: true
/@typescript-eslint/scope-manager@7.1.1:
resolution: {integrity: sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -2719,11 +2785,38 @@ packages:
- supports-color
dev: true
/@typescript-eslint/types@6.21.0:
resolution: {integrity: sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==}
engines: {node: ^16.0.0 || >=18.0.0}
dev: true
/@typescript-eslint/types@7.1.1:
resolution: {integrity: sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==}
engines: {node: ^16.0.0 || >=18.0.0}
dev: true
/@typescript-eslint/typescript-estree@6.21.0(typescript@5.3.3):
resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
dependencies:
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/visitor-keys': 6.21.0
debug: 4.3.4
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.3
semver: 7.6.0
ts-api-utils: 1.2.1(typescript@5.3.3)
typescript: 5.3.3
transitivePeerDependencies:
- supports-color
dev: true
/@typescript-eslint/typescript-estree@7.1.1(typescript@5.3.3):
resolution: {integrity: sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -2746,6 +2839,25 @@ packages:
- supports-color
dev: true
/@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.3.3):
resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==}
engines: {node: ^16.0.0 || >=18.0.0}
peerDependencies:
eslint: ^7.0.0 || ^8.0.0
dependencies:
'@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0)
'@types/json-schema': 7.0.15
'@types/semver': 7.5.8
'@typescript-eslint/scope-manager': 6.21.0
'@typescript-eslint/types': 6.21.0
'@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3)
eslint: 8.57.0
semver: 7.6.0
transitivePeerDependencies:
- supports-color
- typescript
dev: true
/@typescript-eslint/utils@7.1.1(eslint@8.57.0)(typescript@5.3.3):
resolution: {integrity: sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -2765,6 +2877,14 @@ packages:
- typescript
dev: true
/@typescript-eslint/visitor-keys@6.21.0:
resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==}
engines: {node: ^16.0.0 || >=18.0.0}
dependencies:
'@typescript-eslint/types': 6.21.0
eslint-visitor-keys: 3.4.3
dev: true
/@typescript-eslint/visitor-keys@7.1.1:
resolution: {integrity: sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==}
engines: {node: ^16.0.0 || >=18.0.0}
@@ -7861,6 +7981,11 @@ packages:
engines: {node: '>=8.6'}
dev: true
/picomatch@4.0.1:
resolution: {integrity: sha512-xUXwsxNjwTQ8K3GnT4pCJm+xq3RUPQbmkYJTP5aFIfNIvbcc/4MUxgBaaRSZJ6yGJZiGSyYlM6MzwTsRk8SYCg==}
engines: {node: '>=12'}
dev: true
/pidtree@0.6.0:
resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==}
engines: {node: '>=0.10'}