mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
feat(linter): mark nextjs rules as recommended (#27691)
Copying recommended rules from upstream. --- <sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
This commit is contained in:
1 parent
d7c6b26a90
commit
7213f61e89
21 files changed
+21
No files matched your search
@@ -74,6 +74,7 @@ declare_oxc_lint!(
|
||||
GoogleFontDisplay,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Enforce font-display behavior with Google Fonts.",
|
||||
);
|
||||
|
||||
@@ -45,6 +45,7 @@ declare_oxc_lint!(
|
||||
GoogleFontPreconnect,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Enforces the presence of `rel=\"preconnect\"` when using Google Fonts via `<link>` tags.",
|
||||
);
|
||||
|
||||
@@ -92,6 +92,7 @@ declare_oxc_lint!(
|
||||
InlineScriptId,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Enforces that all `next/script` components with inline content or `dangerouslySetInnerHTML` must have an `id` prop.",
|
||||
);
|
||||
|
||||
@@ -81,6 +81,7 @@ declare_oxc_lint!(
|
||||
NextScriptForGa,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Enforces the use of the `next/script` component when implementing Google Analytics in Next.js applications, instead of using regular `<script>` tags.",
|
||||
);
|
||||
|
||||
@@ -58,6 +58,7 @@ declare_oxc_lint!(
|
||||
NoAssignModuleVariable,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Prevents the assignment or declaration of variables named `module` in Next.js applications.",
|
||||
);
|
||||
|
||||
@@ -86,6 +86,7 @@ declare_oxc_lint!(
|
||||
NoAsyncClientComponent,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Prevent client components from being async functions.",
|
||||
);
|
||||
|
||||
@@ -86,6 +86,7 @@ declare_oxc_lint!(
|
||||
NoBeforeInteractiveScriptOutsideDocument,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.7",
|
||||
short_description = "Prevent the usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.",
|
||||
);
|
||||
|
||||
@@ -66,6 +66,7 @@ declare_oxc_lint!(
|
||||
NoCssTags,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Prevent manual inclusion of stylesheets using `<link>` tags in Next.js applications.",
|
||||
);
|
||||
|
||||
@@ -55,6 +55,7 @@ declare_oxc_lint!(
|
||||
NoDocumentImportInPage,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.1",
|
||||
short_description = "Prevent importing `next/document` outside of `pages/_document.js`.",
|
||||
);
|
||||
|
||||
@@ -70,6 +70,7 @@ declare_oxc_lint!(
|
||||
NoDuplicateHead,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.3.3",
|
||||
short_description = "Prevent duplicate usage of `<Head>` in `pages/_document.js`.",
|
||||
);
|
||||
|
||||
@@ -67,6 +67,7 @@ declare_oxc_lint!(
|
||||
NoHeadElement,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.1",
|
||||
short_description = "Prevents the usage of the native `<head>` element inside a Next.js application.",
|
||||
);
|
||||
|
||||
@@ -75,6 +75,7 @@ declare_oxc_lint!(
|
||||
NoHeadImportInDocument,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Prevents the usage of `next/head` inside a Next.js document.",
|
||||
);
|
||||
|
||||
@@ -76,6 +76,7 @@ declare_oxc_lint!(
|
||||
NoHtmlLinkForPages,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "1.7.0",
|
||||
short_description = "Prevents the usage of `<a>` elements to navigate between Next.js pages.",
|
||||
);
|
||||
|
||||
@@ -63,6 +63,7 @@ declare_oxc_lint!(
|
||||
NoImgElement,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
pending, // TODO: add `import Image from "next/image"` (if missing), then change `<img />` to `<Image />`
|
||||
version = "0.2.0",
|
||||
short_description = "Prevent the usage of the `<img>` element due to slower LCP and higher bandwidth.",
|
||||
|
||||
@@ -75,6 +75,7 @@ declare_oxc_lint!(
|
||||
NoPageCustomFont,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.3.3",
|
||||
short_description = "Prevent page-only custom fonts.",
|
||||
);
|
||||
|
||||
@@ -63,6 +63,7 @@ declare_oxc_lint!(
|
||||
NoScriptComponentInHead,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Prevent usage of `next/script` in `next/head` component.",
|
||||
);
|
||||
|
||||
@@ -75,6 +75,7 @@ declare_oxc_lint!(
|
||||
NoStyledJsxInDocument,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.3.3",
|
||||
short_description = "Prevent usage of styled-jsx in `pages/_document.js`.",
|
||||
);
|
||||
|
||||
@@ -56,6 +56,7 @@ declare_oxc_lint!(
|
||||
NoSyncScripts,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Prevent the use of synchronous `<script>` tags in Next.js applications.",
|
||||
);
|
||||
|
||||
@@ -61,6 +61,7 @@ declare_oxc_lint!(
|
||||
NoTitleInDocumentHead,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.0",
|
||||
short_description = "Prevent usage of `<title>` with `Head` component from `next/document`.",
|
||||
);
|
||||
|
||||
@@ -50,6 +50,7 @@ declare_oxc_lint!(
|
||||
NoTypos,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
suggestion,
|
||||
version = "0.2.1",
|
||||
short_description = "Detects common typos in Next.js data fetching function names.",
|
||||
|
||||
@@ -64,6 +64,7 @@ declare_oxc_lint!(
|
||||
NoUnwantedPolyfillio,
|
||||
nextjs,
|
||||
correctness,
|
||||
recommended,
|
||||
version = "0.2.7",
|
||||
short_description = "Prevent use of unsafe polyfill.io domains and duplicate polyfills.",
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user