@lincy/eslint-config 4.0.0 → 4.0.1

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
@@ -1030,9 +1030,13 @@ async function stylistic(options = {}) {
1030
1030
  "style/jsx-first-prop-new-line": "error",
1031
1031
  "style/jsx-indent": ["error", indent, { checkAttributes: true, indentLogicalExpressions: true }],
1032
1032
  "style/jsx-indent-props": ["error", indent],
1033
- "style/jsx-max-props-per-line": ["error", { maximum: 1, when: "multiline" }],
1033
+ "style/jsx-max-props-per-line": ["error", { maximum: 1 }],
1034
+ // 在 JSX 中的单行上强制执行最多 props 数量
1035
+ "style/jsx-newline": "off",
1036
+ // 在 jsx 元素和表达式之后换行
1034
1037
  "style/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
1035
- "style/jsx-quotes": "error",
1038
+ "style/jsx-quotes": ["error", "prefer-double"],
1039
+ // 强制在 JSX 属性中一致使用双引号或单引号
1036
1040
  "style/jsx-tag-spacing": ["error", {
1037
1041
  afterOpening: "never",
1038
1042
  beforeClosing: "never",
@@ -1548,16 +1552,6 @@ async function react(options = {}) {
1548
1552
  // 使用 JSX 时需要引入 React
1549
1553
  "react/require-default-props": "off",
1550
1554
  // 为每个非必需 prop 强制执行 defaultProps 定义
1551
- "style/jsx-first-prop-new-line": "off",
1552
- // 强制 JSX 中第一个属性的正确位置
1553
- "style/jsx-max-props-per-line": ["error", { maximum: 4 }],
1554
- // 在 JSX 中的单行上强制执行最多 props 数量
1555
- "style/jsx-newline": "off",
1556
- // 在 jsx 元素和表达式之后换行
1557
- "style/jsx-one-expression-per-line": "off",
1558
- // 每行一个 JSX 元素
1559
- "style/jsx-quotes": ["error", "prefer-double"],
1560
- // 强制在 JSX 属性中一致使用双引号或单引号
1561
1555
  ...overrides
1562
1556
  },
1563
1557
  settings: {
@@ -1604,8 +1598,6 @@ async function lincy(options = {}, ...userConfigs) {
1604
1598
  if (stylisticOptions) {
1605
1599
  if (!("jsx" in stylisticOptions))
1606
1600
  stylisticOptions.jsx = options.jsx ?? true;
1607
- if (enableReact)
1608
- stylisticOptions.jsx = false;
1609
1601
  }
1610
1602
  const configs = [];
1611
1603
  if (enableGitignore) {
package/dist/index.js CHANGED
@@ -950,9 +950,13 @@ async function stylistic(options = {}) {
950
950
  "style/jsx-first-prop-new-line": "error",
951
951
  "style/jsx-indent": ["error", indent, { checkAttributes: true, indentLogicalExpressions: true }],
952
952
  "style/jsx-indent-props": ["error", indent],
953
- "style/jsx-max-props-per-line": ["error", { maximum: 1, when: "multiline" }],
953
+ "style/jsx-max-props-per-line": ["error", { maximum: 1 }],
954
+ // 在 JSX 中的单行上强制执行最多 props 数量
955
+ "style/jsx-newline": "off",
956
+ // 在 jsx 元素和表达式之后换行
954
957
  "style/jsx-one-expression-per-line": ["error", { allow: "single-child" }],
955
- "style/jsx-quotes": "error",
958
+ "style/jsx-quotes": ["error", "prefer-double"],
959
+ // 强制在 JSX 属性中一致使用双引号或单引号
956
960
  "style/jsx-tag-spacing": ["error", {
957
961
  afterOpening: "never",
958
962
  beforeClosing: "never",
@@ -1468,16 +1472,6 @@ async function react(options = {}) {
1468
1472
  // 使用 JSX 时需要引入 React
1469
1473
  "react/require-default-props": "off",
1470
1474
  // 为每个非必需 prop 强制执行 defaultProps 定义
1471
- "style/jsx-first-prop-new-line": "off",
1472
- // 强制 JSX 中第一个属性的正确位置
1473
- "style/jsx-max-props-per-line": ["error", { maximum: 4 }],
1474
- // 在 JSX 中的单行上强制执行最多 props 数量
1475
- "style/jsx-newline": "off",
1476
- // 在 jsx 元素和表达式之后换行
1477
- "style/jsx-one-expression-per-line": "off",
1478
- // 每行一个 JSX 元素
1479
- "style/jsx-quotes": ["error", "prefer-double"],
1480
- // 强制在 JSX 属性中一致使用双引号或单引号
1481
1475
  ...overrides
1482
1476
  },
1483
1477
  settings: {
@@ -1524,8 +1518,6 @@ async function lincy(options = {}, ...userConfigs) {
1524
1518
  if (stylisticOptions) {
1525
1519
  if (!("jsx" in stylisticOptions))
1526
1520
  stylisticOptions.jsx = options.jsx ?? true;
1527
- if (enableReact)
1528
- stylisticOptions.jsx = false;
1529
1521
  }
1530
1522
  const configs = [];
1531
1523
  if (enableGitignore) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lincy/eslint-config",
3
3
  "type": "module",
4
- "version": "4.0.0",
4
+ "version": "4.0.1",
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/)",