@debbl/eslint-config 3.8.4 → 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
@@ -602,31 +602,50 @@ var jsonc = async (options) => {
602
602
  };
603
603
 
604
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
+ }
605
625
  var markdown = async (options) => {
606
- const { componentExts = [], overrides = {} } = options;
607
- const [pluginMdx, pluginMarkdown] = await Promise.all([
626
+ const {
627
+ mdx: enableMdx = false,
628
+ componentExts = [],
629
+ overrides = {}
630
+ } = options;
631
+ const pluginMarkdown = await Promise.all([
608
632
  interopDefault(import("eslint-plugin-mdx")),
609
633
  interopDefault(import("@eslint/markdown"))
610
634
  ]);
611
- return [
635
+ const _markdown = [
612
636
  {
613
637
  name: "eslint/markdown/setup",
614
638
  plugins: {
615
- mdx: pluginMdx,
616
639
  markdown: pluginMarkdown
617
640
  }
618
641
  },
619
642
  {
620
643
  name: "eslint/markdown/processor",
621
- files: [GLOB_MARKDOWN, GLOB_MDX],
644
+ files: [GLOB_MARKDOWN],
622
645
  languageOptions: {
623
646
  ecmaVersion: "latest",
624
647
  parser: parserPlain,
625
648
  sourceType: "module"
626
- },
627
- processor: "mdx/remark",
628
- settings: {
629
- "mdx/code-blocks": true
630
649
  }
631
650
  },
632
651
  {
@@ -679,6 +698,7 @@ var markdown = async (options) => {
679
698
  }
680
699
  }
681
700
  ];
701
+ return combine(_markdown, enableMdx ? await mdx() : []);
682
702
  };
683
703
 
684
704
  // src/configs/node.ts
@@ -1073,7 +1093,7 @@ async function sortTsconfig() {
1073
1093
  var test = async (options) => {
1074
1094
  const { overrides = {} } = options;
1075
1095
  const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
1076
- interopDefault(import("eslint-plugin-vitest")),
1096
+ interopDefault(import("@vitest/eslint-plugin")),
1077
1097
  // @ts-expect-error missing types
1078
1098
  interopDefault(import("eslint-plugin-no-only-tests"))
1079
1099
  ]);
@@ -1563,9 +1583,19 @@ async function next() {
1563
1583
  "warn",
1564
1584
  {
1565
1585
  allowExportNames: [
1586
+ "dynamic",
1587
+ "dynamicParams",
1588
+ "revalidate",
1589
+ "fetchCache",
1590
+ "runtime",
1591
+ "preferredRegion",
1592
+ "maxDuration",
1593
+ "config",
1594
+ "generateStaticParams",
1566
1595
  "metadata",
1567
1596
  "generateMetadata",
1568
- "generateStaticParams"
1597
+ "viewport",
1598
+ "generateViewport"
1569
1599
  ]
1570
1600
  }
1571
1601
  ]
@@ -1581,18 +1611,21 @@ var react = async (options) => {
1581
1611
  } = options;
1582
1612
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
1583
1613
  [
1584
- interopDefault(import("eslint-plugin-react")),
1614
+ interopDefault(import("@eslint-react/eslint-plugin")),
1585
1615
  // @ts-expect-error missing types
1586
1616
  interopDefault(import("eslint-plugin-react-hooks")),
1587
- // @ts-expect-error missing types
1588
1617
  interopDefault(import("eslint-plugin-react-refresh"))
1589
1618
  ]
1590
1619
  );
1620
+ const plugins = pluginReact.configs.all.plugins;
1591
1621
  const _react = [
1592
1622
  {
1593
1623
  name: "eslint/react/setup",
1594
1624
  plugins: {
1595
- "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"],
1596
1629
  "react-hooks": pluginReactHooks,
1597
1630
  "react-refresh": pluginReactRefresh,
1598
1631
  ...enableCompiler ? {
@@ -1620,14 +1653,69 @@ var react = async (options) => {
1620
1653
  }
1621
1654
  },
1622
1655
  rules: {
1623
- ...pluginReact.configs.recommended.rules,
1624
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",
1625
1672
  // React Refresh
1626
1673
  "react-refresh/only-export-components": "warn",
1627
1674
  // React Compiler
1628
1675
  ...enableCompiler ? {
1629
1676
  "react-compiler/react-compiler": "error"
1630
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",
1631
1719
  "jsx-quotes": ["error", "prefer-double"],
1632
1720
  "react/react-in-jsx-scope": "off",
1633
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
@@ -519,31 +519,50 @@ var jsonc = async (options) => {
519
519
  };
520
520
 
521
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
+ }
522
542
  var markdown = async (options) => {
523
- const { componentExts = [], overrides = {} } = options;
524
- const [pluginMdx, pluginMarkdown] = await Promise.all([
543
+ const {
544
+ mdx: enableMdx = false,
545
+ componentExts = [],
546
+ overrides = {}
547
+ } = options;
548
+ const pluginMarkdown = await Promise.all([
525
549
  interopDefault(import("eslint-plugin-mdx")),
526
550
  interopDefault(import("@eslint/markdown"))
527
551
  ]);
528
- return [
552
+ const _markdown = [
529
553
  {
530
554
  name: "eslint/markdown/setup",
531
555
  plugins: {
532
- mdx: pluginMdx,
533
556
  markdown: pluginMarkdown
534
557
  }
535
558
  },
536
559
  {
537
560
  name: "eslint/markdown/processor",
538
- files: [GLOB_MARKDOWN, GLOB_MDX],
561
+ files: [GLOB_MARKDOWN],
539
562
  languageOptions: {
540
563
  ecmaVersion: "latest",
541
564
  parser: parserPlain,
542
565
  sourceType: "module"
543
- },
544
- processor: "mdx/remark",
545
- settings: {
546
- "mdx/code-blocks": true
547
566
  }
548
567
  },
549
568
  {
@@ -596,6 +615,7 @@ var markdown = async (options) => {
596
615
  }
597
616
  }
598
617
  ];
618
+ return combine(_markdown, enableMdx ? await mdx() : []);
599
619
  };
600
620
 
601
621
  // src/configs/node.ts
@@ -990,7 +1010,7 @@ async function sortTsconfig() {
990
1010
  var test = async (options) => {
991
1011
  const { overrides = {} } = options;
992
1012
  const [pluginVitest, pluginNoOnlyTests] = await Promise.all([
993
- interopDefault(import("eslint-plugin-vitest")),
1013
+ interopDefault(import("@vitest/eslint-plugin")),
994
1014
  // @ts-expect-error missing types
995
1015
  interopDefault(import("eslint-plugin-no-only-tests"))
996
1016
  ]);
@@ -1480,9 +1500,19 @@ async function next() {
1480
1500
  "warn",
1481
1501
  {
1482
1502
  allowExportNames: [
1503
+ "dynamic",
1504
+ "dynamicParams",
1505
+ "revalidate",
1506
+ "fetchCache",
1507
+ "runtime",
1508
+ "preferredRegion",
1509
+ "maxDuration",
1510
+ "config",
1511
+ "generateStaticParams",
1483
1512
  "metadata",
1484
1513
  "generateMetadata",
1485
- "generateStaticParams"
1514
+ "viewport",
1515
+ "generateViewport"
1486
1516
  ]
1487
1517
  }
1488
1518
  ]
@@ -1498,18 +1528,21 @@ var react = async (options) => {
1498
1528
  } = options;
1499
1529
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
1500
1530
  [
1501
- interopDefault(import("eslint-plugin-react")),
1531
+ interopDefault(import("@eslint-react/eslint-plugin")),
1502
1532
  // @ts-expect-error missing types
1503
1533
  interopDefault(import("eslint-plugin-react-hooks")),
1504
- // @ts-expect-error missing types
1505
1534
  interopDefault(import("eslint-plugin-react-refresh"))
1506
1535
  ]
1507
1536
  );
1537
+ const plugins = pluginReact.configs.all.plugins;
1508
1538
  const _react = [
1509
1539
  {
1510
1540
  name: "eslint/react/setup",
1511
1541
  plugins: {
1512
- "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"],
1513
1546
  "react-hooks": pluginReactHooks,
1514
1547
  "react-refresh": pluginReactRefresh,
1515
1548
  ...enableCompiler ? {
@@ -1537,14 +1570,69 @@ var react = async (options) => {
1537
1570
  }
1538
1571
  },
1539
1572
  rules: {
1540
- ...pluginReact.configs.recommended.rules,
1541
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",
1542
1589
  // React Refresh
1543
1590
  "react-refresh/only-export-components": "warn",
1544
1591
  // React Compiler
1545
1592
  ...enableCompiler ? {
1546
1593
  "react-compiler/react-compiler": "error"
1547
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",
1548
1636
  "jsx-quotes": ["error", "prefer-double"],
1549
1637
  "react/react-in-jsx-scope": "off",
1550
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.4",
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.3",
31
- "@typescript-eslint/eslint-plugin": "^8.14.0",
32
- "@typescript-eslint/parser": "^8.14.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.4.2",
36
- "eslint-plugin-jsdoc": "^50.5.0",
37
- "eslint-plugin-jsonc": "^2.18.1",
38
- "eslint-plugin-mdx": "^3.1.5",
39
- "eslint-plugin-n": "^17.13.2",
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.4",
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.31.0",
54
- "eslint-plugin-yml": "^1.15.0",
55
- "globals": "^15.12.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.6",
69
+ "@eslint/config-inspector": "^0.6.0",
65
70
  "@types/eslint": "^9.6.1",
66
- "@types/node": "^22.9.0",
67
- "@types/react": "^18.3.12",
68
- "bumpp": "^9.8.1",
69
- "eslint": "9.14.0",
70
- "execa": "^9.5.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.5"
82
+ "typescript": "^5.7.2",
83
+ "vitest": "^2.1.8"
78
84
  },
79
85
  "scripts": {
80
86
  "build": "tsup --format esm,cjs --clean --dts",