@debbl/eslint-config 3.8.3 → 3.8.5

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/dist/index.cjs CHANGED
@@ -183,6 +183,7 @@ var GLOB_EXCLUDE = [
183
183
  "**/yarn.lock",
184
184
  "**/pnpm-lock.yaml",
185
185
  "**/bun.lockb",
186
+ "**/public",
186
187
  "**/output",
187
188
  "**/coverage",
188
189
  "**/temp",
@@ -601,31 +602,50 @@ var jsonc = async (options) => {
601
602
  };
602
603
 
603
604
  // src/configs/markdown.ts
605
+ async function mdx() {
606
+ const pluginMdx = await interopDefault(import("eslint-plugin-mdx"));
607
+ return [
608
+ {
609
+ ...pluginMdx.flat,
610
+ processor: pluginMdx.createRemarkProcessor({
611
+ lintCodeBlocks: true,
612
+ languageMapper: {}
613
+ })
614
+ },
615
+ {
616
+ ...pluginMdx.flatCodeBlocks,
617
+ rules: {
618
+ ...pluginMdx.flatCodeBlocks.rules,
619
+ "no-var": "error",
620
+ "prefer-const": "error"
621
+ }
622
+ }
623
+ ];
624
+ }
604
625
  var markdown = async (options) => {
605
- const { componentExts = [], overrides = {} } = options;
606
- const [pluginMdx, pluginMarkdown] = await Promise.all([
626
+ const {
627
+ mdx: enableMdx = false,
628
+ componentExts = [],
629
+ overrides = {}
630
+ } = options;
631
+ const pluginMarkdown = await Promise.all([
607
632
  interopDefault(import("eslint-plugin-mdx")),
608
633
  interopDefault(import("@eslint/markdown"))
609
634
  ]);
610
- return [
635
+ const _markdown = [
611
636
  {
612
637
  name: "eslint/markdown/setup",
613
638
  plugins: {
614
- mdx: pluginMdx,
615
639
  markdown: pluginMarkdown
616
640
  }
617
641
  },
618
642
  {
619
643
  name: "eslint/markdown/processor",
620
- files: [GLOB_MARKDOWN, GLOB_MDX],
644
+ files: [GLOB_MARKDOWN],
621
645
  languageOptions: {
622
646
  ecmaVersion: "latest",
623
647
  parser: parserPlain,
624
648
  sourceType: "module"
625
- },
626
- processor: "mdx/remark",
627
- settings: {
628
- "mdx/code-blocks": true
629
649
  }
630
650
  },
631
651
  {
@@ -678,6 +698,7 @@ var markdown = async (options) => {
678
698
  }
679
699
  }
680
700
  ];
701
+ return combine(_markdown, enableMdx ? await mdx() : []);
681
702
  };
682
703
 
683
704
  // src/configs/node.ts
@@ -1072,7 +1093,7 @@ async function sortTsconfig() {
1072
1093
  var test = async (options) => {
1073
1094
  const { overrides = {} } = options;
1074
1095
  const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
1075
- interopDefault(import("eslint-plugin-vitest")),
1096
+ interopDefault(import("@vitest/eslint-plugin")),
1076
1097
  // @ts-expect-error missing types
1077
1098
  interopDefault(import("eslint-plugin-no-only-tests"))
1078
1099
  ]);
@@ -1562,9 +1583,19 @@ async function next() {
1562
1583
  "warn",
1563
1584
  {
1564
1585
  allowExportNames: [
1586
+ "dynamic",
1587
+ "dynamicParams",
1588
+ "revalidate",
1589
+ "fetchCache",
1590
+ "runtime",
1591
+ "preferredRegion",
1592
+ "maxDuration",
1593
+ "config",
1594
+ "generateStaticParams",
1565
1595
  "metadata",
1566
1596
  "generateMetadata",
1567
- "generateStaticParams"
1597
+ "viewport",
1598
+ "generateViewport"
1568
1599
  ]
1569
1600
  }
1570
1601
  ]
@@ -1580,18 +1611,21 @@ var react = async (options) => {
1580
1611
  } = options;
1581
1612
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
1582
1613
  [
1583
- interopDefault(import("eslint-plugin-react")),
1614
+ interopDefault(import("@eslint-react/eslint-plugin")),
1584
1615
  // @ts-expect-error missing types
1585
1616
  interopDefault(import("eslint-plugin-react-hooks")),
1586
- // @ts-expect-error missing types
1587
1617
  interopDefault(import("eslint-plugin-react-refresh"))
1588
1618
  ]
1589
1619
  );
1620
+ const plugins = pluginReact.configs.all.plugins;
1590
1621
  const _react = [
1591
1622
  {
1592
1623
  name: "eslint/react/setup",
1593
1624
  plugins: {
1594
- "react": pluginReact,
1625
+ "react": plugins["@eslint-react"],
1626
+ "react-dom": plugins["@eslint-react/dom"],
1627
+ "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
1628
+ "react-naming-convention": plugins["@eslint-react/naming-convention"],
1595
1629
  "react-hooks": pluginReactHooks,
1596
1630
  "react-refresh": pluginReactRefresh,
1597
1631
  ...enableCompiler ? {
@@ -1619,14 +1653,69 @@ var react = async (options) => {
1619
1653
  }
1620
1654
  },
1621
1655
  rules: {
1622
- ...pluginReact.configs.recommended.rules,
1623
1656
  ...pluginReactHooks.configs.recommended.rules,
1657
+ // recommended rules from @eslint-react/dom
1658
+ "react-dom/no-children-in-void-dom-elements": "warn",
1659
+ "react-dom/no-dangerously-set-innerhtml": "warn",
1660
+ "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1661
+ "react-dom/no-find-dom-node": "error",
1662
+ "react-dom/no-missing-button-type": "warn",
1663
+ "react-dom/no-missing-iframe-sandbox": "warn",
1664
+ "react-dom/no-namespace": "error",
1665
+ "react-dom/no-render-return-value": "error",
1666
+ "react-dom/no-script-url": "warn",
1667
+ "react-dom/no-unsafe-iframe-sandbox": "warn",
1668
+ "react-dom/no-unsafe-target-blank": "warn",
1669
+ // recommended rules react-hooks
1670
+ "react-hooks/exhaustive-deps": "warn",
1671
+ "react-hooks/rules-of-hooks": "error",
1624
1672
  // React Refresh
1625
1673
  "react-refresh/only-export-components": "warn",
1626
1674
  // React Compiler
1627
1675
  ...enableCompiler ? {
1628
1676
  "react-compiler/react-compiler": "error"
1629
1677
  } : {},
1678
+ // recommended rules from @eslint-react
1679
+ "react/ensure-forward-ref-using-ref": "warn",
1680
+ "react/jsx-no-duplicate-props": "warn",
1681
+ "react/jsx-uses-vars": "warn",
1682
+ "react/no-access-state-in-setstate": "error",
1683
+ "react/no-array-index-key": "warn",
1684
+ "react/no-children-count": "warn",
1685
+ "react/no-children-for-each": "warn",
1686
+ "react/no-children-map": "warn",
1687
+ "react/no-children-only": "warn",
1688
+ "react/no-children-to-array": "warn",
1689
+ "react/no-clone-element": "warn",
1690
+ "react/no-comment-textnodes": "warn",
1691
+ "react/no-component-will-mount": "error",
1692
+ "react/no-component-will-receive-props": "error",
1693
+ "react/no-component-will-update": "error",
1694
+ "react/no-context-provider": "warn",
1695
+ "react/no-create-ref": "error",
1696
+ "react/no-default-props": "error",
1697
+ "react/no-direct-mutation-state": "error",
1698
+ "react/no-duplicate-key": "error",
1699
+ "react/no-forward-ref": "warn",
1700
+ "react/no-implicit-key": "warn",
1701
+ "react/no-missing-key": "error",
1702
+ "react/no-nested-components": "error",
1703
+ "react/no-prop-types": "error",
1704
+ "react/no-redundant-should-component-update": "error",
1705
+ "react/no-set-state-in-component-did-mount": "warn",
1706
+ "react/no-set-state-in-component-did-update": "warn",
1707
+ "react/no-set-state-in-component-will-update": "warn",
1708
+ "react/no-string-refs": "error",
1709
+ "react/no-unsafe-component-will-mount": "warn",
1710
+ "react/no-unsafe-component-will-receive-props": "warn",
1711
+ "react/no-unsafe-component-will-update": "warn",
1712
+ "react/no-unstable-context-value": "warn",
1713
+ "react/no-unstable-default-props": "warn",
1714
+ "react/no-unused-class-component-members": "warn",
1715
+ "react/no-unused-state": "warn",
1716
+ "react/prefer-destructuring-assignment": "warn",
1717
+ "react/prefer-shorthand-boolean": "warn",
1718
+ "react/prefer-shorthand-fragment": "warn",
1630
1719
  "jsx-quotes": ["error", "prefer-double"],
1631
1720
  "react/react-in-jsx-scope": "off",
1632
1721
  "react/jsx-indent": [1, 2],
package/dist/index.d.cts CHANGED
@@ -24,6 +24,7 @@ declare const jsonc: JsoncConfig;
24
24
 
25
25
  type MarkdownConfig = (options: {
26
26
  componentExts?: string[];
27
+ mdx?: boolean;
27
28
  } & OptionsOverrides) => ReturnType<ConfigFn>;
28
29
  declare const markdown: MarkdownConfig;
29
30
 
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ declare const jsonc: JsoncConfig;
24
24
 
25
25
  type MarkdownConfig = (options: {
26
26
  componentExts?: string[];
27
+ mdx?: boolean;
27
28
  } & OptionsOverrides) => ReturnType<ConfigFn>;
28
29
  declare const markdown: MarkdownConfig;
29
30
 
package/dist/index.js CHANGED
@@ -100,6 +100,7 @@ var GLOB_EXCLUDE = [
100
100
  "**/yarn.lock",
101
101
  "**/pnpm-lock.yaml",
102
102
  "**/bun.lockb",
103
+ "**/public",
103
104
  "**/output",
104
105
  "**/coverage",
105
106
  "**/temp",
@@ -518,31 +519,50 @@ var jsonc = async (options) => {
518
519
  };
519
520
 
520
521
  // src/configs/markdown.ts
522
+ async function mdx() {
523
+ const pluginMdx = await interopDefault(import("eslint-plugin-mdx"));
524
+ return [
525
+ {
526
+ ...pluginMdx.flat,
527
+ processor: pluginMdx.createRemarkProcessor({
528
+ lintCodeBlocks: true,
529
+ languageMapper: {}
530
+ })
531
+ },
532
+ {
533
+ ...pluginMdx.flatCodeBlocks,
534
+ rules: {
535
+ ...pluginMdx.flatCodeBlocks.rules,
536
+ "no-var": "error",
537
+ "prefer-const": "error"
538
+ }
539
+ }
540
+ ];
541
+ }
521
542
  var markdown = async (options) => {
522
- const { componentExts = [], overrides = {} } = options;
523
- const [pluginMdx, pluginMarkdown] = await Promise.all([
543
+ const {
544
+ mdx: enableMdx = false,
545
+ componentExts = [],
546
+ overrides = {}
547
+ } = options;
548
+ const pluginMarkdown = await Promise.all([
524
549
  interopDefault(import("eslint-plugin-mdx")),
525
550
  interopDefault(import("@eslint/markdown"))
526
551
  ]);
527
- return [
552
+ const _markdown = [
528
553
  {
529
554
  name: "eslint/markdown/setup",
530
555
  plugins: {
531
- mdx: pluginMdx,
532
556
  markdown: pluginMarkdown
533
557
  }
534
558
  },
535
559
  {
536
560
  name: "eslint/markdown/processor",
537
- files: [GLOB_MARKDOWN, GLOB_MDX],
561
+ files: [GLOB_MARKDOWN],
538
562
  languageOptions: {
539
563
  ecmaVersion: "latest",
540
564
  parser: parserPlain,
541
565
  sourceType: "module"
542
- },
543
- processor: "mdx/remark",
544
- settings: {
545
- "mdx/code-blocks": true
546
566
  }
547
567
  },
548
568
  {
@@ -595,6 +615,7 @@ var markdown = async (options) => {
595
615
  }
596
616
  }
597
617
  ];
618
+ return combine(_markdown, enableMdx ? await mdx() : []);
598
619
  };
599
620
 
600
621
  // src/configs/node.ts
@@ -989,7 +1010,7 @@ async function sortTsconfig() {
989
1010
  var test = async (options) => {
990
1011
  const { overrides = {} } = options;
991
1012
  const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
992
- interopDefault(import("eslint-plugin-vitest")),
1013
+ interopDefault(import("@vitest/eslint-plugin")),
993
1014
  // @ts-expect-error missing types
994
1015
  interopDefault(import("eslint-plugin-no-only-tests"))
995
1016
  ]);
@@ -1479,9 +1500,19 @@ async function next() {
1479
1500
  "warn",
1480
1501
  {
1481
1502
  allowExportNames: [
1503
+ "dynamic",
1504
+ "dynamicParams",
1505
+ "revalidate",
1506
+ "fetchCache",
1507
+ "runtime",
1508
+ "preferredRegion",
1509
+ "maxDuration",
1510
+ "config",
1511
+ "generateStaticParams",
1482
1512
  "metadata",
1483
1513
  "generateMetadata",
1484
- "generateStaticParams"
1514
+ "viewport",
1515
+ "generateViewport"
1485
1516
  ]
1486
1517
  }
1487
1518
  ]
@@ -1497,18 +1528,21 @@ var react = async (options) => {
1497
1528
  } = options;
1498
1529
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
1499
1530
  [
1500
- interopDefault(import("eslint-plugin-react")),
1531
+ interopDefault(import("@eslint-react/eslint-plugin")),
1501
1532
  // @ts-expect-error missing types
1502
1533
  interopDefault(import("eslint-plugin-react-hooks")),
1503
- // @ts-expect-error missing types
1504
1534
  interopDefault(import("eslint-plugin-react-refresh"))
1505
1535
  ]
1506
1536
  );
1537
+ const plugins = pluginReact.configs.all.plugins;
1507
1538
  const _react = [
1508
1539
  {
1509
1540
  name: "eslint/react/setup",
1510
1541
  plugins: {
1511
- "react": pluginReact,
1542
+ "react": plugins["@eslint-react"],
1543
+ "react-dom": plugins["@eslint-react/dom"],
1544
+ "react-hooks-extra": plugins["@eslint-react/hooks-extra"],
1545
+ "react-naming-convention": plugins["@eslint-react/naming-convention"],
1512
1546
  "react-hooks": pluginReactHooks,
1513
1547
  "react-refresh": pluginReactRefresh,
1514
1548
  ...enableCompiler ? {
@@ -1536,14 +1570,69 @@ var react = async (options) => {
1536
1570
  }
1537
1571
  },
1538
1572
  rules: {
1539
- ...pluginReact.configs.recommended.rules,
1540
1573
  ...pluginReactHooks.configs.recommended.rules,
1574
+ // recommended rules from @eslint-react/dom
1575
+ "react-dom/no-children-in-void-dom-elements": "warn",
1576
+ "react-dom/no-dangerously-set-innerhtml": "warn",
1577
+ "react-dom/no-dangerously-set-innerhtml-with-children": "error",
1578
+ "react-dom/no-find-dom-node": "error",
1579
+ "react-dom/no-missing-button-type": "warn",
1580
+ "react-dom/no-missing-iframe-sandbox": "warn",
1581
+ "react-dom/no-namespace": "error",
1582
+ "react-dom/no-render-return-value": "error",
1583
+ "react-dom/no-script-url": "warn",
1584
+ "react-dom/no-unsafe-iframe-sandbox": "warn",
1585
+ "react-dom/no-unsafe-target-blank": "warn",
1586
+ // recommended rules react-hooks
1587
+ "react-hooks/exhaustive-deps": "warn",
1588
+ "react-hooks/rules-of-hooks": "error",
1541
1589
  // React Refresh
1542
1590
  "react-refresh/only-export-components": "warn",
1543
1591
  // React Compiler
1544
1592
  ...enableCompiler ? {
1545
1593
  "react-compiler/react-compiler": "error"
1546
1594
  } : {},
1595
+ // recommended rules from @eslint-react
1596
+ "react/ensure-forward-ref-using-ref": "warn",
1597
+ "react/jsx-no-duplicate-props": "warn",
1598
+ "react/jsx-uses-vars": "warn",
1599
+ "react/no-access-state-in-setstate": "error",
1600
+ "react/no-array-index-key": "warn",
1601
+ "react/no-children-count": "warn",
1602
+ "react/no-children-for-each": "warn",
1603
+ "react/no-children-map": "warn",
1604
+ "react/no-children-only": "warn",
1605
+ "react/no-children-to-array": "warn",
1606
+ "react/no-clone-element": "warn",
1607
+ "react/no-comment-textnodes": "warn",
1608
+ "react/no-component-will-mount": "error",
1609
+ "react/no-component-will-receive-props": "error",
1610
+ "react/no-component-will-update": "error",
1611
+ "react/no-context-provider": "warn",
1612
+ "react/no-create-ref": "error",
1613
+ "react/no-default-props": "error",
1614
+ "react/no-direct-mutation-state": "error",
1615
+ "react/no-duplicate-key": "error",
1616
+ "react/no-forward-ref": "warn",
1617
+ "react/no-implicit-key": "warn",
1618
+ "react/no-missing-key": "error",
1619
+ "react/no-nested-components": "error",
1620
+ "react/no-prop-types": "error",
1621
+ "react/no-redundant-should-component-update": "error",
1622
+ "react/no-set-state-in-component-did-mount": "warn",
1623
+ "react/no-set-state-in-component-did-update": "warn",
1624
+ "react/no-set-state-in-component-will-update": "warn",
1625
+ "react/no-string-refs": "error",
1626
+ "react/no-unsafe-component-will-mount": "warn",
1627
+ "react/no-unsafe-component-will-receive-props": "warn",
1628
+ "react/no-unsafe-component-will-update": "warn",
1629
+ "react/no-unstable-context-value": "warn",
1630
+ "react/no-unstable-default-props": "warn",
1631
+ "react/no-unused-class-component-members": "warn",
1632
+ "react/no-unused-state": "warn",
1633
+ "react/prefer-destructuring-assignment": "warn",
1634
+ "react/prefer-shorthand-boolean": "warn",
1635
+ "react/prefer-shorthand-fragment": "warn",
1547
1636
  "jsx-quotes": ["error", "prefer-double"],
1548
1637
  "react/react-in-jsx-scope": "off",
1549
1638
  "react/jsx-indent": [1, 2],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@debbl/eslint-config",
3
3
  "type": "module",
4
- "version": "3.8.3",
4
+ "version": "3.8.5",
5
5
  "description": "Brendan Dash's ESLint config",
6
6
  "author": "Debbl <me@aiwan.run> (https://github.com/Debbl/)",
7
7
  "license": "MIT",
@@ -23,58 +23,64 @@
23
23
  "dist"
24
24
  ],
25
25
  "peerDependencies": {
26
- "eslint": ">=8.40.0"
26
+ "eslint": ">=8.40.0",
27
+ "eslint-plugin-mdx": ">=3.1.5"
28
+ },
29
+ "peerDependenciesMeta": {
30
+ "eslint-plugin-mdx": {
31
+ "optional": true
32
+ }
27
33
  },
28
34
  "dependencies": {
35
+ "@eslint-react/eslint-plugin": "^1.19.0",
29
36
  "@eslint/markdown": "^6.2.1",
30
- "@next/eslint-plugin-next": "^15.0.1",
31
- "@typescript-eslint/eslint-plugin": "^8.11.0",
32
- "@typescript-eslint/parser": "^8.11.0",
37
+ "@next/eslint-plugin-next": "^15.1.0",
38
+ "@typescript-eslint/eslint-plugin": "^8.18.0",
39
+ "@typescript-eslint/parser": "^8.18.0",
40
+ "@vitest/eslint-plugin": "^1.1.16",
33
41
  "eslint-config-prettier": "^9.1.0",
34
42
  "eslint-plugin-eslint-comments": "^3.2.0",
35
- "eslint-plugin-import-x": "^4.3.1",
36
- "eslint-plugin-jsdoc": "^50.4.3",
37
- "eslint-plugin-jsonc": "^2.16.0",
38
- "eslint-plugin-mdx": "^3.1.5",
39
- "eslint-plugin-n": "^17.11.1",
43
+ "eslint-plugin-import-x": "^4.5.0",
44
+ "eslint-plugin-jsdoc": "^50.6.1",
45
+ "eslint-plugin-jsonc": "^2.18.2",
46
+ "eslint-plugin-n": "^17.15.0",
40
47
  "eslint-plugin-no-only-tests": "^3.3.0",
41
- "eslint-plugin-perfectionist": "^3.9.1",
48
+ "eslint-plugin-perfectionist": "^4.3.0",
42
49
  "eslint-plugin-prettier": "^5.2.1",
43
- "eslint-plugin-react": "^7.37.2",
44
50
  "eslint-plugin-react-compiler": "latest",
45
- "eslint-plugin-react-hooks": "^5.0.0",
46
- "eslint-plugin-react-refresh": "^0.4.14",
47
- "eslint-plugin-solid": "^0.14.3",
51
+ "eslint-plugin-react-hooks": "^5.1.0",
52
+ "eslint-plugin-react-refresh": "^0.4.16",
53
+ "eslint-plugin-solid": "^0.14.5",
48
54
  "eslint-plugin-tailwindcss": "^3.17.5",
49
- "eslint-plugin-toml": "^0.11.1",
50
- "eslint-plugin-unicorn": "^56.0.0",
55
+ "eslint-plugin-toml": "^0.12.0",
56
+ "eslint-plugin-unicorn": "^56.0.1",
51
57
  "eslint-plugin-unused-imports": "^4.1.4",
52
- "eslint-plugin-vitest": "^0.5.4",
53
- "eslint-plugin-vue": "^9.29.1",
54
- "eslint-plugin-yml": "^1.14.0",
55
- "globals": "^15.11.0",
58
+ "eslint-plugin-vue": "^9.32.0",
59
+ "eslint-plugin-yml": "^1.16.0",
60
+ "globals": "^15.13.0",
56
61
  "jsonc-eslint-parser": "^2.4.0",
57
- "prettier": "^3.3.3",
58
- "prettier-plugin-tailwindcss": "^0.6.8",
62
+ "prettier": "^3.4.2",
63
+ "prettier-plugin-tailwindcss": "^0.6.9",
59
64
  "toml-eslint-parser": "^0.10.0",
60
65
  "vue-eslint-parser": "^9.4.3",
61
66
  "yaml-eslint-parser": "^1.2.3"
62
67
  },
63
68
  "devDependencies": {
64
- "@eslint/config-inspector": "^0.5.5",
69
+ "@eslint/config-inspector": "^0.6.0",
65
70
  "@types/eslint": "^9.6.1",
66
- "@types/node": "^22.8.1",
67
- "@types/react": "^18.3.12",
68
- "bumpp": "^9.7.1",
69
- "eslint": "^9.13.0",
70
- "execa": "^9.4.1",
71
+ "@types/node": "^22.10.2",
72
+ "@types/react": "^19.0.1",
73
+ "bumpp": "^9.9.1",
74
+ "eslint": "^9.16.0",
75
+ "eslint-plugin-mdx": "^3.1.5",
76
+ "execa": "^9.5.2",
71
77
  "fast-glob": "^3.3.2",
72
78
  "fs-extra": "^11.2.0",
73
- "react": "^18.3.1",
79
+ "react": "^19.0.0",
74
80
  "sucrase": "^3.35.0",
75
81
  "tsup": "^8.3.5",
76
- "typescript": "^5.6.3",
77
- "vitest": "^2.1.3"
82
+ "typescript": "^5.7.2",
83
+ "vitest": "^2.1.8"
78
84
  },
79
85
  "scripts": {
80
86
  "build": "tsup --format esm,cjs --clean --dts",