@luxass/eslint-config 4.4.2 → 4.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -269,7 +269,6 @@ Since flat config requires us to explicitly provide the plugin names (instead of
269
269
  | `react-dom/*` | `@eslint-react/dom/*` | [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) |
270
270
  | `react-hooks-extra/*` | `@eslint-react/hooks-extra/*` | [eslint-plugin-react-hooks-extra](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-hooks-extra) |
271
271
  | `react-naming-convention/*` | `@eslint-react/naming-convention/*` | [eslint-plugin-react-naming-convention](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-naming-convention) |
272
- | `nextjs` | `@next/next` | [eslint-plugin-react-refresh](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
273
272
 
274
273
  When you want to override rules, or disable them inline, you need to update to the new prefix:
275
274
 
@@ -432,27 +431,6 @@ Running `npx eslint` should prompt you to install the required dependencies, oth
432
431
  npm i -D @eslint-react/eslint-plugin eslint-plugin-react-hooks eslint-plugin-react-refresh
433
432
  ```
434
433
 
435
- #### Next.JS
436
-
437
- To enable Next.JS support, need to explicitly turn it on:
438
-
439
- Next.JS also enables React support.
440
-
441
- ```js
442
- // eslint.config.js
443
- import luxass from '@luxass/eslint-config'
444
-
445
- export default luxass({
446
- nextjs: true,
447
- })
448
- ```
449
-
450
- Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
451
-
452
- ```bash
453
- npm i -D eslint-plugin-react eslint-plugin-react-hooks @next/eslint-plugin-next
454
- ```
455
-
456
434
  #### Astro
457
435
 
458
436
  To enable Astro support, you need to explicitly turn it on:
package/dist/index.cjs CHANGED
@@ -73,7 +73,6 @@ __export(src_exports, {
73
73
  jsonc: () => jsonc,
74
74
  luxass: () => luxass,
75
75
  markdown: () => markdown,
76
- nextjs: () => nextjs,
77
76
  node: () => node,
78
77
  parserPlain: () => parserPlain,
79
78
  react: () => react,
@@ -1790,88 +1789,6 @@ async function unocss(options = {}) {
1790
1789
  ];
1791
1790
  }
1792
1791
 
1793
- // src/configs/nextjs.ts
1794
- async function nextjs(options = {}) {
1795
- const {
1796
- files = [GLOB_SRC],
1797
- overrides,
1798
- rootDir
1799
- } = options;
1800
- await ensure([
1801
- "@next/eslint-plugin-next"
1802
- ]);
1803
- const pluginNextjs = await interop(import("@next/eslint-plugin-next"));
1804
- return [
1805
- {
1806
- name: "luxass/nextjs/setup",
1807
- plugins: {
1808
- nextjs: pluginNextjs
1809
- }
1810
- },
1811
- {
1812
- name: "luxass/nextjs/rules",
1813
- files,
1814
- rules: {
1815
- ...renameRules(
1816
- pluginNextjs.configs.recommended.rules,
1817
- "@next/next/",
1818
- "nextjs/"
1819
- ),
1820
- ...renameRules(
1821
- pluginNextjs.configs["core-web-vitals"].rules,
1822
- "@next/next/",
1823
- "nextjs/"
1824
- ),
1825
- "nextjs/google-font-display": ["error"],
1826
- "nextjs/google-font-preconnect": ["error"],
1827
- "nextjs/inline-script-id": ["error"],
1828
- "nextjs/next-script-for-ga": ["warn"],
1829
- "nextjs/no-assign-module-variable": ["error"],
1830
- "nextjs/no-css-tags": ["warn"],
1831
- "nextjs/no-document-import-in-page": ["error"],
1832
- "nextjs/no-duplicate-head": ["error"],
1833
- "nextjs/no-head-element": ["warn"],
1834
- "nextjs/no-head-import-in-document": ["error"],
1835
- "nextjs/no-html-link-for-pages": ["off"],
1836
- "nextjs/no-img-element": ["warn"],
1837
- "nextjs/no-page-custom-font": ["warn"],
1838
- "nextjs/no-script-component-in-head": ["error"],
1839
- "nextjs/no-styled-jsx-in-document": ["warn"],
1840
- "nextjs/no-sync-scripts": ["warn"],
1841
- "nextjs/no-title-in-document-head": ["warn"],
1842
- "nextjs/no-typos": ["warn"],
1843
- "nextjs/no-unwanted-polyfillio": ["warn"],
1844
- // This rule creates errors with webpack parsing on edge runtime
1845
- "unicorn/prefer-node-protocol": ["off"],
1846
- ...overrides
1847
- },
1848
- settings: {
1849
- next: {
1850
- rootDir: rootDir ?? true
1851
- },
1852
- react: {
1853
- pragma: "React",
1854
- version: "detect"
1855
- }
1856
- }
1857
- },
1858
- {
1859
- name: "luxass/nextjs/default-export-override",
1860
- files: GLOB_NEXTJS_ROUTES,
1861
- rules: {
1862
- "import/prefer-default-export": "error"
1863
- }
1864
- },
1865
- {
1866
- name: "luxass/nextjs/og-override",
1867
- files: GLOB_NEXTJS_OG,
1868
- rules: {
1869
- "nextjs/no-img-element": "off"
1870
- }
1871
- }
1872
- ];
1873
- }
1874
-
1875
1792
  // src/configs/react.ts
1876
1793
  var import_local_pkg2 = require("local-pkg");
1877
1794
  var ReactRefreshAllowConstantExportPackages = [
@@ -1961,6 +1878,7 @@ async function react(options = {}) {
1961
1878
  allowExportNames: [
1962
1879
  ...isUsingNext ? [
1963
1880
  "config",
1881
+ "runtime",
1964
1882
  "generateStaticParams",
1965
1883
  "metadata",
1966
1884
  "generateMetadata",
@@ -2521,8 +2439,7 @@ var defaultPluginRenaming = {
2521
2439
  "@eslint-react": "react",
2522
2440
  "@eslint-react/dom": "react-dom",
2523
2441
  "@eslint-react/hooks-extra": "react-hooks-extra",
2524
- "@eslint-react/naming-convention": "react-naming-convention",
2525
- "@next/next": "nextjs"
2442
+ "@eslint-react/naming-convention": "react-naming-convention"
2526
2443
  };
2527
2444
  function luxass(options = {}, ...userConfigs) {
2528
2445
  const {
@@ -2531,7 +2448,6 @@ function luxass(options = {}, ...userConfigs) {
2531
2448
  editor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE || import_node_process3.default.env.VIM) && !import_node_process3.default.env.CI),
2532
2449
  exts = [],
2533
2450
  gitignore: enableGitignore = true,
2534
- nextjs: enableNextJS = false,
2535
2451
  react: enableReact = false,
2536
2452
  tailwindcss: enableTailwindCSS = false,
2537
2453
  svelte: enableSvelte = false,
@@ -2592,21 +2508,13 @@ function luxass(options = {}, ...userConfigs) {
2592
2508
  overrides: getOverrides(options, "test")
2593
2509
  }));
2594
2510
  }
2595
- if (enableReact || enableNextJS) {
2511
+ if (enableReact) {
2596
2512
  configs.push(react({
2597
2513
  ...resolveSubOptions(options, "react"),
2598
2514
  overrides: getOverrides(options, "react"),
2599
2515
  tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2600
2516
  }));
2601
2517
  }
2602
- if (enableNextJS) {
2603
- configs.push(
2604
- nextjs({
2605
- ...resolveSubOptions(options, "nextjs"),
2606
- overrides: getOverrides(options, "nextjs")
2607
- })
2608
- );
2609
- }
2610
2518
  if (enableSolid) {
2611
2519
  configs.push(
2612
2520
  solid({
@@ -2759,7 +2667,6 @@ var src_default = luxass;
2759
2667
  jsonc,
2760
2668
  luxass,
2761
2669
  markdown,
2762
- nextjs,
2763
2670
  node,
2764
2671
  parserPlain,
2765
2672
  react,
package/dist/index.d.cts CHANGED
@@ -1490,110 +1490,6 @@ interface RuleOptions {
1490
1490
  * @deprecated
1491
1491
  */
1492
1492
  'newline-per-chained-call'?: Linter.RuleEntry<NewlinePerChainedCall>
1493
- /**
1494
- * Enforce font-display behavior with Google Fonts.
1495
- * @see https://nextjs.org/docs/messages/google-font-display
1496
- */
1497
- 'nextjs/google-font-display'?: Linter.RuleEntry<[]>
1498
- /**
1499
- * Ensure `preconnect` is used with Google Fonts.
1500
- * @see https://nextjs.org/docs/messages/google-font-preconnect
1501
- */
1502
- 'nextjs/google-font-preconnect'?: Linter.RuleEntry<[]>
1503
- /**
1504
- * Enforce `id` attribute on `next/script` components with inline content.
1505
- * @see https://nextjs.org/docs/messages/inline-script-id
1506
- */
1507
- 'nextjs/inline-script-id'?: Linter.RuleEntry<[]>
1508
- /**
1509
- * Prefer `next/script` component when using the inline script for Google Analytics.
1510
- * @see https://nextjs.org/docs/messages/next-script-for-ga
1511
- */
1512
- 'nextjs/next-script-for-ga'?: Linter.RuleEntry<[]>
1513
- /**
1514
- * Prevent assignment to the `module` variable.
1515
- * @see https://nextjs.org/docs/messages/no-assign-module-variable
1516
- */
1517
- 'nextjs/no-assign-module-variable'?: Linter.RuleEntry<[]>
1518
- /**
1519
- * Prevent client components from being async functions.
1520
- * @see https://nextjs.org/docs/messages/no-async-client-component
1521
- */
1522
- 'nextjs/no-async-client-component'?: Linter.RuleEntry<[]>
1523
- /**
1524
- * Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.
1525
- * @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
1526
- */
1527
- 'nextjs/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]>
1528
- /**
1529
- * Prevent manual stylesheet tags.
1530
- * @see https://nextjs.org/docs/messages/no-css-tags
1531
- */
1532
- 'nextjs/no-css-tags'?: Linter.RuleEntry<[]>
1533
- /**
1534
- * Prevent importing `next/document` outside of `pages/_document.js`.
1535
- * @see https://nextjs.org/docs/messages/no-document-import-in-page
1536
- */
1537
- 'nextjs/no-document-import-in-page'?: Linter.RuleEntry<[]>
1538
- /**
1539
- * Prevent duplicate usage of `<Head>` in `pages/_document.js`.
1540
- * @see https://nextjs.org/docs/messages/no-duplicate-head
1541
- */
1542
- 'nextjs/no-duplicate-head'?: Linter.RuleEntry<[]>
1543
- /**
1544
- * Prevent usage of `<head>` element.
1545
- * @see https://nextjs.org/docs/messages/no-head-element
1546
- */
1547
- 'nextjs/no-head-element'?: Linter.RuleEntry<[]>
1548
- /**
1549
- * Prevent usage of `next/head` in `pages/_document.js`.
1550
- * @see https://nextjs.org/docs/messages/no-head-import-in-document
1551
- */
1552
- 'nextjs/no-head-import-in-document'?: Linter.RuleEntry<[]>
1553
- /**
1554
- * Prevent usage of `<a>` elements to navigate to internal Next.js pages.
1555
- * @see https://nextjs.org/docs/messages/no-html-link-for-pages
1556
- */
1557
- 'nextjs/no-html-link-for-pages'?: Linter.RuleEntry<NextjsNoHtmlLinkForPages>
1558
- /**
1559
- * Prevent usage of `<img>` element due to slower LCP and higher bandwidth.
1560
- * @see https://nextjs.org/docs/messages/no-img-element
1561
- */
1562
- 'nextjs/no-img-element'?: Linter.RuleEntry<[]>
1563
- /**
1564
- * Prevent page-only custom fonts.
1565
- * @see https://nextjs.org/docs/messages/no-page-custom-font
1566
- */
1567
- 'nextjs/no-page-custom-font'?: Linter.RuleEntry<[]>
1568
- /**
1569
- * Prevent usage of `next/script` in `next/head` component.
1570
- * @see https://nextjs.org/docs/messages/no-script-component-in-head
1571
- */
1572
- 'nextjs/no-script-component-in-head'?: Linter.RuleEntry<[]>
1573
- /**
1574
- * Prevent usage of `styled-jsx` in `pages/_document.js`.
1575
- * @see https://nextjs.org/docs/messages/no-styled-jsx-in-document
1576
- */
1577
- 'nextjs/no-styled-jsx-in-document'?: Linter.RuleEntry<[]>
1578
- /**
1579
- * Prevent synchronous scripts.
1580
- * @see https://nextjs.org/docs/messages/no-sync-scripts
1581
- */
1582
- 'nextjs/no-sync-scripts'?: Linter.RuleEntry<[]>
1583
- /**
1584
- * Prevent usage of `<title>` with `Head` component from `next/document`.
1585
- * @see https://nextjs.org/docs/messages/no-title-in-document-head
1586
- */
1587
- 'nextjs/no-title-in-document-head'?: Linter.RuleEntry<[]>
1588
- /**
1589
- * Prevent common typos in Next.js data fetching functions.
1590
- */
1591
- 'nextjs/no-typos'?: Linter.RuleEntry<[]>
1592
- /**
1593
- * Prevent duplicate polyfills from Polyfill.io.
1594
- * @see https://nextjs.org/docs/messages/no-unwanted-polyfillio
1595
- */
1596
- 'nextjs/no-unwanted-polyfillio'?: Linter.RuleEntry<[]>
1597
1493
  /**
1598
1494
  * Disallow the use of `alert`, `confirm`, and `prompt`
1599
1495
  * @see https://eslint.org/docs/latest/rules/no-alert
@@ -9066,8 +8962,6 @@ type NewlineAfterVar = []|[("never" | "always")]
9066
8962
  type NewlinePerChainedCall = []|[{
9067
8963
  ignoreChainWithDepth?: number
9068
8964
  }]
9069
- // ----- nextjs/no-html-link-for-pages -----
9070
- type NextjsNoHtmlLinkForPages = []|[(string | string[])]
9071
8965
  // ----- no-bitwise -----
9072
8966
  type NoBitwise = []|[{
9073
8967
  allow?: ("^" | "|" | "&" | "<<" | ">>" | ">>>" | "^=" | "|=" | "&=" | "<<=" | ">>=" | ">>>=" | "~")[]
@@ -14531,7 +14425,7 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
14531
14425
  onlyEquality?: boolean
14532
14426
  }]
14533
14427
  // Names of all the configs
14534
- type ConfigNames = 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/astro/scripts-js' | 'luxass/astro/scripts-ts' | 'luxass/eslint-comments' | 'luxass/formatter/setup' | 'luxass/imports' | 'luxass/disables/imports-bin' | 'luxass/javascript' | 'luxass/disables/cli' | 'luxass/jsdoc' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/disables' | 'luxass/node' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/sort/package-json' | 'luxass/stylistic' | 'luxass/tailwindcss/setup' | 'luxass/tailwindcss/rules' | 'luxass/sort/tsconfig' | 'luxass/nextjs/setup' | 'luxass/nextjs/rules' | 'luxass/nextjs/default-export-override' | 'luxass/nextjs/og-override' | 'luxass/solid/setup' | 'luxass/solid/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/typescript/setup' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxass/typescript/disables/dts' | 'luxass/typescript/disables/tests' | 'luxass/typescript/disables/playground' | 'luxass/typescript/disables/javascript' | 'luxass/unicorn' | 'luxass/unocss/setup' | 'luxass/unocss/rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/github-actions' | 'antfu/svelte/setup' | 'antfu/svelte/rules'
14428
+ type ConfigNames = 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/astro/scripts-js' | 'luxass/astro/scripts-ts' | 'luxass/eslint-comments' | 'luxass/formatter/setup' | 'luxass/imports' | 'luxass/disables/imports-bin' | 'luxass/javascript' | 'luxass/disables/cli' | 'luxass/jsdoc' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/disables' | 'luxass/node' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/sort/package-json' | 'luxass/stylistic' | 'luxass/tailwindcss/setup' | 'luxass/tailwindcss/rules' | 'luxass/sort/tsconfig' | 'luxass/solid/setup' | 'luxass/solid/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/typescript/setup' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxass/typescript/disables/dts' | 'luxass/typescript/disables/tests' | 'luxass/typescript/disables/playground' | 'luxass/typescript/disables/javascript' | 'luxass/unicorn' | 'luxass/unocss/setup' | 'luxass/unocss/rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/github-actions' | 'antfu/svelte/setup' | 'antfu/svelte/rules'
14535
14429
 
14536
14430
  declare function comments(): Promise<TypedFlatConfigItem[]>;
14537
14431
 
@@ -14814,28 +14708,6 @@ interface UnoCSSOptions {
14814
14708
  }
14815
14709
  declare function unocss(options?: UnoCSSOptions): Promise<TypedFlatConfigItem[]>;
14816
14710
 
14817
- interface NextJSOptions {
14818
- /**
14819
- * Tell the plugin where the root directory is.
14820
- * @see https://nextjs.org/docs/app/building-your-application/configuring/eslint#rootdir
14821
- *
14822
- * @default true
14823
- */
14824
- rootDir?: boolean | string;
14825
- /**
14826
- * Override rules.
14827
- */
14828
- overrides?: TypedFlatConfigItem['rules'];
14829
- /**
14830
- * Glob patterns for Next.js files.
14831
- *
14832
- * @default [GLOB_SRC]
14833
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
14834
- */
14835
- files?: string[];
14836
- }
14837
- declare function nextjs(options?: NextJSOptions): Promise<TypedFlatConfigItem[]>;
14838
-
14839
14711
  interface ReactOptions {
14840
14712
  /**
14841
14713
  * Override rules.
@@ -15145,17 +15017,6 @@ interface ConfigOptions {
15145
15017
  * @default true
15146
15018
  */
15147
15019
  markdown?: boolean;
15148
- /**
15149
- * Enable NextJS support.
15150
- *
15151
- * Requires installing:
15152
- * - `@next/eslint-plugin-next`
15153
- *
15154
- * @default false
15155
- *
15156
- * Note: By enabling this, the `react` option will be enabled automatically.
15157
- */
15158
- nextjs?: boolean | NextJSOptions;
15159
15020
  /**
15160
15021
  * Enable react rules.
15161
15022
  *
@@ -15361,4 +15222,4 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
15361
15222
  declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
15362
15223
  declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): any;
15363
15224
 
15364
- export { type AstroOptions, type Awaitable, type ConfigNames, type ConfigOptions, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type NextJSOptions, type ReactOptions, type ResolvedOptions, type Rules, type SolidOptions, type StylisticConfig, type StylisticOptions, type SvelteOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type TypedFlatConfigItem, type UnoCSSOptions, type UserConfigItem, type VueOptions, type YAMLOptions, astro, combine, comments, luxass as default, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, nextjs, node, parserPlain, react, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
15225
+ export { type AstroOptions, type Awaitable, type ConfigNames, type ConfigOptions, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type ReactOptions, type ResolvedOptions, type Rules, type SolidOptions, type StylisticConfig, type StylisticOptions, type SvelteOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type TypedFlatConfigItem, type UnoCSSOptions, type UserConfigItem, type VueOptions, type YAMLOptions, astro, combine, comments, luxass as default, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, node, parserPlain, react, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.d.ts CHANGED
@@ -1490,110 +1490,6 @@ interface RuleOptions {
1490
1490
  * @deprecated
1491
1491
  */
1492
1492
  'newline-per-chained-call'?: Linter.RuleEntry<NewlinePerChainedCall>
1493
- /**
1494
- * Enforce font-display behavior with Google Fonts.
1495
- * @see https://nextjs.org/docs/messages/google-font-display
1496
- */
1497
- 'nextjs/google-font-display'?: Linter.RuleEntry<[]>
1498
- /**
1499
- * Ensure `preconnect` is used with Google Fonts.
1500
- * @see https://nextjs.org/docs/messages/google-font-preconnect
1501
- */
1502
- 'nextjs/google-font-preconnect'?: Linter.RuleEntry<[]>
1503
- /**
1504
- * Enforce `id` attribute on `next/script` components with inline content.
1505
- * @see https://nextjs.org/docs/messages/inline-script-id
1506
- */
1507
- 'nextjs/inline-script-id'?: Linter.RuleEntry<[]>
1508
- /**
1509
- * Prefer `next/script` component when using the inline script for Google Analytics.
1510
- * @see https://nextjs.org/docs/messages/next-script-for-ga
1511
- */
1512
- 'nextjs/next-script-for-ga'?: Linter.RuleEntry<[]>
1513
- /**
1514
- * Prevent assignment to the `module` variable.
1515
- * @see https://nextjs.org/docs/messages/no-assign-module-variable
1516
- */
1517
- 'nextjs/no-assign-module-variable'?: Linter.RuleEntry<[]>
1518
- /**
1519
- * Prevent client components from being async functions.
1520
- * @see https://nextjs.org/docs/messages/no-async-client-component
1521
- */
1522
- 'nextjs/no-async-client-component'?: Linter.RuleEntry<[]>
1523
- /**
1524
- * Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.
1525
- * @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
1526
- */
1527
- 'nextjs/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]>
1528
- /**
1529
- * Prevent manual stylesheet tags.
1530
- * @see https://nextjs.org/docs/messages/no-css-tags
1531
- */
1532
- 'nextjs/no-css-tags'?: Linter.RuleEntry<[]>
1533
- /**
1534
- * Prevent importing `next/document` outside of `pages/_document.js`.
1535
- * @see https://nextjs.org/docs/messages/no-document-import-in-page
1536
- */
1537
- 'nextjs/no-document-import-in-page'?: Linter.RuleEntry<[]>
1538
- /**
1539
- * Prevent duplicate usage of `<Head>` in `pages/_document.js`.
1540
- * @see https://nextjs.org/docs/messages/no-duplicate-head
1541
- */
1542
- 'nextjs/no-duplicate-head'?: Linter.RuleEntry<[]>
1543
- /**
1544
- * Prevent usage of `<head>` element.
1545
- * @see https://nextjs.org/docs/messages/no-head-element
1546
- */
1547
- 'nextjs/no-head-element'?: Linter.RuleEntry<[]>
1548
- /**
1549
- * Prevent usage of `next/head` in `pages/_document.js`.
1550
- * @see https://nextjs.org/docs/messages/no-head-import-in-document
1551
- */
1552
- 'nextjs/no-head-import-in-document'?: Linter.RuleEntry<[]>
1553
- /**
1554
- * Prevent usage of `<a>` elements to navigate to internal Next.js pages.
1555
- * @see https://nextjs.org/docs/messages/no-html-link-for-pages
1556
- */
1557
- 'nextjs/no-html-link-for-pages'?: Linter.RuleEntry<NextjsNoHtmlLinkForPages>
1558
- /**
1559
- * Prevent usage of `<img>` element due to slower LCP and higher bandwidth.
1560
- * @see https://nextjs.org/docs/messages/no-img-element
1561
- */
1562
- 'nextjs/no-img-element'?: Linter.RuleEntry<[]>
1563
- /**
1564
- * Prevent page-only custom fonts.
1565
- * @see https://nextjs.org/docs/messages/no-page-custom-font
1566
- */
1567
- 'nextjs/no-page-custom-font'?: Linter.RuleEntry<[]>
1568
- /**
1569
- * Prevent usage of `next/script` in `next/head` component.
1570
- * @see https://nextjs.org/docs/messages/no-script-component-in-head
1571
- */
1572
- 'nextjs/no-script-component-in-head'?: Linter.RuleEntry<[]>
1573
- /**
1574
- * Prevent usage of `styled-jsx` in `pages/_document.js`.
1575
- * @see https://nextjs.org/docs/messages/no-styled-jsx-in-document
1576
- */
1577
- 'nextjs/no-styled-jsx-in-document'?: Linter.RuleEntry<[]>
1578
- /**
1579
- * Prevent synchronous scripts.
1580
- * @see https://nextjs.org/docs/messages/no-sync-scripts
1581
- */
1582
- 'nextjs/no-sync-scripts'?: Linter.RuleEntry<[]>
1583
- /**
1584
- * Prevent usage of `<title>` with `Head` component from `next/document`.
1585
- * @see https://nextjs.org/docs/messages/no-title-in-document-head
1586
- */
1587
- 'nextjs/no-title-in-document-head'?: Linter.RuleEntry<[]>
1588
- /**
1589
- * Prevent common typos in Next.js data fetching functions.
1590
- */
1591
- 'nextjs/no-typos'?: Linter.RuleEntry<[]>
1592
- /**
1593
- * Prevent duplicate polyfills from Polyfill.io.
1594
- * @see https://nextjs.org/docs/messages/no-unwanted-polyfillio
1595
- */
1596
- 'nextjs/no-unwanted-polyfillio'?: Linter.RuleEntry<[]>
1597
1493
  /**
1598
1494
  * Disallow the use of `alert`, `confirm`, and `prompt`
1599
1495
  * @see https://eslint.org/docs/latest/rules/no-alert
@@ -9066,8 +8962,6 @@ type NewlineAfterVar = []|[("never" | "always")]
9066
8962
  type NewlinePerChainedCall = []|[{
9067
8963
  ignoreChainWithDepth?: number
9068
8964
  }]
9069
- // ----- nextjs/no-html-link-for-pages -----
9070
- type NextjsNoHtmlLinkForPages = []|[(string | string[])]
9071
8965
  // ----- no-bitwise -----
9072
8966
  type NoBitwise = []|[{
9073
8967
  allow?: ("^" | "|" | "&" | "<<" | ">>" | ">>>" | "^=" | "|=" | "&=" | "<<=" | ">>=" | ">>>=" | "~")[]
@@ -14531,7 +14425,7 @@ type Yoda = []|[("always" | "never")]|[("always" | "never"), {
14531
14425
  onlyEquality?: boolean
14532
14426
  }]
14533
14427
  // Names of all the configs
14534
- type ConfigNames = 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/astro/scripts-js' | 'luxass/astro/scripts-ts' | 'luxass/eslint-comments' | 'luxass/formatter/setup' | 'luxass/imports' | 'luxass/disables/imports-bin' | 'luxass/javascript' | 'luxass/disables/cli' | 'luxass/jsdoc' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/disables' | 'luxass/node' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/sort/package-json' | 'luxass/stylistic' | 'luxass/tailwindcss/setup' | 'luxass/tailwindcss/rules' | 'luxass/sort/tsconfig' | 'luxass/nextjs/setup' | 'luxass/nextjs/rules' | 'luxass/nextjs/default-export-override' | 'luxass/nextjs/og-override' | 'luxass/solid/setup' | 'luxass/solid/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/typescript/setup' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxass/typescript/disables/dts' | 'luxass/typescript/disables/tests' | 'luxass/typescript/disables/playground' | 'luxass/typescript/disables/javascript' | 'luxass/unicorn' | 'luxass/unocss/setup' | 'luxass/unocss/rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/github-actions' | 'antfu/svelte/setup' | 'antfu/svelte/rules'
14428
+ type ConfigNames = 'luxass/astro/setup' | 'luxass/astro/rules' | 'luxass/astro/scripts-js' | 'luxass/astro/scripts-ts' | 'luxass/eslint-comments' | 'luxass/formatter/setup' | 'luxass/imports' | 'luxass/disables/imports-bin' | 'luxass/javascript' | 'luxass/disables/cli' | 'luxass/jsdoc' | 'luxass/jsonc/setup' | 'luxass/jsonc/rules' | 'luxass/markdown/setup' | 'luxass/markdown/processor' | 'luxass/markdown/parser' | 'luxass/markdown/disables' | 'luxass/node' | 'luxass/react/setup' | 'luxass/react/rules' | 'luxass/sort/package-json' | 'luxass/stylistic' | 'luxass/tailwindcss/setup' | 'luxass/tailwindcss/rules' | 'luxass/sort/tsconfig' | 'luxass/solid/setup' | 'luxass/solid/rules' | 'luxass/test/setup' | 'luxass/test/rules' | 'luxass/toml/setup' | 'luxass/toml/rules' | 'luxass/typescript/setup' | 'luxass/typescript/parser' | 'luxass/typescript/rules' | 'luxass/typescript/rules-type-aware' | 'luxass/typescript/disables/dts' | 'luxass/typescript/disables/tests' | 'luxass/typescript/disables/playground' | 'luxass/typescript/disables/javascript' | 'luxass/unicorn' | 'luxass/unocss/setup' | 'luxass/unocss/rules' | 'luxass/vue/setup' | 'luxass/vue/rules' | 'luxass/yaml/setup' | 'luxass/yaml/rules' | 'luxass/yaml/github-actions' | 'antfu/svelte/setup' | 'antfu/svelte/rules'
14535
14429
 
14536
14430
  declare function comments(): Promise<TypedFlatConfigItem[]>;
14537
14431
 
@@ -14814,28 +14708,6 @@ interface UnoCSSOptions {
14814
14708
  }
14815
14709
  declare function unocss(options?: UnoCSSOptions): Promise<TypedFlatConfigItem[]>;
14816
14710
 
14817
- interface NextJSOptions {
14818
- /**
14819
- * Tell the plugin where the root directory is.
14820
- * @see https://nextjs.org/docs/app/building-your-application/configuring/eslint#rootdir
14821
- *
14822
- * @default true
14823
- */
14824
- rootDir?: boolean | string;
14825
- /**
14826
- * Override rules.
14827
- */
14828
- overrides?: TypedFlatConfigItem['rules'];
14829
- /**
14830
- * Glob patterns for Next.js files.
14831
- *
14832
- * @default [GLOB_SRC]
14833
- * @see https://github.com/luxass/eslint-config/blob/main/src/globs.ts
14834
- */
14835
- files?: string[];
14836
- }
14837
- declare function nextjs(options?: NextJSOptions): Promise<TypedFlatConfigItem[]>;
14838
-
14839
14711
  interface ReactOptions {
14840
14712
  /**
14841
14713
  * Override rules.
@@ -15145,17 +15017,6 @@ interface ConfigOptions {
15145
15017
  * @default true
15146
15018
  */
15147
15019
  markdown?: boolean;
15148
- /**
15149
- * Enable NextJS support.
15150
- *
15151
- * Requires installing:
15152
- * - `@next/eslint-plugin-next`
15153
- *
15154
- * @default false
15155
- *
15156
- * Note: By enabling this, the `react` option will be enabled automatically.
15157
- */
15158
- nextjs?: boolean | NextJSOptions;
15159
15020
  /**
15160
15021
  * Enable react rules.
15161
15022
  *
@@ -15361,4 +15222,4 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
15361
15222
  declare function resolveSubOptions<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): ResolvedOptions<ConfigOptions[K]>;
15362
15223
  declare function getOverrides<K extends keyof ConfigOptions>(options: ConfigOptions, key: K): any;
15363
15224
 
15364
- export { type AstroOptions, type Awaitable, type ConfigNames, type ConfigOptions, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type NextJSOptions, type ReactOptions, type ResolvedOptions, type Rules, type SolidOptions, type StylisticConfig, type StylisticOptions, type SvelteOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type TypedFlatConfigItem, type UnoCSSOptions, type UserConfigItem, type VueOptions, type YAMLOptions, astro, combine, comments, luxass as default, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, nextjs, node, parserPlain, react, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
15225
+ export { type AstroOptions, type Awaitable, type ConfigNames, type ConfigOptions, type FormattersOptions, GLOB_ASTRO, GLOB_CSS, GLOB_EXCLUDE, GLOB_GRAPHQL, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_NEXTJS_OG, GLOB_NEXTJS_ROUTES, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type ImportsOptions, type JSDOCOptions, type JSONOptions, type JavaScriptOptions, type MarkdownOptions, type ReactOptions, type ResolvedOptions, type Rules, type SolidOptions, type StylisticConfig, type StylisticOptions, type SvelteOptions, type TOMLOptions, type TailwindCSSOptions, type TestOptions, type TypeScriptOptions, type TypedFlatConfigItem, type UnoCSSOptions, type UserConfigItem, type VueOptions, type YAMLOptions, astro, combine, comments, luxass as default, ensure, formatters, getOverrides, ignores, imports, interop, javascript, jsdoc, jsonc, luxass, markdown, node, parserPlain, react, renameRules, resolveSubOptions, solid, sortPackageJson, sortTsconfig, stylistic, svelte, tailwindcss, test, toArray, toml, typescript, unicorn, unocss, vue, yaml };
package/dist/index.js CHANGED
@@ -1692,88 +1692,6 @@ async function unocss(options = {}) {
1692
1692
  ];
1693
1693
  }
1694
1694
 
1695
- // src/configs/nextjs.ts
1696
- async function nextjs(options = {}) {
1697
- const {
1698
- files = [GLOB_SRC],
1699
- overrides,
1700
- rootDir
1701
- } = options;
1702
- await ensure([
1703
- "@next/eslint-plugin-next"
1704
- ]);
1705
- const pluginNextjs = await interop(import("@next/eslint-plugin-next"));
1706
- return [
1707
- {
1708
- name: "luxass/nextjs/setup",
1709
- plugins: {
1710
- nextjs: pluginNextjs
1711
- }
1712
- },
1713
- {
1714
- name: "luxass/nextjs/rules",
1715
- files,
1716
- rules: {
1717
- ...renameRules(
1718
- pluginNextjs.configs.recommended.rules,
1719
- "@next/next/",
1720
- "nextjs/"
1721
- ),
1722
- ...renameRules(
1723
- pluginNextjs.configs["core-web-vitals"].rules,
1724
- "@next/next/",
1725
- "nextjs/"
1726
- ),
1727
- "nextjs/google-font-display": ["error"],
1728
- "nextjs/google-font-preconnect": ["error"],
1729
- "nextjs/inline-script-id": ["error"],
1730
- "nextjs/next-script-for-ga": ["warn"],
1731
- "nextjs/no-assign-module-variable": ["error"],
1732
- "nextjs/no-css-tags": ["warn"],
1733
- "nextjs/no-document-import-in-page": ["error"],
1734
- "nextjs/no-duplicate-head": ["error"],
1735
- "nextjs/no-head-element": ["warn"],
1736
- "nextjs/no-head-import-in-document": ["error"],
1737
- "nextjs/no-html-link-for-pages": ["off"],
1738
- "nextjs/no-img-element": ["warn"],
1739
- "nextjs/no-page-custom-font": ["warn"],
1740
- "nextjs/no-script-component-in-head": ["error"],
1741
- "nextjs/no-styled-jsx-in-document": ["warn"],
1742
- "nextjs/no-sync-scripts": ["warn"],
1743
- "nextjs/no-title-in-document-head": ["warn"],
1744
- "nextjs/no-typos": ["warn"],
1745
- "nextjs/no-unwanted-polyfillio": ["warn"],
1746
- // This rule creates errors with webpack parsing on edge runtime
1747
- "unicorn/prefer-node-protocol": ["off"],
1748
- ...overrides
1749
- },
1750
- settings: {
1751
- next: {
1752
- rootDir: rootDir ?? true
1753
- },
1754
- react: {
1755
- pragma: "React",
1756
- version: "detect"
1757
- }
1758
- }
1759
- },
1760
- {
1761
- name: "luxass/nextjs/default-export-override",
1762
- files: GLOB_NEXTJS_ROUTES,
1763
- rules: {
1764
- "import/prefer-default-export": "error"
1765
- }
1766
- },
1767
- {
1768
- name: "luxass/nextjs/og-override",
1769
- files: GLOB_NEXTJS_OG,
1770
- rules: {
1771
- "nextjs/no-img-element": "off"
1772
- }
1773
- }
1774
- ];
1775
- }
1776
-
1777
1695
  // src/configs/react.ts
1778
1696
  import { isPackageExists as isPackageExists2 } from "local-pkg";
1779
1697
  var ReactRefreshAllowConstantExportPackages = [
@@ -1863,6 +1781,7 @@ async function react(options = {}) {
1863
1781
  allowExportNames: [
1864
1782
  ...isUsingNext ? [
1865
1783
  "config",
1784
+ "runtime",
1866
1785
  "generateStaticParams",
1867
1786
  "metadata",
1868
1787
  "generateMetadata",
@@ -2423,8 +2342,7 @@ var defaultPluginRenaming = {
2423
2342
  "@eslint-react": "react",
2424
2343
  "@eslint-react/dom": "react-dom",
2425
2344
  "@eslint-react/hooks-extra": "react-hooks-extra",
2426
- "@eslint-react/naming-convention": "react-naming-convention",
2427
- "@next/next": "nextjs"
2345
+ "@eslint-react/naming-convention": "react-naming-convention"
2428
2346
  };
2429
2347
  function luxass(options = {}, ...userConfigs) {
2430
2348
  const {
@@ -2433,7 +2351,6 @@ function luxass(options = {}, ...userConfigs) {
2433
2351
  editor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE || process3.env.VIM) && !process3.env.CI),
2434
2352
  exts = [],
2435
2353
  gitignore: enableGitignore = true,
2436
- nextjs: enableNextJS = false,
2437
2354
  react: enableReact = false,
2438
2355
  tailwindcss: enableTailwindCSS = false,
2439
2356
  svelte: enableSvelte = false,
@@ -2494,21 +2411,13 @@ function luxass(options = {}, ...userConfigs) {
2494
2411
  overrides: getOverrides(options, "test")
2495
2412
  }));
2496
2413
  }
2497
- if (enableReact || enableNextJS) {
2414
+ if (enableReact) {
2498
2415
  configs.push(react({
2499
2416
  ...resolveSubOptions(options, "react"),
2500
2417
  overrides: getOverrides(options, "react"),
2501
2418
  tsconfigPath: getOverrides(options, "typescript").tsconfigPath
2502
2419
  }));
2503
2420
  }
2504
- if (enableNextJS) {
2505
- configs.push(
2506
- nextjs({
2507
- ...resolveSubOptions(options, "nextjs"),
2508
- overrides: getOverrides(options, "nextjs")
2509
- })
2510
- );
2511
- }
2512
2421
  if (enableSolid) {
2513
2422
  configs.push(
2514
2423
  solid({
@@ -2661,7 +2570,6 @@ export {
2661
2570
  jsonc,
2662
2571
  luxass,
2663
2572
  markdown,
2664
- nextjs,
2665
2573
  node,
2666
2574
  parserPlain,
2667
2575
  react,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxass/eslint-config",
3
- "version": "4.4.2",
3
+ "version": "4.4.3",
4
4
  "description": "ESLint config for @luxass",
5
5
  "type": "module",
6
6
  "author": {
@@ -49,7 +49,6 @@
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@eslint-react/eslint-plugin": "^1.5.8",
52
- "@next/eslint-plugin-next": "^14.0.0",
53
52
  "@unocss/eslint-plugin": ">=0.50.0",
54
53
  "astro-eslint-parser": "^0.16.3",
55
54
  "eslint": ">=8.40.0",
@@ -91,9 +90,6 @@
91
90
  "prettier-plugin-astro": {
92
91
  "optional": true
93
92
  },
94
- "@next/eslint-plugin-next": {
95
- "optional": true
96
- },
97
93
  "eslint-plugin-tailwindcss": {
98
94
  "optional": true
99
95
  },
@@ -140,7 +136,6 @@
140
136
  "@antfu/eslint-plugin-prettier": "^5.0.1-1",
141
137
  "@eslint-react/eslint-plugin": "^1.5.10",
142
138
  "@eslint/config-inspector": "^0.4.8",
143
- "@next/eslint-plugin-next": "^14.2.3",
144
139
  "@stylistic/eslint-plugin-migrate": "^1.8.0",
145
140
  "@types/eslint": "^8.56.10",
146
141
  "@types/estree": "^1.0.5",