@lincy/eslint-config 4.0.1 → 4.0.2

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
@@ -1528,30 +1528,100 @@ async function react(options = {}) {
1528
1528
  },
1529
1529
  name: "eslint:react:rules",
1530
1530
  rules: {
1531
- ...pluginReact.configs.all.rules,
1532
- ...pluginReactHooks.configs.recommended.rules,
1531
+ "react-hooks/exhaustive-deps": "warn",
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
1538
  "react/forbid-component-props": "off",
1534
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,
1535
1545
  "react/hook-use-state": "off",
1536
1546
  // useState 钩子值和 setter 变量的解构和对称命名
1547
+ "react/iframe-missing-sandbox": 2,
1548
+ "react/jsx-boolean-value": 2,
1537
1549
  "react/jsx-filename-extension": "off",
1538
1550
  // 禁止可能包含 JSX 文件扩展名
1551
+ "react/jsx-fragments": 2,
1552
+ "react/jsx-handler-names": 2,
1553
+ "react/jsx-key": 2,
1539
1554
  "react/jsx-max-depth": "off",
1540
1555
  // 强制 JSX 最大深度
1541
1556
  "react/jsx-no-bind": "off",
1542
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,
1543
1562
  "react/jsx-no-literals": "off",
1544
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,
1545
1569
  "react/jsx-props-no-spreading": "off",
1546
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,
1547
1578
  "react/no-danger": "off",
1548
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,
1549
1599
  "react/no-unsafe": "off",
1550
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,
1551
1611
  "react/react-in-jsx-scope": "off",
1552
1612
  // 使用 JSX 时需要引入 React
1553
1613
  "react/require-default-props": "off",
1554
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,
1555
1625
  ...overrides
1556
1626
  },
1557
1627
  settings: {
package/dist/index.js CHANGED
@@ -1448,30 +1448,100 @@ async function react(options = {}) {
1448
1448
  },
1449
1449
  name: "eslint:react:rules",
1450
1450
  rules: {
1451
- ...pluginReact.configs.all.rules,
1452
- ...pluginReactHooks.configs.recommended.rules,
1451
+ "react-hooks/exhaustive-deps": "warn",
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
1458
  "react/forbid-component-props": "off",
1454
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,
1455
1465
  "react/hook-use-state": "off",
1456
1466
  // useState 钩子值和 setter 变量的解构和对称命名
1467
+ "react/iframe-missing-sandbox": 2,
1468
+ "react/jsx-boolean-value": 2,
1457
1469
  "react/jsx-filename-extension": "off",
1458
1470
  // 禁止可能包含 JSX 文件扩展名
1471
+ "react/jsx-fragments": 2,
1472
+ "react/jsx-handler-names": 2,
1473
+ "react/jsx-key": 2,
1459
1474
  "react/jsx-max-depth": "off",
1460
1475
  // 强制 JSX 最大深度
1461
1476
  "react/jsx-no-bind": "off",
1462
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,
1463
1482
  "react/jsx-no-literals": "off",
1464
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,
1465
1489
  "react/jsx-props-no-spreading": "off",
1466
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,
1467
1498
  "react/no-danger": "off",
1468
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,
1469
1519
  "react/no-unsafe": "off",
1470
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,
1471
1531
  "react/react-in-jsx-scope": "off",
1472
1532
  // 使用 JSX 时需要引入 React
1473
1533
  "react/require-default-props": "off",
1474
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,
1475
1545
  ...overrides
1476
1546
  },
1477
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.1",
4
+ "version": "4.0.2",
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/)",