This is an automated email from the ASF dual-hosted git repository.
bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new a58e0d149a1 Migrate type linting from typescript-eslint to oxlint
(#76931)
a58e0d149a1 is described below
commit a58e0d149a174c6fe2ea61e32aa7249d424bd881
Author: Brent Bovenzi <[email protected]>
AuthorDate: Tue Nov 17 19:07:06 2026 -0500
Migrate type linting from typescript-eslint to oxlint (#76931)
* UI: Run the type-aware lint rules in oxlint
typescript-eslint's type-aware rules made ESLint build a full TypeScript
program on every run, so even a commit touching a few files took around
ten seconds in the prek hook. oxlint runs the same rules through
tsgolint, which uses TypeScript 7's Go compiler and needs no change to
the `typescript` package that typescript-eslint still depends on.
With no type-aware rules left, ESLint stops loading the tsconfigs. Its
scope analysis then needs the app's `lib` to know globals such as
`globalThis`.
Co-Authored-By: Claude <[email protected]>
* Drop the type-aware rules oxlint now runs from the ESLint config
ESLint no longer loads a tsconfig, so any of these rules left on there
throws instead of running twice. Only eslint-plugin-oxlint turned them
off, and it can lag behind oxlint's rule list.
Co-Authored-By: Claude <[email protected]>
---------
Co-authored-by: Claude <[email protected]>
---
airflow-core/src/airflow/ui/.oxlintrc.json | 79 ++-
airflow-core/src/airflow/ui/package.json | 1 +
airflow-core/src/airflow/ui/pnpm-lock.yaml | 101 ++-
airflow-core/src/airflow/ui/rules/typescript.js | 814 +-----------------------
airflow-core/src/airflow/ui/tsconfig.node.json | 2 -
5 files changed, 153 insertions(+), 844 deletions(-)
diff --git a/airflow-core/src/airflow/ui/.oxlintrc.json
b/airflow-core/src/airflow/ui/.oxlintrc.json
index 94f79fd0440..198d0449223 100644
--- a/airflow-core/src/airflow/ui/.oxlintrc.json
+++ b/airflow-core/src/airflow/ui/.oxlintrc.json
@@ -1,5 +1,8 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
+ "options": {
+ "typeAware": true
+ },
"plugins": ["jsx-a11y", "react", "unicorn", "typescript"],
"jsPlugins": ["eslint-plugin-perfectionist", "@stylistic/eslint-plugin"],
"categories": {
@@ -496,6 +499,7 @@
"no-unused-expressions": "error",
"no-use-before-define": "error",
"no-useless-constructor": "error",
+ "prefer-destructuring": "error",
"typescript/adjacent-overload-signatures": "error",
"typescript/array-type": [
"error",
@@ -503,6 +507,7 @@
"default": "generic"
}
],
+ "typescript/await-thenable": "error",
"typescript/ban-ts-comment": [
"error",
{
@@ -516,6 +521,7 @@
"typescript/class-literal-property-style": ["error", "getters"],
"typescript/consistent-generic-constructors": ["error", "constructor"],
"typescript/consistent-indexed-object-style": ["error", "record"],
+ "typescript/consistent-return": "error",
"typescript/consistent-type-assertions": [
"error",
{
@@ -524,12 +530,19 @@
}
],
"typescript/consistent-type-definitions": ["error", "type"],
+ "typescript/consistent-type-exports": [
+ "error",
+ {
+ "fixMixedExportsWithInlineTypeSpecifier": true
+ }
+ ],
"typescript/consistent-type-imports": [
"error",
{
"fixStyle": "inline-type-imports"
}
],
+ "typescript/dot-notation": "error",
"typescript/explicit-member-accessibility": [
"error",
{
@@ -541,17 +554,34 @@
}
],
"typescript/method-signature-style": ["error", "property"],
+ "typescript/no-array-delete": "error",
+ "typescript/no-base-to-string": "error",
+ "typescript/no-confusing-void-expression": [
+ "error",
+ {
+ "ignoreArrowShorthand": true,
+ "ignoreVoidOperator": true
+ }
+ ],
"typescript/no-duplicate-enum-values": "error",
+ "typescript/no-duplicate-type-constituents": "error",
"typescript/no-dynamic-delete": "error",
"typescript/no-empty-object-type": "error",
"typescript/no-explicit-any": "error",
"typescript/no-extraneous-class": "error",
+ "typescript/no-floating-promises": "error",
+ "typescript/no-for-in-array": "error",
+ "typescript/no-implied-eval": "error",
"typescript/no-import-type-side-effects": "error",
"typescript/no-invalid-void-type": "error",
+ "typescript/no-meaningless-void-operator": "error",
"typescript/no-misused-new": "error",
+ "typescript/no-misused-promises": "error",
+ "typescript/no-mixed-enums": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-nullish-coalescing": "error",
"typescript/no-non-null-assertion": "warn",
+ "typescript/no-redundant-type-constituents": "error",
"typescript/no-require-imports": "error",
"typescript/no-restricted-types": [
"error",
@@ -567,11 +597,26 @@
}
],
"typescript/no-this-alias": "error",
+ "typescript/no-unnecessary-boolean-literal-compare": "error",
+ "typescript/no-unnecessary-condition": "error",
"typescript/no-unnecessary-parameter-property-assignment": "error",
+ "typescript/no-unnecessary-qualifier": "error",
+ "typescript/no-unnecessary-template-expression": "error",
+ "typescript/no-unnecessary-type-arguments": "error",
+ "typescript/no-unnecessary-type-assertion": "error",
"typescript/no-unnecessary-type-constraint": "error",
+ "typescript/no-unnecessary-type-parameters": "error",
+ "typescript/no-unsafe-argument": "error",
+ "typescript/no-unsafe-assignment": "error",
+ "typescript/no-unsafe-call": "error",
"typescript/no-unsafe-declaration-merging": "error",
+ "typescript/no-unsafe-enum-comparison": "error",
+ "typescript/no-unsafe-member-access": "error",
+ "typescript/no-unsafe-return": "error",
+ "typescript/no-unsafe-unary-minus": "error",
"typescript/no-useless-empty-export": "error",
"typescript/no-wrapper-object-types": "error",
+ "typescript/only-throw-error": "error",
"typescript/parameter-properties": [
"error",
{
@@ -580,8 +625,10 @@
],
"typescript/prefer-as-const": "error",
"typescript/prefer-enum-initializers": "error",
+ "typescript/prefer-find": "error",
"typescript/prefer-for-of": "error",
"typescript/prefer-function-type": "error",
+ "typescript/prefer-includes": "error",
"typescript/prefer-literal-enum-member": [
"error",
{
@@ -589,8 +636,38 @@
}
],
"typescript/prefer-namespace-keyword": "error",
+ "typescript/prefer-nullish-coalescing": [
+ "error",
+ {
+ "ignoreConditionalTests": false,
+ "ignoreMixedLogicalExpressions": false
+ }
+ ],
+ "typescript/prefer-optional-chain": "error",
+ "typescript/prefer-readonly": "error",
+ "typescript/prefer-reduce-type-parameter": "error",
+ "typescript/prefer-regexp-exec": "error",
+ "typescript/prefer-return-this-type": "error",
+ "typescript/prefer-string-starts-ends-with": "error",
+ "typescript/require-array-sort-compare": "error",
+ "typescript/require-await": "error",
+ "typescript/restrict-plus-operands": "error",
+ "typescript/restrict-template-expressions": [
+ "error",
+ {
+ "allowNumber": true
+ }
+ ],
+ "typescript/strict-boolean-expressions": [
+ "error",
+ {
+ "allowNullableBoolean": true
+ }
+ ],
+ "typescript/switch-exhaustiveness-check": "error",
"typescript/triple-slash-reference": "error",
- "typescript/unified-signatures": "error"
+ "typescript/unified-signatures": "error",
+ "typescript/use-unknown-in-catch-callback-variable": "error"
},
"plugins": ["typescript"]
},
diff --git a/airflow-core/src/airflow/ui/package.json
b/airflow-core/src/airflow/ui/package.json
index c55273bfe90..377adc9e9cb 100644
--- a/airflow-core/src/airflow/ui/package.json
+++ b/airflow-core/src/airflow/ui/package.json
@@ -109,6 +109,7 @@
"openapi-merge-cli": "^2.0.3",
"oxfmt": "0.78.0",
"oxlint": "1.93.0",
+ "oxlint-tsgolint": "7.0.2006",
"ts-morph": "^27.0.2",
"typescript": "^6.0.3",
"typescript-eslint": "^8.72.1",
diff --git a/airflow-core/src/airflow/ui/pnpm-lock.yaml
b/airflow-core/src/airflow/ui/pnpm-lock.yaml
index bf5c0ddeb78..e9be5974bc3 100644
--- a/airflow-core/src/airflow/ui/pnpm-lock.yaml
+++ b/airflow-core/src/airflow/ui/pnpm-lock.yaml
@@ -253,7 +253,7 @@ importers:
version: 6.10.2([email protected]([email protected]))
eslint-plugin-oxlint:
specifier: 1.90.0
- version: 1.90.0([email protected])
+ version: 1.90.0([email protected]([email protected]))
eslint-plugin-perfectionist:
specifier: ^5.12.1
version: 5.12.1([email protected]([email protected]))([email protected])
@@ -286,7 +286,10 @@ importers:
version: 0.78.0
oxlint:
specifier: 1.93.0
- version: 1.93.0
+ version: 1.93.0([email protected])
+ oxlint-tsgolint:
+ specifier: 7.0.2006
+ version: 7.0.2006
ts-morph:
specifier: ^27.0.2
version: 27.0.2
@@ -835,56 +838,48 @@ packages:
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
- libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-G+lUaQk94Vo+4byyd8X2+pPXtd7wObpdbvBC8xyozZD0ROSVBI3XpNNR6HECkJq4Q51AwLuJG81f4x+4eqvSrw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
- libc: [musl]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-r76PAZf9/ZgF/iDRaIf8nLsr4x6ZHe/j2QLmWUjoQ46Sa11qMO68a5u5iux3y8vLzqYTS/xtKO9PjjMfyk5png==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
- libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-SQiXTt/c4aVoRXkJvhf4Y/sA1XYe3XjSMDbdX5PiAssBuHERoGtncQXz0KKWkXPejWTKlAL4mZSQZdHOCiw7TA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
- libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-VNB3wFUx/rAqwVNW+uyXxb+c0HUrmcS51UPkFMDWJY95c6Tck6u6HOyVLsqiYoC8kh2mGlwanYmjb/R2McvN0A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
- libc: [musl]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-1nbI0Y7SXwx2f4mJmKt58MaDdjAcoaYM90pBMGdcZCsTW2taFW1/MUi3uQGRPAN2n+3PldCdO9m+D6x+gU/heg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
- libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-I2z2ISPjrl3CSRF5fmQkNnoh46UVU1GjM1V0+COJyNZcj0SDNM4DrPP2/gXCX38YJ1P2BL6sF2VdsJ+pEYEbJQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
- libc: [glibc]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-YHt5nKKFxT4SruI57FHnEhGRSDuoFqNoAM3moYCClg70mjjS39gBBbdzaZv+N0otdzvQVuHTPu3jFu5tpqC3XQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
- libc: [musl]
'@oxfmt/[email protected]':
resolution: {integrity:
sha512-WH21lBMU+LYzF7aMeozTZlyc44oa2F+I5OtQ7RwuidCDoAxgTyN1s34rx0PBYrio56+2G88U9VOnYJsyV7VMHQ==}
@@ -910,6 +905,36 @@ packages:
cpu: [x64]
os: [win32]
+ '@oxlint-tsgolint/[email protected]':
+ resolution: {integrity:
sha512-uc0MEHXZUDW23Zmo5X28eSNeSnP17jKnh9GiehpVZqhfy99ks8spyXT5Llar3tjDN7ppnQN0Qd9FK6WNkdD+fQ==}
+ cpu: [arm64]
+ os: [darwin]
+
+ '@oxlint-tsgolint/[email protected]':
+ resolution: {integrity:
sha512-+x1/pa3S3VMC9cif8XKTOCQUuqRT+wu1Ix+FK5svXa2xbXCuE7+4S0SfmuSnK/mk9AI5+xBxZFhILxmCPUZ1hA==}
+ cpu: [x64]
+ os: [darwin]
+
+ '@oxlint-tsgolint/[email protected]':
+ resolution: {integrity:
sha512-90v7HX8m54kHXn5DpjNEN18Fb7xwJMREe/wji3USyAf9pTMv7a3qZ3cPoLViIcIzxPLmkcYZIs1j1H3Z2gbVLA==}
+ cpu: [arm64]
+ os: [linux]
+
+ '@oxlint-tsgolint/[email protected]':
+ resolution: {integrity:
sha512-/k0wsEqHiA5dWBJYuld3Vecv6bIhKCasxpho/aFkvh870Qox33MuTkKUGWIVm/njAxw7W4pu1a/Xfa3jwuKuPQ==}
+ cpu: [x64]
+ os: [linux]
+
+ '@oxlint-tsgolint/[email protected]':
+ resolution: {integrity:
sha512-CQT5sqcLZLNZSWLzUUEjQmp74UX8h1agp3ZJ8pfRktHbx6gfBa8a7CjrnRrZ9VXlwnXVkpw7m5KBO6y+S5MQRA==}
+ cpu: [arm64]
+ os: [win32]
+
+ '@oxlint-tsgolint/[email protected]':
+ resolution: {integrity:
sha512-VZsGowXcp3vQNkjoGeVCOTf4aGrRpRk6bBJWhefnJVPr6z+dX+LKqqHfwaqnFvg66Q2iJpXqklRW38YO21ee+Q==}
+ cpu: [x64]
+ os: [win32]
+
'@oxlint/[email protected]':
resolution: {integrity:
sha512-KKw70pbD5Pvq3G2lJ+WQ71XPMjCmg37rkSe2+mDqCRP3PoTSdDMuEi4UOnE8JBtyNM7bek61EC2s0Jt7S7u+Sg==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -957,56 +982,48 @@ packages:
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
- libc: [glibc]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-zM8Fd/K8sqGvsBcJBZ3oVZ3ctGWbszA08IaGt5gFFF5RcunppAI/ZnAXbouABvnWeJ//S44KKlfPZnDDbeiphg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
- libc: [musl]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-7qKCnvhZKDXJG2pdbLazd2hw4FxjJHbZOFrrbzyy5PdHfPLH9vnNUa1le01A8uItZuYKPBPncH+HCoEiFT4SgA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
- libc: [glibc]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-2pgulxC6G8V5wE750NJE/fRkf9aO6i6yoj10wyaR2EdiNtan4OemsOtsQ0ZTXGdY8Q3IoTmlND3GYvjJsvikYg==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
- libc: [glibc]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-yWsn6Gg2PnGG5jlyDz5+pHGiMTMiy4adaa4WRMzDgzB8efaShk1JMmTHIBSVLQMh0tYXRs4CN5uJCO79r4Mi4g==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [riscv64]
os: [linux]
- libc: [musl]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-WCn5plwp/ezS2RDPQKp0/EXEVRr9/dDexUdRKmsMFqzNM5xBSZ1wbsi3PuMk1VfkMRnI5BuazCsziCWMXRDOlw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
- libc: [glibc]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-F2CGjb9LAkzH+IYTZSzd1klQ1vk5z6Utjax64WeLByCkYXbVDbsun+Oy2hLfW2MDSKCvW+jwy/9ld0EPgdeu+A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
- libc: [glibc]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-plf5DE2objcG8Tf7mXRuRa8tT8rzDkpjqXQtKoGsKHWkpgsialbON1+cCtoSEUTVbQUjXvuAm8vV9+3rR0yCBw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
- libc: [musl]
'@oxlint/[email protected]':
resolution: {integrity:
sha512-Kp2yJrKvoTe9FfKdO/xwLNUbs2bYTMKx0+aoQD1s0h/Tx0kSgtHSdGmrk8tTKdluosjFbo88qYRIaNIX43AfFw==}
@@ -1086,42 +1103,36 @@ packages:
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
- libc: [glibc]
'@rolldown/[email protected]':
resolution: {integrity:
sha512-4oqWItLLYt7IceOnElCct8T2ek5p7PmD7LN04TRJRXGo5f3HtKTgGH6PhYRFK4C2ICkq/LMUU0BVPvvlAKhm8g==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [arm64]
os: [linux]
- libc: [musl]
'@rolldown/[email protected]':
resolution: {integrity:
sha512-+AkRly5SrCEgnPhGRfub7pucASYEC2fTsxZg7VCcnozpA2+Wn/gCYy1t7LuJS67/xyJu/7noYBJncDUkbwgw2A==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [ppc64]
os: [linux]
- libc: [glibc]
'@rolldown/[email protected]':
resolution: {integrity:
sha512-Ttg1r9vVykMnQrE/GwYO9icKtXiuiMfRe/w74xJkeoVuvhRG+WtT6LEMOf58Yl63yd77lhHzO8Y55R8CC3XALA==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [s390x]
os: [linux]
- libc: [glibc]
'@rolldown/[email protected]':
resolution: {integrity:
sha512-xX1Tt4o5jUMma0vJsXp5eRZA9nOuyigb2dKJMMzZRmzMxLYGE9PaKKSqHPzPvSQgM8ZOEacSTQwDQcwWfh0xmQ==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
- libc: [glibc]
'@rolldown/[email protected]':
resolution: {integrity:
sha512-4VVlGI5K2kociZlW3lSN8VjG3TW5yQIlAcfCdBXMgGjJxZll15Fa4ocRHXHvIVVnwlibCw/NQajJrNDiqqpiiw==}
engines: {node: ^20.19.0 || >=22.12.0}
cpu: [x64]
os: [linux]
- libc: [musl]
'@rolldown/[email protected]':
resolution: {integrity:
sha512-PApTsgH1jLYuyy3tSCz9De82Gq5qXwi7vImVZhEzTgX1C4150Cp5M2ZfL3pLvbCvbEHL0oJeC6pd6podtv8Y5w==}
@@ -3351,28 +3362,24 @@ packages:
engines: {node: '>= 12.0.0'}
cpu: [arm64]
os: [linux]
- libc: [glibc]
[email protected]:
resolution: {integrity:
sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==}
engines: {node: '>= 12.0.0'}
cpu: [arm64]
os: [linux]
- libc: [musl]
[email protected]:
resolution: {integrity:
sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==}
engines: {node: '>= 12.0.0'}
cpu: [x64]
os: [linux]
- libc: [glibc]
[email protected]:
resolution: {integrity:
sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==}
engines: {node: '>= 12.0.0'}
cpu: [x64]
os: [linux]
- libc: [musl]
[email protected]:
resolution: {integrity:
sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==}
@@ -3772,6 +3779,10 @@ packages:
vite-plus:
optional: true
+ [email protected]:
+ resolution: {integrity:
sha512-5B3UtH71kycPHUC1kFEIffivEAs49SUmkJuHZOZnTY0NPj4legp0bcsCQucuLVNCoJzDucS68P2C4WIhP+LypQ==}
+ hasBin: true
+
[email protected]:
resolution: {integrity:
sha512-19JMsQFX+YvEbcUTFQxjTwhvs0Ibg0D6CFneSLgpwnACWcY/6LjhpGpkPodh0T5aIT1pjMTLlYaeBFzaVgugTA==}
engines: {node: ^20.19.0 || >=22.12.0}
@@ -5420,6 +5431,24 @@ snapshots:
'@oxfmt/[email protected]':
optional: true
+ '@oxlint-tsgolint/[email protected]':
+ optional: true
+
+ '@oxlint-tsgolint/[email protected]':
+ optional: true
+
+ '@oxlint-tsgolint/[email protected]':
+ optional: true
+
+ '@oxlint-tsgolint/[email protected]':
+ optional: true
+
+ '@oxlint-tsgolint/[email protected]':
+ optional: true
+
+ '@oxlint-tsgolint/[email protected]':
+ optional: true
+
'@oxlint/[email protected]':
optional: true
@@ -7553,10 +7582,10 @@ snapshots:
safe-regex-test: 1.1.0
string.prototype.includes: 2.0.1
- [email protected]([email protected]):
+ [email protected]([email protected]([email protected])):
dependencies:
jsonc-parser: 3.3.1
- oxlint: 1.93.0
+ oxlint: 1.93.0([email protected])
[email protected]([email protected]([email protected]))([email protected]):
dependencies:
@@ -9005,7 +9034,16 @@ snapshots:
'@oxfmt/binding-win32-ia32-msvc': 0.78.0
'@oxfmt/binding-win32-x64-msvc': 0.78.0
- [email protected]:
+ [email protected]:
+ optionalDependencies:
+ '@oxlint-tsgolint/darwin-arm64': 7.0.2006
+ '@oxlint-tsgolint/darwin-x64': 7.0.2006
+ '@oxlint-tsgolint/linux-arm64': 7.0.2006
+ '@oxlint-tsgolint/linux-x64': 7.0.2006
+ '@oxlint-tsgolint/win32-arm64': 7.0.2006
+ '@oxlint-tsgolint/win32-x64': 7.0.2006
+
+ [email protected]([email protected]):
optionalDependencies:
'@oxlint/binding-android-arm-eabi': 1.93.0
'@oxlint/binding-android-arm64': 1.93.0
@@ -9026,6 +9064,7 @@ snapshots:
'@oxlint/binding-win32-arm64-msvc': 1.93.0
'@oxlint/binding-win32-ia32-msvc': 1.93.0
'@oxlint/binding-win32-x64-msvc': 1.93.0
+ oxlint-tsgolint: 7.0.2006
[email protected]:
dependencies:
diff --git a/airflow-core/src/airflow/ui/rules/typescript.js
b/airflow-core/src/airflow/ui/rules/typescript.js
index 55d7404072b..db32f34dcb8 100644
--- a/airflow-core/src/airflow/ui/rules/typescript.js
+++ b/airflow-core/src/airflow/ui/rules/typescript.js
@@ -55,13 +55,11 @@ export const typescriptRules = /** @type {const} @satisfies
{FlatConfig.Config}
ecmaVersion: "latest",
/**
- * Get `tsconfig.json` from the root directory.
+ * oxlint runs the type-aware rules, so ESLint no longer loads a
tsconfig. Without one, scope
+ * analysis needs the app's `lib` to know globals such as `globalThis`;
otherwise
+ * `unicorn/consistent-function-scoping` flags functions that only use
them.
*/
- project: [
- `${import.meta.dirname}/../tsconfig.app.json`,
- `${import.meta.dirname}/../tsconfig.dev.json`,
- `${import.meta.dirname}/../tsconfig.node.json`,
- ],
+ lib: ["es2022", "dom", "dom.iterable"],
/**
* Default to ESM.
@@ -113,21 +111,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/array-type`]: [ERROR, { default: "generic" }],
- /**
- * Avoid await on non thenable values.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = await 42;
- *
- * // ✅ Correct
- * const bar = await Promise.resolve(42);
- * ```
- * @see
[@typescript-eslint/await-thenable](https://typescript-eslint.io/rules/await-thenable/)
- */
- [`${typescriptNamespace}/await-thenable`]: ERROR,
-
/**
* `@ts-comment` rules:
*
@@ -248,46 +231,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/consistent-indexed-object-style`]: [ERROR,
"record"],
- /**
- * Require `return` statements to either always or never specify values.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = (): undefined => {}
- * const bar = (flag: boolean): undefined => {
- * if (flag) {
- * return foo()
- * }
- * return;
- * }
- * const baz = async (flag: boolean): Promise<undefined> {
- * if (flag) {
- * return;
- * }
- * return foo();
- * }
- *
- * // ✅ Correct
- * const foo = (): void => {}
- * const bar = (flag: boolean): void => {
- * if (flag) {
- * return foo()
- * }
- * return;
- * }
- * const baz = async (flag: boolean): Promise<void | number> {
- * if (flag) {
- * return 42;
- * }
- * return;
- * }
- * ```
- * @see
[@typescript-eslint/consistent-return](https://typescript-eslint.io/rules/consistent-return)
- * @see
[consistent-return](https://eslint.org/docs/latest/rules/consistent-return)
- */
- [`${typescriptNamespace}/consistent-return`]: ERROR,
-
/**
* Use `as` assertion.
*
@@ -321,29 +264,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/consistent-type-definitions`]: [ERROR, "type"],
- /**
- * Enforce specifying generic type arguments on constructor name of
- * a constructor call.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const x = 1;
- * type T = number;
- * export { x, T };
- *
- * // ✅ Correct
- * const x = 1;
- * type T = number;
- * export { x, type T };
- * ```
- * @see
[@typescript-eslint/consistent-type-exports](https://typescript-eslint.io/rules/consistent-type-exports/)
- */
- [`${typescriptNamespace}/consistent-type-exports`]: [
- ERROR,
- { fixMixedExportsWithInlineTypeSpecifier: true },
- ],
-
/**
* Enforce "typed imports".
*
@@ -376,22 +296,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/default-param-last`]: ERROR,
- /**
- * Enforce `dot.notation` instead of `square["bracket"]["notation"]`.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = bar["baz"];
- *
- * // ✅ Correct
- * const foo = bar.baz;
- * const bar = foo[foo]; // Dynamic access is allowed.
- * ```
- * @see
[@typescript-eslint/dot-notation](https://typescript-eslint.io/rules/dot-notation/)
- */
- [`${typescriptNamespace}/dot-notation`]: ERROR,
-
/**
* When working with classes, let's be explicit about accessibility.
*
@@ -502,47 +406,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-array-constructor`]: ERROR,
- /**
- * Disallow using the `delete` operator on array values.
- *
- * @see
[@typescript-eslint/no-array-delete](https://typescript-eslint.io/rules/no-array-delete/)
- */
- [`${typescriptNamespace}/no-array-delete`]: ERROR,
-
- /**
- * Avoid `.toString()` without a useful return type.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = ({}).toString();
- *
- * // ✅ Correct
- * const foo = (42).toString();
- * ```
- * @see
[@typescript-eslint/no-base-to-string](https://typescript-eslint.io/rules/no-base-to-string/)
- */
- [`${typescriptNamespace}/no-base-to-string`]: ERROR,
-
- /**
- * Require expressions of type void to appear in statement position.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const response = alert('Are you sure?');
- * console.log(alert('Are you sure?'));
- *
- * // ✅ Correct
- * alert('Hello, world!');
- * ```
- * @see
[@typescript-eslint/no-confusing-void-expression](https://typescript-eslint.io/rules/no-confusing-void-expression/)
- */
- [`${typescriptNamespace}/no-confusing-void-expression`]: [
- ERROR,
- { ignoreArrowShorthand: true, ignoreVoidOperator: true },
- ],
-
/**
* Disallow duplicate enum member values.
*
@@ -564,23 +427,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-duplicate-enum-values`]: ERROR,
- /**
- * Disallow duplicate constituents of union and intersection types.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * type StringOrNumber = string | string | number;
- * type ThisOrThat = { that: string } & { that: string };
- *
- * // ✅ Correct
- * type StringOrNumber = string | number;
- * type ThisOrThat = { this: string } & { that: string };
- * ```
- * @see
[@typescript-eslint/no-duplicate-type-constituents](https://typescript-eslint.io/rules/no-duplicate-type-constituents/)
- */
- [`${typescriptNamespace}/no-duplicate-type-constituents`]: ERROR,
-
/**
* Avoid `delete` of dynamic properties.
*
@@ -652,62 +498,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-extraneous-class`]: ERROR,
- /**
- * Let's avoid floating (unhandled) promises.
- *
- * @example
- * ```typescript
- * const example = async () => "foo";
- *
- * // ❌ Incorrect
- * example();
- *
- * // ✅ Correct
- * void example();
- * example().then(console.log).catch(console.error);`
- * ```
- * @see
[@typescript-eslint/no-floating-promises](https://typescript-eslint.io/rules/no-floating-promises/)
- */
- [`${typescriptNamespace}/no-floating-promises`]: ERROR,
-
- /**
- * Use `for/of`, or better yet `map` or `forEach`.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * for (const key in foo) {
- * console.log(key);
- * }
- *
- * // ✅ Correct
- * Object.keys(foo).forEach(console.log);
- *
- * for (const key of Object.keys(foo)) {
- * console.log(key);
- * }
- * ```
- * @see
[@typescript-eslint/no-for-in-array](https://typescript-eslint.io/rules/no-for-in-array/)
- */
- [`${typescriptNamespace}/no-for-in-array`]: ERROR,
-
- /**
- * This is super insecure, avoid it at all costs.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const timeout = setTimeout("alert(`Hi!`);", 100);
- * const fn = new Function("a", "b", "return a + b");
- *
- * // ✅ Correct
- * const timeout = setTimeout(() => alert(`Hi!`), 100);
- * const fn = (a, b) => a + b;
- * ```
- * @see
[@typescript-eslint/no-implied-eval](https://typescript-eslint.io/rules/no-implied-eval/)
- */
- [`${typescriptNamespace}/no-implied-eval`]: ERROR,
-
/**
* Enforce the use of top-level import type qualifier when an import only
has specifiers with inline type qualifiers.
*
@@ -781,21 +571,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-loop-func`]: ERROR,
- /**
- * Disallow the `void` operator except when used to discard a value.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * void (() => undefined)();
- *
- * // ✅ Correct
- * void (() => "value")();
- * ```
- * @see
[@typescript-eslint/no-meaningless-void-operator](https://typescript-eslint.io/rules/no-meaningless-void-operator/)
- */
- [`${typescriptNamespace}/no-meaningless-void-operator`]: ERROR,
-
/**
* Avoid missuses of the `new` declaration.
*
@@ -815,48 +590,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-misused-new`]: ERROR,
- /**
- * Avoid missuses of promises.
- *
- * @example
- * ```typescript
- * const aPromise = Promise.resolve("foo");
- *
- * // ❌ Incorrect
- * aPromise ? "foo" : "bar";
- *
- * // ✅ Correct
- * (await aPromise) ? "foo" : "bar";
- * ```
- * @see
[@typescript-eslint/no-misused-promises](https://typescript-eslint.io/rules/no-misused-promises/)
- */
- [`${typescriptNamespace}/no-misused-promises`]: ERROR,
-
- /**
- * Disallow enums from having both number and string members.
- *
- * @example
- * ```typescript
- * const aPromise = Promise.resolve("foo");
- *
- * // ❌ Incorrect
- * const enum Status {
- * Unknown,
- * Closed = 1,
- * Open = 'open',
- * }
- *
- * // ✅ Correct
- * const enum Status {
- * Unknown = 0,
- * Closed = 2,
- * Open = 4,
- * }
- * ```
- * @see
[@typescript-eslint/no-mixed-enums](https://typescript-eslint.io/rules/no-mixed-enums/)
- */
- [`${typescriptNamespace}/no-mixed-enums`]: ERROR,
-
/**
* Old TypeScript.
*
@@ -886,29 +619,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-non-null-assertion`]: WARN,
- /**
- * Disallow members of unions and intersections that do nothing or
override type information.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * type UnionAny = any | 'foo';
- * type UnionUnknown = unknown | 'foo';
- * type UnionNever = never | 'foo';
- * type UnionBooleanLiteral = boolean | false;
- * type UnionNumberLiteral = number | 1;
- * type UnionStringLiteral = string | 'foo';
- * type IntersectionAny = any & 'foo';
- * type IntersectionUnknown = string & unknown;
- * type IntersectionNever = string | never;
- * type IntersectionBooleanLiteral = boolean & false;
- * type IntersectionNumberLiteral = number & 1;
- * type IntersectionStringLiteral = string & 'foo';
- * ```
- * @see
[@typescript-eslint/no-redundant-type-constituents](https://typescript-eslint.io/rules/no-redundant-type-constituents/)
- */
- [`${typescriptNamespace}/no-redundant-type-constituents`]: ERROR,
-
/**
* Use ECMAScript `import` and `export` instead of `require` and
`module.exports`.
*
@@ -1026,40 +736,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-this-alias`]: ERROR,
- /**
- * If it's a `boolean`, use it as such.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * if (foo === true) // …
- *
- * // ✅ Correct
- * if (foo) // …
- * ```
- * @see
[@typescript-eslint/no-unnecessary-boolean-literal-compare](https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare/)
- */
- [`${typescriptNamespace}/no-unnecessary-boolean-literal-compare`]: ERROR,
-
- /**
- * Avoid conditions with values that can't be falsy.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const check = (value: "foo" | "bar") => {
- * if (value) // value will never be falsy
- * }
- *
- * // ✅ Correct
- * const check = (value: string) => {
- * if (value) // Necessary, since value might be ""
- * }
- * ```
- * @see
[@typescript-eslint/no-unnecessary-condition](https://typescript-eslint.io/rules/no-unnecessary-condition/)
- */
- [`${typescriptNamespace}/no-unnecessary-condition`]: ERROR,
-
/**
* Disallow unnecessary assignment of constructor property parameter.
*
@@ -1081,71 +757,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-unnecessary-parameter-property-assignment`]:
ERROR,
- /**
- * Disallow unnecessary namespace qualifiers.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * enum A {
- * B,
- * C = A.B,
- * }
- *
- * // ✅ Correct
- * enum A {
- * B,
- * C = B,
- * }
- * ```
- * @see
[@typescript-eslint/no-unnecessary-qualifier](https://typescript-eslint.io/rules/no-unnecessary-qualifier/)
- */
- [`${typescriptNamespace}/no-unnecessary-qualifier`]: ERROR,
-
- /**
- * Disallow unnecessary template expressions.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * `${'a'}${'b'}`
- *
- * // ✅ Correct
- * "ab"
- * ```
- * @see
[@typescript-eslint/no-unnecessary-template-expression](https://typescript-eslint.io/rules/no-unnecessary-template-expression/)
- */
- [`${typescriptNamespace}/no-unnecessary-template-expression`]: ERROR,
-
- /**
- * If the type assertion is the same, skip it.
- *
- * @example
- * ```typescript
- * const example = <Value = string>(value: Value) => value;
- *
- * // ❌ Incorrect
- * example<string>("hello");
- *
- * // ✅ Correct
- * example("hello");
- * ```
- * @see
[@typescript-eslint/no-unnecessary-type-arguments](https://typescript-eslint.io/rules/no-unnecessary-type-arguments/)
- */
- [`${typescriptNamespace}/no-unnecessary-type-arguments`]: ERROR,
-
- /**
- * Don't assert something that doesn't need assertion.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = "bar" as string;
- * ```
- * @see
[@typescript-eslint/no-unnecessary-type-assertion](https://typescript-eslint.io/rules/no-unnecessary-type-assertion/)
- */
- [`${typescriptNamespace}/no-unnecessary-type-assertion`]: ERROR,
-
/**
* Don't do `extends any` or `extends unknown`. That's the default.
*
@@ -1153,42 +764,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-unnecessary-type-constraint`]: ERROR,
- /**
- * Disallow type parameters that only appear once.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const second = <A, B>(a: A, b: B): B => b;
- *
- * // ✅ Correct
- * const second = <B>(a: unknown, b: B): B => b;
- * ```
- * @see
[@typescript-eslint/no-unnecessary-type-parameters](https://typescript-eslint.io/rules/no-unnecessary-type-parameters/)
- */
- [`${typescriptNamespace}/no-unnecessary-type-parameters`]: ERROR,
-
- /**
- * Disallows calling an function with an `any` type value.
- *
- * @see
[@typescript-eslint/no-unsafe-argument](https://typescript-eslint.io/rules/no-unsafe-argument/)
- */
- [`${typescriptNamespace}/no-unsafe-argument`]: ERROR,
-
- /**
- * Avoid `any` assignments.
- *
- * @see
[@typescript-eslint/no-unsafe-assignment](https://typescript-eslint.io/rules/no-unsafe-assignment/)
- */
- [`${typescriptNamespace}/no-unsafe-assignment`]: ERROR,
-
- /**
- * Avoid calling `any`.
- *
- * @see
[@typescript-eslint/no-unsafe-call](https://typescript-eslint.io/rules/no-unsafe-call/)
- */
- [`${typescriptNamespace}/no-unsafe-call`]: ERROR,
-
/**
* Disallow unsafe declaration merging.
*
@@ -1202,64 +777,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-unsafe-declaration-merging`]: ERROR,
- /**
- * Disallow comparing an enum value with a non-enum value.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const enum Fruit {
- * Apple = 0,
- * }
- *
- * declare let fruit: Fruit;
- *
- * fruit === 0;
- *
- * // ✅ Correct
- * const enum Fruit {
- * Apple = 0,
- * }
- *
- * declare let fruit: Fruit;
- *
- * fruit === Fruit.Apple;
- * ```
- * @see
[@typescript-eslint/no-unsafe-enum-comparison](https://typescript-eslint.io/rules/no-unsafe-enum-comparison/)
- */
- [`${typescriptNamespace}/no-unsafe-enum-comparison`]: ERROR,
-
- /**
- * Avoid accessing `any` members.
- *
- * @see
[@typescript-eslint/no-unsafe-member-access](https://typescript-eslint.io/rules/no-unsafe-member-access/)
- */
- [`${typescriptNamespace}/no-unsafe-member-access`]: ERROR,
-
- /**
- * Avoid returning `any`.
- *
- * @see
[@typescript-eslint/no-unsafe-return](https://typescript-eslint.io/rules/no-unsafe-return/)
- */
- [`${typescriptNamespace}/no-unsafe-return`]: ERROR,
-
- /**
- * Require unary negation to take a number.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * declare const a: string;
- * -a;
- *
- * // ✅ Correct
- * declare const a: number;
- * -a;
- * ```
- * @see
[@typescript-eslint/no-unsafe-unary-minus](https://typescript-eslint.io/rules/no-unsafe-unary-minus/)
- */
- [`${typescriptNamespace}/no-unsafe-unary-minus`]: ERROR,
-
/**
* Don't just leave expressions lying around! Use them!
*
@@ -1325,22 +842,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/no-wrapper-object-types`]: ERROR,
- /**
- * If you'll throw, throw errors, not literals.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * throw 'foo';
- *
- * // ✅ Correct
- * throw new Error('foo');
- * ```
- * @see
[@typescript-eslint/only-throw-error](https://typescript-eslint.io/rules/only-throw-error/)
- * @see
[no-throw-literal](https://eslint.org/docs/latest/rules/no-throw-literal)
- */
- [`${typescriptNamespace}/only-throw-error`]: ERROR,
-
/**
* Disallow parameter properties in class constructors.
*
@@ -1380,22 +881,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/prefer-as-const`]: ERROR,
- /**
- * Require destructuring from arrays and/or objects.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = array[0];
- * const bar = array[5];
- *
- * // ✅ Correct
- * const { [0]: foo, [5]: bar } = array;
- * ```
- * @see
[@typescript-eslint/prefer-destructuring](https://typescript-eslint.io/rules/prefer-destructuring/)
- */
- [`${typescriptNamespace}/prefer-destructuring`]: ERROR,
-
/**
* Require each enum member value to be explicitly initialized.
*
@@ -1427,21 +912,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/prefer-enum-initializers`]: ERROR,
- /**
- * Enforce the use of `Array#find` over `Array#filter` followed by when
looking for a single result.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * [1, 2, 3].filter(x => x > 1)[0];
- *
- * // ✅ Correct
- * [1, 2, 3].find(x => x > 1);
- * ```
- * @see
[@typescript-eslint/prefer-find](https://typescript-eslint.io/rules/prefer-find/)
- */
- [`${typescriptNamespace}/prefer-find`]: ERROR,
-
/**
* If you'll use a `for` loop on an array, use `for/of`.
*
@@ -1478,21 +948,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/prefer-function-type`]: ERROR,
- /**
- * Avoid `indexOf` and use `includes` instead.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * foo.indexOf("bar") !== -1;
- *
- * // ✅ Correct
- * foo.includes("bar");
- * ```
- * @see
[@typescript-eslint/prefer-includes](https://typescript-eslint.io/rules/prefer-includes/)
- */
- [`${typescriptNamespace}/prefer-includes`]: ERROR,
-
/**
* Require all enum members to be literal values.
*
@@ -1528,240 +983,6 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
*/
[`${typescriptNamespace}/prefer-namespace-keyword`]: ERROR,
- /**
- * Use `??` instead of a ternary.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = bar !== null && bar !== undefined ? bar : "baz";
- *
- * // ✅ Correct
- * const foo = bar ?? "baz";
- * ```
- * @see
[@typescript-eslint/prefer-nullish-coalescing](https://typescript-eslint.io/rules/prefer-nullish-coalescing/)
- */
- [`${typescriptNamespace}/prefer-nullish-coalescing`]: [
- ERROR,
- {
- ignoreConditionalTests: false,
- ignoreMixedLogicalExpressions: false,
- },
- ],
-
- /**
- * Use `?.` instead of checking every property.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = bar && bar.baz && bar.baz.qux;
- *
- * // ✅ Correct
- * const foo = bar?.baz?.qux;
- * ```
- * @see
[@typescript-eslint/prefer-optional-chain](https://typescript-eslint.io/rules/prefer-optional-chain/)
- */
- [`${typescriptNamespace}/prefer-optional-chain`]: ERROR,
-
- /**
- * In classes, private members should be read only.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * class Foo {
- * private neverModified = "bar";
- * }
- *
- * // ✅ Correct
- * class Foo {
- * private readonly neverModified = "bar";
- * }
- * ```
- * @see
[@typescript-eslint/prefer-readonly](https://typescript-eslint.io/rules/prefer-readonly/)
- */
- [`${typescriptNamespace}/prefer-readonly`]: ERROR,
-
- /**
- * Enforce using type parameter when calling `Array#reduce` instead
- * of casting.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * [1, 2, 3].reduce((array, item) => [...array, item * 2], [] as
ReadonlyArray<number>);
- *
- * // ✅ Correct
- * [1, 2, 3].reduce<ReadonlyArray<number>>((array, item) => [...array,
item * 2], []);
- * ```
- * @see
[@typescript-eslint/prefer-reduce-type-parameter](https://typescript-eslint.io/rules/prefer-reduce-type-parameter)
- */
- [`${typescriptNamespace}/prefer-reduce-type-parameter`]: ERROR,
-
- /**
- * Enforce `RegExp#exec` over `String#match` if no global flag is
- * provided.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * 'something'.match(/thing/);
- *
- * // ✅ Correct
- * /thing/.exec('something');
- * ```
- * @see
[@typescript-eslint/prefer-regexp-exec](https://typescript-eslint.io/rules/prefer-regexp-exec)
- */
- [`${typescriptNamespace}/prefer-regexp-exec`]: ERROR,
-
- /**
- * Enforce that `this` is used when only `this` type is returned.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * class Example {
- * someMethod(): Example {
- * return this;
- * }
- * }
- *
- * // ✅ Correct
- * class Example {
- * someMethod(): this {
- * return this;
- * }
- * }
- * ```
- * @see
[@typescript-eslint/prefer-return-this-type](https://typescript-eslint.io/rules/prefer-return-this-type)
- */
- [`${typescriptNamespace}/prefer-return-this-type`]: ERROR,
-
- /**
- * Enforce using `String#startsWith` and `String#endsWith` over
- * other equivalent methods of checking substrings.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * // starts with
- * foo[0] === 'b';
- * foo.charAt(0) === 'b';
- * foo.indexOf('bar') === 0;
- * foo.slice(0, 3) === 'bar';
- * foo.substring(0, 3) === 'bar';
- * foo.match(/^bar/) != null;
- * /^bar/.test(foo);
- *
- * // ends with
- * foo[foo.length - 1] === 'b';
- * foo.charAt(foo.length - 1) === 'b';
- * foo.lastIndexOf('bar') === foo.length - 3;
- * foo.slice(-3) === 'bar';
- * foo.substring(foo.length - 3) === 'bar';
- * foo.match(/bar$/) != null;
- * /bar$/.test(foo);
- *
- * // ✅ Correct
- * // starts with
- * foo.startsWith('bar');
- *
- * // ends with
- * foo.endsWith('bar');
- * ```
- * @see
[@typescript-eslint/prefer-string-starts-ends-with](https://typescript-eslint.io/rules/prefer-string-starts-ends-with)
- */
- [`${typescriptNamespace}/prefer-string-starts-ends-with`]: ERROR,
-
- /**
- * Always use `Array#sort` with a comparing function.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * foo.sort();
- *
- * // ✅ Correct
- * foo.sort((a, z) => a - z);
- * ```
- * @see
[@typescript-eslint/require-array-sort-compare](https://typescript-eslint.io/rules/require-array-sort-compare/)
- */
- [`${typescriptNamespace}/require-array-sort-compare`]: ERROR,
-
- /**
- * Use `await` if you are using `async`.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = async () => "bar";
- *
- * // ✅ Correct
- * const foo = async () => await "bar";
- * ```
- * @see
[@typescript-eslint/require-await](https://typescript-eslint.io/rules/require-await/)
- */
- [`${typescriptNamespace}/require-await`]: ERROR,
-
- /**
- * Use `+` with the same type (`number` or `string`).
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = "bar" + 42;
- *
- * // ✅ Correct
- * const foo = "bar" + "baz";
- * ```
- * @see
[@typescript-eslint/restrict-plus-operands](https://typescript-eslint.io/rules/restrict-plus-operands/)
- */
- [`${typescriptNamespace}/restrict-plus-operands`]: ERROR,
-
- /**
- * Only use strings or numbers inside template expressions.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * const foo = `bar${true}`;
- * const bar = `baz${undefined}`;
- *
- * // ✅ Correct
- * const foo = `bar${42}`;
- * const bar = `baz${"qux"}`;
- * const baz = `qux${undefined ?? "default"}`;
- * ```
- * @see
[@typescript-eslint/restrict-template-expressions](https://typescript-eslint.io/rules/restrict-template-expressions/)
- */
- [`${typescriptNamespace}/restrict-template-expressions`]: [ERROR, {
allowNumber: true }],
-
- /**
- * Comparisons should be applied to booleans only (not
- * falsy/truthy).
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * if (foo) // …
- * if (!foo) // …
- *
- * // ✅ Correct
- * if (foo !== "") // …
- * if (foo === undefined) // …
- * ```
- * @see
[@typescript-eslint/strict-boolean-expressions](https://typescript-eslint.io/rules/strict-boolean-expressions/)
- */
- [`${typescriptNamespace}/strict-boolean-expressions`]: [ERROR, {
allowNullableBoolean: true }],
-
- /**
- * If you'll use switch, make sure to cover every possible value.
- *
- * @see
[@typescript-eslint/switch-exhaustiveness-check](https://typescript-eslint.io/rules/switch-exhaustiveness-check/)
- */
- [`${typescriptNamespace}/switch-exhaustiveness-check`]: ERROR,
-
/**
* Old TypeScript.
*
@@ -1784,32 +1005,5 @@ export const typescriptRules = /** @type {const}
@satisfies {FlatConfig.Config}
* @see
[@typescript-eslint/unified-signatures](https://typescript-eslint.io/rules/unified-signatures/)
*/
[`${typescriptNamespace}/unified-signatures`]: ERROR,
-
- /**
- * Enforce typing arguments in `.catch()` callbacks as `unknown`.
- *
- * @example
- * ```typescript
- * // ❌ Incorrect
- * Promise.reject(new Error('I will reject!')).catch(error => {
- * console.log(error);
- * });
- *
- * Promise.reject(new Error('I will reject!')).catch((error: any) => {
- * console.log(error);
- * });
- *
- * Promise.reject(new Error('I will reject!')).catch((error: Error) => {
- * console.log(error);
- * });
- *
- * // ✅ Correct
- * Promise.reject(new Error('I will reject!')).catch((error: unknown) => {
- * console.log(error);
- * });
- * ```
- * @see
[@typescript-eslint/use-unknown-in-catch-callback-variable](https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable/)
- */
- [`${typescriptNamespace}/use-unknown-in-catch-callback-variable`]: ERROR,
},
});
diff --git a/airflow-core/src/airflow/ui/tsconfig.node.json
b/airflow-core/src/airflow/ui/tsconfig.node.json
index 14797d2c5aa..22710335855 100644
--- a/airflow-core/src/airflow/ui/tsconfig.node.json
+++ b/airflow-core/src/airflow/ui/tsconfig.node.json
@@ -19,8 +19,6 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
- "baseUrl": ".",
- "ignoreDeprecations": "6.0",
"paths": {
"src/*": ["./src/*"],
"openapi/*": ["./openapi-gen/*"]