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

Issues when updating linting rules #5786

Open
dylans opened this issue Dec 25, 2024 · 1 comment
Open

Issues when updating linting rules #5786

dylans opened this issue Dec 25, 2024 · 1 comment
Labels

Comments

@dylans
Copy link
Collaborator

dylans commented Dec 25, 2024

Description
We have a number of issues when we update our eslint config:

diff --git a/.eslintrc.json b/.eslintrc.json
index 912522b8..8345958b 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -3,9 +3,9 @@
   "extends": [
     "plugin:import/typescript",
     "plugin:prettier/recommended",
-    "plugin:react-hooks/recommended"
+    "next/core-web-vitals"
   ],
-  "plugins": ["import", "react"],
+  "plugins": ["@typescript-eslint", "import", "react"],
   "parser": "@typescript-eslint/parser",
   "parserOptions": {
     "sourceType": "module",
⚠ "next export" is no longer needed when "output: export" is configured in next.config.js https://nextjs.org/docs/advanced-features/static-html-export
Export successful. Files written to /home/runner/work/slate/slate/site/out
Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.
Pages directory cannot be found at /home/runner/work/slate/slate/pages or /home/runner/work/slate/slate/src/pages. If using a custom path, please configure with the `no-html-link-for-pages` rule in your eslint config file.

/home/runner/work/slate/slate/packages/slate-dom/src/utils/hotkeys.ts
Warning:   72:1  warning  Assign object to a variable before exporting as module default  import/no-anonymous-default-export

/home/runner/work/slate/slate/packages/slate-react/src/components/editable.tsx
Error:   138:25  error  Component definition is missing display name  react/display-name

/home/runner/work/slate/slate/packages/slate-react/src/components/text.tsx
Error:   27:18  error  React Hook "useSlateStatic" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render  react-hooks/rules-of-hooks
Error:   28:15  error  React Hook "useRef" may be executed more than once. Possibly because it is called in a loop. React Hooks must be called in the exact same order in every component render          react-hooks/rules-of-hooks

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/above/block-highest.tsx
Error:   20:3  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/above/block-lowest.tsx
Error:   22:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/above/inline.tsx
Error:   21:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/above/point.tsx
Error:   18:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/above/range.tsx
Error:   26:3  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/levels/match.tsx
Error:   22:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   27:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/levels/reverse.tsx
Error:   21:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   23:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/levels/success.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   23:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/levels/voids-false.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/levels/voids-true.tsx
Error:   23:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   28:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/next/block.tsx
Error:   17:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/next/default.tsx
Error:   14:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/next/text.tsx
Error:   14:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/node/path.tsx
Error:   13:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/node/point.tsx
Error:   13:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/node/range-end.tsx
Error:   21:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/node/range-start.tsx
Error:   21:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/match-function/block.tsx
Error:   18:25  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/match-function/inline.tsx
Error:   20:25  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/mode-all/block.tsx
Error:   22:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   27:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   29:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   34:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/mode-highest/block.tsx
Error:   22:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   28:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/mode-lowest/block.tsx
Error:   21:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   22:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/mode-universal/all-nested.tsx
Error:   26:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   27:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/mode-universal/all.tsx
Error:   22:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   23:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/mode-universal/branch-nested.tsx
Error:   27:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   32:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/block-multiple.tsx
Error:   16:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   17:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   18:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   19:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/block-nested.tsx
Error:   21:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   26:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   27:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   29:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   34:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   35:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/block-reverse.tsx
Error:   16:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   17:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   18:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   19:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/block-void.tsx
Error:   15:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/block.tsx
Error:   15:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   16:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/inline-multiple.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   23:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   24:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   25:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   26:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   27:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   28:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   29:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/inline-nested.tsx
Error:   22:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   31:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   33:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   38:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   39:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   40:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   41:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   42:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/inline-reverse.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   23:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   24:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   25:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   26:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   27:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   28:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   29:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/inline-void.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   23:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   24:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   25:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/no-match/inline.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   23:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   24:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   25:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   26:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/voids-true/block.tsx
Error:   15:25  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/nodes/voids-true/inline.tsx
Error:   18:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   19:4  error  Missing "key" prop for element in array  react/jsx-key
Error:   20:4  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/parent/path.tsx
Error:   13:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/parent/point.tsx
Error:   13:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/parent/range-end.tsx
Error:   21:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/parent/range-start.tsx
Error:   21:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/parent/range.tsx
Error:   17:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/previous/block.tsx
Error:   17:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/previous/default.tsx
Error:   14:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Editor/previous/text.tsx
Error:   14:24  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/descendants/all.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/descendants/from.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/descendants/reverse.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/descendants/to.tsx
Error:   25:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/elements/all.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/elements/path.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/elements/range.tsx
Error:   33:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/elements/reverse.tsx
Error:   18:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/nodes/all.tsx
Error:   19:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/nodes/multiple-elements.tsx
Error:   21:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   28:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/nodes/nested-elements.tsx
Error:   20:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   28:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/nodes/pass.tsx
Error:   20:5  error  Missing "key" prop for element in array  react/jsx-key
Error:   28:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/interfaces/Node/nodes/to.tsx
Error:   26:5  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/transforms/insertNodes/path/multiple-inline-not-end.tsx
Error:   18:7  error  Missing "key" prop for element in array  react/jsx-key
Error:   21:7  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/transforms/insertNodes/path/multiple-inline.tsx
Error:   17:7  error  Missing "key" prop for element in array  react/jsx-key
Error:   20:7  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/packages/slate/test/transforms/insertNodes/path/multiple.tsx
Error:   14:35  error  Missing "key" prop for element in array  react/jsx-key
Error:   14:55  error  Missing "key" prop for element in array  react/jsx-key

/home/runner/work/slate/slate/site/examples/js/components/index.jsx
Error:     5:23  error  Component definition is missing display name                     react/display-name
Error:    26:28  error  Component definition is missing display name                     react/display-name
Error:    52:16  error  `'` can be escaped with `'`, `‘`, `'`, `’`  react/no-unescaped-entities
Error:    71:21  error  Component definition is missing display name                     react/display-name
Error:    85:28  error  Component definition is missing display name                     react/display-name
Error:   101:21  error  Component definition is missing display name                     react/display-name
Error:   125:24  error  Component definition is missing display name                     react/display-name

/home/runner/work/slate/slate/site/examples/js/images.jsx
Warning:    83:14  warning  Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                              jsx-a11y/alt-text
Warning:   102:9   warning  Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
Warning:   102:9   warning  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                jsx-a11y/alt-text

/home/runner/work/slate/slate/site/examples/js/paste-html.jsx
Warning:   177:7  warning  Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
Warning:   177:7  warning  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                jsx-a11y/alt-text

/home/runner/work/slate/slate/site/examples/ts/components/index.tsx
Error:    11:23  error  Component definition is missing display name                     react/display-name
Error:    46:28  error  Component definition is missing display name                     react/display-name
Error:    83:16  error  `'` can be escaped with `&apos;`, `&lsquo;`, `&#39;`, `&rsquo;`  react/no-unescaped-entities
Error:   103:21  error  Component definition is missing display name                     react/display-name
Error:   123:28  error  Component definition is missing display name                     react/display-name
Error:   145:21  error  Component definition is missing display name                     react/display-name
Error:   176:24  error  Component definition is missing display name                     react/display-name

/home/runner/work/slate/slate/site/examples/ts/images.tsx
Warning:    96:14  warning  Image elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                              jsx-a11y/alt-text
Warning:   117:9   warning  Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
Warning:   117:9   warning  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                jsx-a11y/alt-text

/home/runner/work/slate/slate/site/examples/ts/paste-html.tsx
Warning:   200:7  warning  Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element  @next/next/no-img-element
Warning:   200:7  warning  img elements must have an alt prop, either with meaningful text, or an empty string for decorative images                                                                                                                                                                                jsx-a11y/alt-text

/home/runner/work/slate/slate/site/pages/examples/[example].tsx
Warning:   305:11  warning  Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags                                                                           @next/next/no-css-tags
Warning:   306:11  warning  A font-display parameter is missing (adding `&display=optional` is recommended). See: https://nextjs.org/docs/messages/google-font-display                       @next/next/google-font-display
Warning:   306:11  warning  Custom fonts not added in `pages/_document.js` will only load for a single page. This is discouraged. See: https://nextjs.org/docs/messages/no-page-custom-font  @next/next/no-page-custom-font

✖ 152 problems (138 errors, 14 warnings)

Error: Process completed with exit code 1.
@dylans dylans added the bug label Dec 25, 2024
@A1X5H04
Copy link

A1X5H04 commented Dec 26, 2024

I'd like to fix, if I may ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants