@lincy/eslint-config 4.0.2 → 4.0.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/dist/index.cjs CHANGED
@@ -1530,98 +1530,98 @@ async function react(options = {}) {
1530
1530
  rules: {
1531
1531
  "react-hooks/exhaustive-deps": "warn",
1532
1532
  "react-hooks/rules-of-hooks": "error",
1533
- "react/boolean-prop-naming": 2,
1534
- "react/button-has-type": 2,
1535
- "react/default-props-match-prop-types": 2,
1536
- "react/destructuring-assignment": 2,
1537
- "react/display-name": 2,
1533
+ "react/boolean-prop-naming": "error",
1534
+ "react/button-has-type": "error",
1535
+ "react/default-props-match-prop-types": "error",
1536
+ "react/destructuring-assignment": "error",
1537
+ "react/display-name": "error",
1538
1538
  "react/forbid-component-props": "off",
1539
1539
  // 禁止组件上使用某些 props
1540
- "react/forbid-dom-props": 2,
1541
- "react/forbid-elements": 2,
1542
- "react/forbid-foreign-prop-types": 2,
1543
- "react/forbid-prop-types": 2,
1544
- "react/function-component-definition": 2,
1540
+ "react/forbid-dom-props": "error",
1541
+ "react/forbid-elements": "error",
1542
+ "react/forbid-foreign-prop-types": "error",
1543
+ "react/forbid-prop-types": "error",
1544
+ "react/function-component-definition": "error",
1545
1545
  "react/hook-use-state": "off",
1546
1546
  // useState 钩子值和 setter 变量的解构和对称命名
1547
- "react/iframe-missing-sandbox": 2,
1548
- "react/jsx-boolean-value": 2,
1547
+ "react/iframe-missing-sandbox": "error",
1548
+ "react/jsx-boolean-value": "error",
1549
1549
  "react/jsx-filename-extension": "off",
1550
1550
  // 禁止可能包含 JSX 文件扩展名
1551
- "react/jsx-fragments": 2,
1552
- "react/jsx-handler-names": 2,
1553
- "react/jsx-key": 2,
1551
+ "react/jsx-fragments": "error",
1552
+ "react/jsx-handler-names": "error",
1553
+ "react/jsx-key": "error",
1554
1554
  "react/jsx-max-depth": "off",
1555
1555
  // 强制 JSX 最大深度
1556
1556
  "react/jsx-no-bind": "off",
1557
1557
  // .bind()JSX 属性中禁止使用箭头函数
1558
- "react/jsx-no-comment-textnodes": 2,
1559
- "react/jsx-no-constructed-context-values": 2,
1560
- "react/jsx-no-duplicate-props": 2,
1561
- "react/jsx-no-leaked-render": 2,
1558
+ "react/jsx-no-comment-textnodes": "error",
1559
+ "react/jsx-no-constructed-context-values": "error",
1560
+ "react/jsx-no-duplicate-props": "error",
1561
+ "react/jsx-no-leaked-render": "error",
1562
1562
  "react/jsx-no-literals": "off",
1563
1563
  // 禁止在 JSX 中使用字符串文字
1564
- "react/jsx-no-script-url": 2,
1565
- "react/jsx-no-target-blank": 2,
1566
- "react/jsx-no-undef": 2,
1567
- "react/jsx-no-useless-fragment": 2,
1568
- "react/jsx-pascal-case": 2,
1564
+ "react/jsx-no-script-url": "error",
1565
+ "react/jsx-no-target-blank": "error",
1566
+ "react/jsx-no-undef": "error",
1567
+ "react/jsx-no-useless-fragment": "error",
1568
+ "react/jsx-pascal-case": "error",
1569
1569
  "react/jsx-props-no-spreading": "off",
1570
1570
  // 强制任何 JSX 属性都不会传播
1571
- "react/jsx-uses-react": 2,
1572
- "react/jsx-uses-vars": 2,
1573
- "react/no-access-state-in-setstate": 2,
1574
- "react/no-adjacent-inline-elements": 2,
1575
- "react/no-array-index-key": 2,
1576
- "react/no-arrow-function-lifecycle": 2,
1577
- "react/no-children-prop": 2,
1571
+ "react/jsx-uses-react": "error",
1572
+ "react/jsx-uses-vars": "error",
1573
+ "react/no-access-state-in-setstate": "error",
1574
+ "react/no-adjacent-inline-elements": "error",
1575
+ "react/no-array-index-key": "error",
1576
+ "react/no-arrow-function-lifecycle": "error",
1577
+ "react/no-children-prop": "error",
1578
1578
  "react/no-danger": "off",
1579
1579
  // 禁止使用 dangerouslySetInnerHTML
1580
- "react/no-danger-with-children": 2,
1581
- "react/no-deprecated": 2,
1582
- "react/no-did-mount-set-state": 2,
1583
- "react/no-did-update-set-state": 2,
1584
- "react/no-direct-mutation-state": 2,
1585
- "react/no-find-dom-node": 2,
1586
- "react/no-invalid-html-attribute": 2,
1587
- "react/no-is-mounted": 2,
1588
- "react/no-multi-comp": 2,
1589
- "react/no-namespace": 2,
1590
- "react/no-object-type-as-default-prop": 2,
1591
- "react/no-redundant-should-component-update": 2,
1592
- "react/no-render-return-value": 2,
1593
- "react/no-set-state": 2,
1594
- "react/no-string-refs": 2,
1595
- "react/no-this-in-sfc": 2,
1596
- "react/no-typos": 2,
1597
- "react/no-unescaped-entities": 2,
1598
- "react/no-unknown-property": 2,
1580
+ "react/no-danger-with-children": "error",
1581
+ "react/no-deprecated": "error",
1582
+ "react/no-did-mount-set-state": "error",
1583
+ "react/no-did-update-set-state": "error",
1584
+ "react/no-direct-mutation-state": "error",
1585
+ "react/no-find-dom-node": "error",
1586
+ "react/no-invalid-html-attribute": "error",
1587
+ "react/no-is-mounted": "error",
1588
+ "react/no-multi-comp": "error",
1589
+ "react/no-namespace": "error",
1590
+ "react/no-object-type-as-default-prop": "error",
1591
+ "react/no-redundant-should-component-update": "error",
1592
+ "react/no-render-return-value": "error",
1593
+ "react/no-set-state": "error",
1594
+ "react/no-string-refs": "error",
1595
+ "react/no-this-in-sfc": "error",
1596
+ "react/no-typos": "error",
1597
+ "react/no-unescaped-entities": "error",
1598
+ "react/no-unknown-property": "error",
1599
1599
  "react/no-unsafe": "off",
1600
1600
  // 禁止使用不安全的生命周期方法
1601
- "react/no-unstable-nested-components": 2,
1602
- "react/no-unused-class-component-methods": 2,
1603
- "react/no-unused-prop-types": 2,
1604
- "react/no-unused-state": 2,
1605
- "react/no-will-update-set-state": 2,
1606
- "react/prefer-es6-class": 2,
1607
- "react/prefer-exact-props": 2,
1608
- "react/prefer-read-only-props": 2,
1609
- "react/prefer-stateless-function": 2,
1610
- "react/prop-types": 2,
1601
+ "react/no-unstable-nested-components": "error",
1602
+ "react/no-unused-class-component-methods": "error",
1603
+ "react/no-unused-prop-types": "error",
1604
+ "react/no-unused-state": "error",
1605
+ "react/no-will-update-set-state": "error",
1606
+ "react/prefer-es6-class": "error",
1607
+ "react/prefer-exact-props": "error",
1608
+ "react/prefer-read-only-props": "error",
1609
+ "react/prefer-stateless-function": "error",
1610
+ "react/prop-types": "error",
1611
1611
  "react/react-in-jsx-scope": "off",
1612
1612
  // 使用 JSX 时需要引入 React
1613
1613
  "react/require-default-props": "off",
1614
1614
  // 为每个非必需 prop 强制执行 defaultProps 定义
1615
- "react/require-optimization": 2,
1616
- "react/require-render-return": 2,
1617
- "react/self-closing-comp": 2,
1618
- "react/sort-comp": 2,
1619
- "react/sort-default-props": 2,
1620
- "react/sort-prop-types": 2,
1621
- "react/state-in-constructor": 2,
1622
- "react/static-property-placement": 2,
1623
- "react/style-prop-object": 2,
1624
- "react/void-dom-elements-no-children": 2,
1615
+ "react/require-optimization": "error",
1616
+ "react/require-render-return": "error",
1617
+ "react/self-closing-comp": "error",
1618
+ "react/sort-comp": "error",
1619
+ "react/sort-default-props": "error",
1620
+ "react/sort-prop-types": "error",
1621
+ "react/state-in-constructor": "error",
1622
+ "react/static-property-placement": "error",
1623
+ "react/style-prop-object": "error",
1624
+ "react/void-dom-elements-no-children": "error",
1625
1625
  ...overrides
1626
1626
  },
1627
1627
  settings: {
package/dist/index.js CHANGED
@@ -1450,98 +1450,98 @@ async function react(options = {}) {
1450
1450
  rules: {
1451
1451
  "react-hooks/exhaustive-deps": "warn",
1452
1452
  "react-hooks/rules-of-hooks": "error",
1453
- "react/boolean-prop-naming": 2,
1454
- "react/button-has-type": 2,
1455
- "react/default-props-match-prop-types": 2,
1456
- "react/destructuring-assignment": 2,
1457
- "react/display-name": 2,
1453
+ "react/boolean-prop-naming": "error",
1454
+ "react/button-has-type": "error",
1455
+ "react/default-props-match-prop-types": "error",
1456
+ "react/destructuring-assignment": "error",
1457
+ "react/display-name": "error",
1458
1458
  "react/forbid-component-props": "off",
1459
1459
  // 禁止组件上使用某些 props
1460
- "react/forbid-dom-props": 2,
1461
- "react/forbid-elements": 2,
1462
- "react/forbid-foreign-prop-types": 2,
1463
- "react/forbid-prop-types": 2,
1464
- "react/function-component-definition": 2,
1460
+ "react/forbid-dom-props": "error",
1461
+ "react/forbid-elements": "error",
1462
+ "react/forbid-foreign-prop-types": "error",
1463
+ "react/forbid-prop-types": "error",
1464
+ "react/function-component-definition": "error",
1465
1465
  "react/hook-use-state": "off",
1466
1466
  // useState 钩子值和 setter 变量的解构和对称命名
1467
- "react/iframe-missing-sandbox": 2,
1468
- "react/jsx-boolean-value": 2,
1467
+ "react/iframe-missing-sandbox": "error",
1468
+ "react/jsx-boolean-value": "error",
1469
1469
  "react/jsx-filename-extension": "off",
1470
1470
  // 禁止可能包含 JSX 文件扩展名
1471
- "react/jsx-fragments": 2,
1472
- "react/jsx-handler-names": 2,
1473
- "react/jsx-key": 2,
1471
+ "react/jsx-fragments": "error",
1472
+ "react/jsx-handler-names": "error",
1473
+ "react/jsx-key": "error",
1474
1474
  "react/jsx-max-depth": "off",
1475
1475
  // 强制 JSX 最大深度
1476
1476
  "react/jsx-no-bind": "off",
1477
1477
  // .bind()JSX 属性中禁止使用箭头函数
1478
- "react/jsx-no-comment-textnodes": 2,
1479
- "react/jsx-no-constructed-context-values": 2,
1480
- "react/jsx-no-duplicate-props": 2,
1481
- "react/jsx-no-leaked-render": 2,
1478
+ "react/jsx-no-comment-textnodes": "error",
1479
+ "react/jsx-no-constructed-context-values": "error",
1480
+ "react/jsx-no-duplicate-props": "error",
1481
+ "react/jsx-no-leaked-render": "error",
1482
1482
  "react/jsx-no-literals": "off",
1483
1483
  // 禁止在 JSX 中使用字符串文字
1484
- "react/jsx-no-script-url": 2,
1485
- "react/jsx-no-target-blank": 2,
1486
- "react/jsx-no-undef": 2,
1487
- "react/jsx-no-useless-fragment": 2,
1488
- "react/jsx-pascal-case": 2,
1484
+ "react/jsx-no-script-url": "error",
1485
+ "react/jsx-no-target-blank": "error",
1486
+ "react/jsx-no-undef": "error",
1487
+ "react/jsx-no-useless-fragment": "error",
1488
+ "react/jsx-pascal-case": "error",
1489
1489
  "react/jsx-props-no-spreading": "off",
1490
1490
  // 强制任何 JSX 属性都不会传播
1491
- "react/jsx-uses-react": 2,
1492
- "react/jsx-uses-vars": 2,
1493
- "react/no-access-state-in-setstate": 2,
1494
- "react/no-adjacent-inline-elements": 2,
1495
- "react/no-array-index-key": 2,
1496
- "react/no-arrow-function-lifecycle": 2,
1497
- "react/no-children-prop": 2,
1491
+ "react/jsx-uses-react": "error",
1492
+ "react/jsx-uses-vars": "error",
1493
+ "react/no-access-state-in-setstate": "error",
1494
+ "react/no-adjacent-inline-elements": "error",
1495
+ "react/no-array-index-key": "error",
1496
+ "react/no-arrow-function-lifecycle": "error",
1497
+ "react/no-children-prop": "error",
1498
1498
  "react/no-danger": "off",
1499
1499
  // 禁止使用 dangerouslySetInnerHTML
1500
- "react/no-danger-with-children": 2,
1501
- "react/no-deprecated": 2,
1502
- "react/no-did-mount-set-state": 2,
1503
- "react/no-did-update-set-state": 2,
1504
- "react/no-direct-mutation-state": 2,
1505
- "react/no-find-dom-node": 2,
1506
- "react/no-invalid-html-attribute": 2,
1507
- "react/no-is-mounted": 2,
1508
- "react/no-multi-comp": 2,
1509
- "react/no-namespace": 2,
1510
- "react/no-object-type-as-default-prop": 2,
1511
- "react/no-redundant-should-component-update": 2,
1512
- "react/no-render-return-value": 2,
1513
- "react/no-set-state": 2,
1514
- "react/no-string-refs": 2,
1515
- "react/no-this-in-sfc": 2,
1516
- "react/no-typos": 2,
1517
- "react/no-unescaped-entities": 2,
1518
- "react/no-unknown-property": 2,
1500
+ "react/no-danger-with-children": "error",
1501
+ "react/no-deprecated": "error",
1502
+ "react/no-did-mount-set-state": "error",
1503
+ "react/no-did-update-set-state": "error",
1504
+ "react/no-direct-mutation-state": "error",
1505
+ "react/no-find-dom-node": "error",
1506
+ "react/no-invalid-html-attribute": "error",
1507
+ "react/no-is-mounted": "error",
1508
+ "react/no-multi-comp": "error",
1509
+ "react/no-namespace": "error",
1510
+ "react/no-object-type-as-default-prop": "error",
1511
+ "react/no-redundant-should-component-update": "error",
1512
+ "react/no-render-return-value": "error",
1513
+ "react/no-set-state": "error",
1514
+ "react/no-string-refs": "error",
1515
+ "react/no-this-in-sfc": "error",
1516
+ "react/no-typos": "error",
1517
+ "react/no-unescaped-entities": "error",
1518
+ "react/no-unknown-property": "error",
1519
1519
  "react/no-unsafe": "off",
1520
1520
  // 禁止使用不安全的生命周期方法
1521
- "react/no-unstable-nested-components": 2,
1522
- "react/no-unused-class-component-methods": 2,
1523
- "react/no-unused-prop-types": 2,
1524
- "react/no-unused-state": 2,
1525
- "react/no-will-update-set-state": 2,
1526
- "react/prefer-es6-class": 2,
1527
- "react/prefer-exact-props": 2,
1528
- "react/prefer-read-only-props": 2,
1529
- "react/prefer-stateless-function": 2,
1530
- "react/prop-types": 2,
1521
+ "react/no-unstable-nested-components": "error",
1522
+ "react/no-unused-class-component-methods": "error",
1523
+ "react/no-unused-prop-types": "error",
1524
+ "react/no-unused-state": "error",
1525
+ "react/no-will-update-set-state": "error",
1526
+ "react/prefer-es6-class": "error",
1527
+ "react/prefer-exact-props": "error",
1528
+ "react/prefer-read-only-props": "error",
1529
+ "react/prefer-stateless-function": "error",
1530
+ "react/prop-types": "error",
1531
1531
  "react/react-in-jsx-scope": "off",
1532
1532
  // 使用 JSX 时需要引入 React
1533
1533
  "react/require-default-props": "off",
1534
1534
  // 为每个非必需 prop 强制执行 defaultProps 定义
1535
- "react/require-optimization": 2,
1536
- "react/require-render-return": 2,
1537
- "react/self-closing-comp": 2,
1538
- "react/sort-comp": 2,
1539
- "react/sort-default-props": 2,
1540
- "react/sort-prop-types": 2,
1541
- "react/state-in-constructor": 2,
1542
- "react/static-property-placement": 2,
1543
- "react/style-prop-object": 2,
1544
- "react/void-dom-elements-no-children": 2,
1535
+ "react/require-optimization": "error",
1536
+ "react/require-render-return": "error",
1537
+ "react/self-closing-comp": "error",
1538
+ "react/sort-comp": "error",
1539
+ "react/sort-default-props": "error",
1540
+ "react/sort-prop-types": "error",
1541
+ "react/state-in-constructor": "error",
1542
+ "react/static-property-placement": "error",
1543
+ "react/style-prop-object": "error",
1544
+ "react/void-dom-elements-no-children": "error",
1545
1545
  ...overrides
1546
1546
  },
1547
1547
  settings: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "4.0.2",
4
+ "version": "4.0.3",
5
5
  "packageManager": "pnpm@8.7.6",
6
6
  "description": "LinCenYing's ESLint config",
7
7
  "author": "LinCenYing <lincenying@gmail.com> (https://github.com/lincenying/)",
@@ -41,8 +41,8 @@
41
41
  "dependencies": {
42
42
  "@antfu/eslint-define-config": "1.23.0-2",
43
43
  "@stylistic/eslint-plugin": "1.4.0",
44
- "@typescript-eslint/eslint-plugin": "^6.11.0",
45
- "@typescript-eslint/parser": "^6.11.0",
44
+ "@typescript-eslint/eslint-plugin": "^6.12.0",
45
+ "@typescript-eslint/parser": "^6.12.0",
46
46
  "eslint-config-flat-gitignore": "^0.1.1",
47
47
  "eslint-plugin-antfu": "^1.0.10",
48
48
  "eslint-plugin-eslint-comments": "^3.2.0",
@@ -67,14 +67,14 @@
67
67
  "yaml-eslint-parser": "^1.2.2"
68
68
  },
69
69
  "devDependencies": {
70
- "@antfu/ni": "^0.21.9",
70
+ "@antfu/ni": "^0.21.10",
71
71
  "@eslint-types/jsdoc": "46.9.0",
72
- "@eslint-types/typescript-eslint": "^6.11.0",
72
+ "@eslint-types/typescript-eslint": "^6.12.0",
73
73
  "@eslint-types/unicorn": "^49.0.0",
74
74
  "@lincy/eslint-config": "workspace:*",
75
75
  "@stylistic/eslint-plugin-migrate": "^1.4.0",
76
76
  "@types/eslint": "^8.44.7",
77
- "@types/node": "^20.9.2",
77
+ "@types/node": "^20.9.3",
78
78
  "bumpp": "^9.2.0",
79
79
  "eslint": "^8.54.0",
80
80
  "eslint-flat-config-viewer": "^0.1.3",
@@ -85,7 +85,7 @@
85
85
  "simple-open-url": "^3.0.1",
86
86
  "sucrase": "^3.34.0",
87
87
  "tsup": "^8.0.0",
88
- "typescript": "^5.2.2",
88
+ "typescript": "^5.3.2",
89
89
  "unbuild": "^2.0.0",
90
90
  "vitest": "^0.34.6"
91
91
  },