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 ad06949068 Remove burdensome eslint rules (#42795)
ad06949068 is described below

commit ad06949068a15d06391b2d058140e6061de22eeb
Author: Brent Bovenzi <[email protected]>
AuthorDate: Mon Oct 7 16:30:59 2024 +0200

    Remove burdensome eslint rules (#42795)
---
 airflow/ui/.prettierignore                        |  1 +
 airflow/ui/eslint.config.js                       |  2 +-
 airflow/ui/rules/core.js                          | 18 ------------------
 airflow/ui/rules/react.js                         |  7 -------
 airflow/ui/src/App.test.tsx                       |  3 +++
 airflow/ui/src/components/DataTable/DataTable.tsx |  1 -
 airflow/ui/src/pages/DagsList/DagsList.tsx        |  1 -
 7 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/airflow/ui/.prettierignore b/airflow/ui/.prettierignore
index a2bcd8157d..7e860ea047 100644
--- a/airflow/ui/.prettierignore
+++ b/airflow/ui/.prettierignore
@@ -3,3 +3,4 @@ templates/**/*.html
 dist/
 *.md
 *.yaml
+coverage/*
diff --git a/airflow/ui/eslint.config.js b/airflow/ui/eslint.config.js
index fcce70dff6..3146741531 100644
--- a/airflow/ui/eslint.config.js
+++ b/airflow/ui/eslint.config.js
@@ -34,7 +34,7 @@ import { unicornRules } from "./rules/unicorn.js";
  */
 export default /** @type {const} @satisfies {ReadonlyArray<FlatConfig.Config>} 
*/ ([
   // Global ignore of dist directory
-  { ignores: ["**/dist/"] },
+  { ignores: ["**/dist/", "**coverage/"] },
   // Base rules
   coreRules,
   typescriptRules,
diff --git a/airflow/ui/rules/core.js b/airflow/ui/rules/core.js
index 3ec26cad6d..54011b1ce7 100644
--- a/airflow/ui/rules/core.js
+++ b/airflow/ui/rules/core.js
@@ -96,13 +96,6 @@ export const coreRules = /** @type {const} @satisfies 
{FlatConfig.Config} */ ({
      */
     "arrow-body-style": ERROR,
 
-    /**
-     * Limit cyclomatic complexity to a maximum of 10.
-     *
-     * @see [complexity](https://eslint.org/docs/latest/rules/complexity)
-     */
-    complexity: [WARN, 10],
-
     /**
      * Require curly around all control statements.
      *
@@ -291,17 +284,6 @@ export const coreRules = /** @type {const} @satisfies 
{FlatConfig.Config} */ ({
       { max: 250, skipBlankLines: true, skipComments: true },
     ],
 
-    /**
-     * Enforce a maximum number of 100 lines of code in a function.
-     * Need more? Move it to another function.
-     *
-     * @see 
[max-lines-per-function](https://eslint.org/docs/latest/rules/max-lines-per-function)
-     */
-    "max-lines-per-function": [
-      ERROR,
-      { max: 100, skipBlankLines: true, skipComments: true },
-    ],
-
     /**
      * Enforce a maximum depth that callbacks can be nested to 3.
      *
diff --git a/airflow/ui/rules/react.js b/airflow/ui/rules/react.js
index 4c8d8b8ba5..508718659b 100644
--- a/airflow/ui/rules/react.js
+++ b/airflow/ui/rules/react.js
@@ -478,13 +478,6 @@ export const reactRules = /** @type {const} @satisfies 
{FlatConfig.Config} */ ({
      */
     [`${reactNamespace}/jsx-max-depth`]: [ERROR, { max: 5 }],
 
-    /**
-     * Disallow `Function#bind` or arrow functions in JSX props.
-     *
-     * @see 
[react/jsx-no-bind](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/jsx-no-bind.md)
-     */
-    [`${reactNamespace}/jsx-no-bind`]: ERROR,
-
     /**
      * Disallow comments from being inserted as text nodes.
      *
diff --git a/airflow/ui/src/App.test.tsx b/airflow/ui/src/App.test.tsx
index 5efcf90f1a..38b90d1c49 100644
--- a/airflow/ui/src/App.test.tsx
+++ b/airflow/ui/src/App.test.tsx
@@ -26,6 +26,9 @@ import type { DAGCollectionResponse } from 
"openapi/requests/types.gen";
 import { App } from "./App";
 import { Wrapper } from "./utils/Wrapper";
 
+// The null fields actually have to be null instead of undefined
+/* eslint-disable unicorn/no-null */
+
 const mockListDags: DAGCollectionResponse = {
   dags: [
     {
diff --git a/airflow/ui/src/components/DataTable/DataTable.tsx 
b/airflow/ui/src/components/DataTable/DataTable.tsx
index 705d7883f0..48b9346602 100644
--- a/airflow/ui/src/components/DataTable/DataTable.tsx
+++ b/airflow/ui/src/components/DataTable/DataTable.tsx
@@ -63,7 +63,6 @@ type DataTableProps<TData> = {
 
 const defaultGetRowCanExpand = () => false;
 
-// eslint-disable-next-line max-lines-per-function
 export const DataTable = <TData,>({
   columns,
   data,
diff --git a/airflow/ui/src/pages/DagsList/DagsList.tsx 
b/airflow/ui/src/pages/DagsList/DagsList.tsx
index d58e3eaa20..90981a0747 100644
--- a/airflow/ui/src/pages/DagsList/DagsList.tsx
+++ b/airflow/ui/src/pages/DagsList/DagsList.tsx
@@ -85,7 +85,6 @@ const columns: Array<ColumnDef<DAGResponse>> = [
 
 const PAUSED_PARAM = "paused";
 
-// eslint-disable-next-line complexity
 export const DagsList = ({ cardView = false }) => {
   const [searchParams] = useSearchParams();
 

Reply via email to