@vinicunca/eslint-config 2.0.3 → 2.0.4

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
@@ -66,6 +66,7 @@ __export(src_exports, {
66
66
  pluginMarkdown: () => import_eslint_plugin_markdown.default,
67
67
  pluginNoOnlyTests: () => import_eslint_plugin_no_only_tests.default,
68
68
  pluginNode: () => import_eslint_plugin_n.default,
69
+ pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
69
70
  pluginReact: () => import_eslint_plugin_react.default,
70
71
  pluginReactHooks: () => import_eslint_plugin_react_hooks.default,
71
72
  pluginStylistic: () => import_eslint_plugin.default,
@@ -91,8 +92,8 @@ __export(src_exports, {
91
92
  module.exports = __toCommonJS(src_exports);
92
93
 
93
94
  // src/base.ts
94
- var import_node_process3 = __toESM(require("process"), 1);
95
95
  var import_local_pkg = require("local-pkg");
96
+ var import_node_process3 = __toESM(require("process"), 1);
96
97
 
97
98
  // src/flags.ts
98
99
  var ERROR = "error";
@@ -104,9 +105,9 @@ var ALWAYS = "always";
104
105
 
105
106
  // src/plugins.ts
106
107
  var import_eslint_plugin = __toESM(require("@stylistic/eslint-plugin"), 1);
107
- var import_eslint_plugin_vinicunca = __toESM(require("@vinicunca/eslint-plugin-vinicunca"), 1);
108
108
  var import_eslint_plugin2 = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
109
109
  var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
110
+ var import_eslint_plugin_vinicunca = __toESM(require("@vinicunca/eslint-plugin-vinicunca"), 1);
110
111
  var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
111
112
  var pluginImport = __toESM(require("eslint-plugin-i"), 1);
112
113
  var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
@@ -114,13 +115,14 @@ var pluginJsonc = __toESM(require("eslint-plugin-jsonc"), 1);
114
115
  var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
115
116
  var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
116
117
  var import_eslint_plugin_no_only_tests = __toESM(require("eslint-plugin-no-only-tests"), 1);
117
- var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
118
- var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
118
+ var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
119
119
  var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
120
120
  var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
121
+ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
122
+ var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
123
+ var import_eslint_plugin_vitest = __toESM(require("eslint-plugin-vitest"), 1);
121
124
  var import_eslint_plugin_vue = __toESM(require("eslint-plugin-vue"), 1);
122
125
  var pluginYaml = __toESM(require("eslint-plugin-yml"), 1);
123
- var import_eslint_plugin_vitest = __toESM(require("eslint-plugin-vitest"), 1);
124
126
  var import_jsonc_eslint_parser = __toESM(require("jsonc-eslint-parser"), 1);
125
127
  var import_vue_eslint_parser = __toESM(require("vue-eslint-parser"), 1);
126
128
  var import_yaml_eslint_parser = __toESM(require("yaml-eslint-parser"), 1);
@@ -143,10 +145,6 @@ function comments() {
143
145
  ];
144
146
  }
145
147
 
146
- // src/configs/ignores.ts
147
- var import_node_fs = __toESM(require("fs"), 1);
148
- var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
149
-
150
148
  // ../node_modules/.pnpm/@vinicunca+perkakas@0.0.10/node_modules/@vinicunca/perkakas/dist/index.js
151
149
  function purry(fn, args, lazy) {
152
150
  const diff = fn.length - args.length;
@@ -1121,6 +1119,10 @@ function toPairs(object) {
1121
1119
  toPairs2.strict = strict;
1122
1120
  })(toPairs || (toPairs = {}));
1123
1121
 
1122
+ // src/configs/ignores.ts
1123
+ var import_node_fs = __toESM(require("fs"), 1);
1124
+ var import_parse_gitignore = __toESM(require("parse-gitignore"), 1);
1125
+
1124
1126
  // src/globs.ts
1125
1127
  var GLOB_JS = "**/*.?([cm])js";
1126
1128
  var GLOB_JSX = "**/*.?([cm])jsx";
@@ -1175,19 +1177,17 @@ function ignores({
1175
1177
  replace = false
1176
1178
  } = {}) {
1177
1179
  const ignoreList = [];
1178
- if (enableGitignore) {
1179
- if (import_node_fs.default.existsSync(".gitignore")) {
1180
- const gitignoreContent = import_node_fs.default.readFileSync(".gitignore", "utf8");
1181
- const parsed = (0, import_parse_gitignore.default)(gitignoreContent);
1182
- const globs = parsed.globs();
1183
- for (const glob of globs) {
1184
- if (glob.type === "ignore") {
1185
- ignoreList.push(...glob.patterns);
1186
- } else if (glob.type === "unignore") {
1187
- ignoreList.push(...glob.patterns.map((pattern) => `!${pattern}`));
1188
- }
1189
- ;
1180
+ if (enableGitignore && import_node_fs.default.existsSync(".gitignore")) {
1181
+ const gitignoreContent = import_node_fs.default.readFileSync(".gitignore", "utf8");
1182
+ const parsed = (0, import_parse_gitignore.default)(gitignoreContent);
1183
+ const globs = parsed.globs();
1184
+ for (const glob of globs) {
1185
+ if (glob.type === "ignore") {
1186
+ ignoreList.push(...glob.patterns);
1187
+ } else if (glob.type === "unignore") {
1188
+ ignoreList.push(...glob.patterns.map((pattern) => `!${pattern}`));
1190
1189
  }
1190
+ ;
1191
1191
  }
1192
1192
  }
1193
1193
  if (replace) {
@@ -1214,7 +1214,7 @@ function imports() {
1214
1214
  rules: {
1215
1215
  "import/export": ERROR,
1216
1216
  "import/first": ERROR,
1217
- "import/newline-after-import": [ERROR, {
1217
+ "import/newline-after-import": [OFF, {
1218
1218
  considerComments: true,
1219
1219
  count: 1
1220
1220
  }],
@@ -1223,7 +1223,8 @@ function imports() {
1223
1223
  "import/no-named-default": ERROR,
1224
1224
  "import/no-self-import": ERROR,
1225
1225
  "import/no-webpack-loader-syntax": ERROR,
1226
- "import/order": ERROR,
1226
+ // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-imports
1227
+ "import/order": OFF,
1227
1228
  "vinicunca/import-dedupe": ERROR,
1228
1229
  "vinicunca/no-import-node-modules-by-path": ERROR
1229
1230
  }
@@ -1240,7 +1241,6 @@ function javascript(options = {}) {
1240
1241
  } = options;
1241
1242
  return [
1242
1243
  {
1243
- name: "vinicunca:javascript",
1244
1244
  languageOptions: {
1245
1245
  ecmaVersion: 2022,
1246
1246
  globals: {
@@ -1260,22 +1260,24 @@ function javascript(options = {}) {
1260
1260
  linterOptions: {
1261
1261
  reportUnusedDisableDirectives: true
1262
1262
  },
1263
+ name: "vinicunca:javascript",
1263
1264
  plugins: {
1264
- "vinicunca": import_eslint_plugin_vinicunca.default,
1265
- "unused-imports": import_eslint_plugin_unused_imports.default
1265
+ "perfectionist": import_eslint_plugin_perfectionist.default,
1266
+ "unused-imports": import_eslint_plugin_unused_imports.default,
1267
+ "vinicunca": import_eslint_plugin_vinicunca.default
1266
1268
  },
1267
1269
  rules: {
1268
1270
  "accessor-pairs": [ERROR, {
1269
- setWithoutGet: true,
1270
- enforceForClassMembers: true
1271
+ enforceForClassMembers: true,
1272
+ setWithoutGet: true
1271
1273
  }],
1272
1274
  "array-callback-return": [ERROR, { checkForEach: true }],
1273
1275
  "arrow-parens": [ERROR, ALWAYS],
1274
1276
  "block-scoped-var": ERROR,
1275
1277
  "camelcase": [ERROR, {
1276
1278
  allow: ["^UNSAFE_"],
1277
- properties: NEVER,
1278
- ignoreGlobals: true
1279
+ ignoreGlobals: true,
1280
+ properties: NEVER
1279
1281
  }],
1280
1282
  "constructor-super": ERROR,
1281
1283
  "default-case-last": ERROR,
@@ -1294,10 +1296,10 @@ function javascript(options = {}) {
1294
1296
  "no-case-declarations": ERROR,
1295
1297
  "no-class-assign": ERROR,
1296
1298
  "no-compare-neg-zero": ERROR,
1299
+ "no-cond-assign": [ERROR, ALWAYS],
1297
1300
  "no-console": [ERROR, {
1298
1301
  allow: [WARN, ERROR]
1299
1302
  }],
1300
- "no-cond-assign": [ERROR, ALWAYS],
1301
1303
  "no-const-assign": ERROR,
1302
1304
  "no-constant-binary-expression": ERROR,
1303
1305
  "no-constant-condition": [ERROR, {
@@ -1327,8 +1329,8 @@ function javascript(options = {}) {
1327
1329
  "no-global-assign": ERROR,
1328
1330
  "no-implied-eval": ERROR,
1329
1331
  "no-import-assign": ERROR,
1330
- "no-invalid-this": ERROR,
1331
1332
  "no-invalid-regexp": ERROR,
1333
+ "no-invalid-this": ERROR,
1332
1334
  "no-irregular-whitespace": ERROR,
1333
1335
  "no-iterator": ERROR,
1334
1336
  "no-labels": ERROR,
@@ -1355,35 +1357,35 @@ function javascript(options = {}) {
1355
1357
  "no-restricted-globals": [
1356
1358
  ERROR,
1357
1359
  {
1358
- name: "global",
1359
- message: "Use `globalThis` instead."
1360
+ message: "Use `globalThis` instead.",
1361
+ name: "global"
1360
1362
  },
1361
1363
  {
1362
- name: "self",
1363
- message: "Use `globalThis` instead."
1364
+ message: "Use `globalThis` instead.",
1365
+ name: "self"
1364
1366
  }
1365
1367
  ],
1366
1368
  "no-restricted-properties": [
1367
1369
  ERROR,
1368
1370
  {
1369
- property: "__proto__",
1370
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead."
1371
+ message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
1372
+ property: "__proto__"
1371
1373
  },
1372
1374
  {
1373
- property: "__defineGetter__",
1374
- message: "Use `Object.defineProperty` instead."
1375
+ message: "Use `Object.defineProperty` instead.",
1376
+ property: "__defineGetter__"
1375
1377
  },
1376
1378
  {
1377
- property: "__defineSetter__",
1378
- message: "Use `Object.defineProperty` instead."
1379
+ message: "Use `Object.defineProperty` instead.",
1380
+ property: "__defineSetter__"
1379
1381
  },
1380
1382
  {
1381
- property: "__lookupGetter__",
1382
- message: "Use `Object.getOwnPropertyDescriptor` instead."
1383
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
1384
+ property: "__lookupGetter__"
1383
1385
  },
1384
1386
  {
1385
- property: "__lookupSetter__",
1386
- message: "Use `Object.getOwnPropertyDescriptor` instead."
1387
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
1388
+ property: "__lookupSetter__"
1387
1389
  }
1388
1390
  ],
1389
1391
  "no-restricted-syntax": [
@@ -1419,8 +1421,8 @@ function javascript(options = {}) {
1419
1421
  "no-unsafe-negation": ERROR,
1420
1422
  "no-unused-expressions": [ERROR, {
1421
1423
  allowShortCircuit: true,
1422
- allowTernary: true,
1423
- allowTaggedTemplates: true
1424
+ allowTaggedTemplates: true,
1425
+ allowTernary: true
1424
1426
  }],
1425
1427
  "no-unused-vars": [ERROR, {
1426
1428
  args: "none",
@@ -1429,8 +1431,8 @@ function javascript(options = {}) {
1429
1431
  vars: "all"
1430
1432
  }],
1431
1433
  "no-use-before-define": [ERROR, {
1432
- functions: false,
1433
1434
  classes: false,
1435
+ functions: false,
1434
1436
  variables: true
1435
1437
  }],
1436
1438
  "no-useless-backreference": ERROR,
@@ -1444,8 +1446,8 @@ function javascript(options = {}) {
1444
1446
  "no-void": ERROR,
1445
1447
  "no-with": ERROR,
1446
1448
  "object-shorthand": [ERROR, ALWAYS, {
1447
- ignoreConstructors: false,
1448
- avoidQuotes: true
1449
+ avoidQuotes: true,
1450
+ ignoreConstructors: false
1449
1451
  }],
1450
1452
  "one-var": [ERROR, {
1451
1453
  initialized: NEVER
@@ -1463,44 +1465,36 @@ function javascript(options = {}) {
1463
1465
  "prefer-rest-params": ERROR,
1464
1466
  "prefer-spread": ERROR,
1465
1467
  "prefer-template": ERROR,
1466
- "sort-imports": [ERROR, {
1467
- ignoreCase: false,
1468
- ignoreDeclarationSort: true,
1469
- ignoreMemberSort: false,
1470
- memberSyntaxSortOrder: [
1471
- "none",
1472
- "all",
1473
- "multiple",
1474
- "single"
1475
- ],
1476
- allowSeparatedGroups: false
1477
- }],
1468
+ // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-imports
1469
+ "sort-imports": [OFF],
1478
1470
  "symbol-description": ERROR,
1479
1471
  "unicode-bom": [ERROR, NEVER],
1472
+ "unused-imports/no-unused-imports": isInEditor ? OFF : ERROR,
1473
+ "unused-imports/no-unused-vars": [WARN, {
1474
+ args: "after-used",
1475
+ argsIgnorePattern: "^_",
1476
+ ignoreRestSiblings: true,
1477
+ vars: "all",
1478
+ varsIgnorePattern: "^_"
1479
+ }],
1480
1480
  "use-isnan": [ERROR, {
1481
- enforceForSwitchCase: true,
1482
- enforceForIndexOf: true
1481
+ enforceForIndexOf: true,
1482
+ enforceForSwitchCase: true
1483
1483
  }],
1484
1484
  "valid-typeof": [ERROR, {
1485
1485
  requireStringLiterals: true
1486
1486
  }],
1487
1487
  "vars-on-top": ERROR,
1488
1488
  "yoda": [ERROR, NEVER],
1489
- "unused-imports/no-unused-imports": isInEditor ? OFF : ERROR,
1490
- "unused-imports/no-unused-vars": [WARN, {
1491
- vars: "all",
1492
- varsIgnorePattern: "^_",
1493
- args: "after-used",
1494
- argsIgnorePattern: "^_",
1495
- ignoreRestSiblings: true
1496
- }],
1497
1489
  ...import_eslint_plugin_vinicunca.default.configs.recommended.rules,
1490
+ ...import_eslint_plugin_perfectionist.default.configs["recommended-natural"].rules,
1491
+ "perfectionist/sort-vue-attributes": [OFF],
1498
1492
  ...overrides
1499
1493
  }
1500
1494
  },
1501
1495
  {
1502
- name: "vinicunca:javascript:overrides",
1503
1496
  files: [`**/scripts/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
1497
+ name: "vinicunca:javascript:overrides",
1504
1498
  rules: {
1505
1499
  "no-console": OFF
1506
1500
  }
@@ -1554,11 +1548,11 @@ function jsonc(options = {}) {
1554
1548
  }
1555
1549
  },
1556
1550
  {
1557
- name: "vinicunca:jsonc:rules",
1558
1551
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1559
1552
  languageOptions: {
1560
1553
  parser: import_jsonc_eslint_parser.default
1561
1554
  },
1555
+ name: "vinicunca:jsonc:rules",
1562
1556
  rules: {
1563
1557
  "jsonc/array-bracket-spacing": [ERROR, NEVER],
1564
1558
  "jsonc/comma-dangle": [ERROR, NEVER],
@@ -1616,12 +1610,11 @@ function markdown(options = {}) {
1616
1610
  }
1617
1611
  },
1618
1612
  {
1619
- name: "vinicunca:markdown:processor",
1620
1613
  files: [GLOB_MARKDOWN],
1614
+ name: "vinicunca:markdown:processor",
1621
1615
  processor: "markdown/markdown"
1622
1616
  },
1623
1617
  {
1624
- name: "vinicunca:markdown:rules",
1625
1618
  files: [
1626
1619
  GLOB_MARKDOWN_CODE,
1627
1620
  ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
@@ -1633,6 +1626,7 @@ function markdown(options = {}) {
1633
1626
  }
1634
1627
  }
1635
1628
  },
1629
+ name: "vinicunca:markdown:rules",
1636
1630
  rules: {
1637
1631
  "no-alert": OFF,
1638
1632
  "no-console": OFF,
@@ -1703,6 +1697,7 @@ function node() {
1703
1697
  }
1704
1698
 
1705
1699
  // src/configs/react.ts
1700
+ var STR_PARENS_NEW_LINE = "parens-new-line";
1706
1701
  function react(options = {}) {
1707
1702
  const {
1708
1703
  overrides = {}
@@ -1717,84 +1712,78 @@ function react(options = {}) {
1717
1712
  },
1718
1713
  {
1719
1714
  name: "vinicunca:react:rules",
1720
- settings: {
1721
- react: {
1722
- version: "detect"
1723
- }
1724
- },
1725
1715
  rules: {
1726
1716
  ...import_eslint_plugin_react.default.configs.recommended.rules,
1727
1717
  ...import_eslint_plugin_react_hooks.default.configs.recommended.rules,
1728
- "style/jsx-quotes": [ERROR, "prefer-double"],
1718
+ "react/boolean-prop-naming": [OFF, {
1719
+ message: "",
1720
+ propTypeNames: ["bool", "mutuallyExclusiveTrueProps"],
1721
+ rule: "^(is|has)[A-Z]([A-Za-z0-9]?)+"
1722
+ }],
1723
+ "react/destructuring-assignment": [ERROR, "always"],
1729
1724
  "react/jsx-boolean-value": [ERROR, NEVER, { always: [] }],
1725
+ "react/jsx-child-element-spacing": OFF,
1730
1726
  "react/jsx-closing-bracket-location": [ERROR, "line-aligned"],
1731
1727
  "react/jsx-closing-tag-location": ERROR,
1728
+ "react/jsx-curly-brace-presence": [ERROR, { children: NEVER, props: NEVER }],
1729
+ "react/jsx-curly-newline": [ERROR, {
1730
+ multiline: "consistent",
1731
+ singleline: "consistent"
1732
+ }],
1732
1733
  "react/jsx-curly-spacing": [ERROR, {
1733
- when: "always",
1734
+ children: true,
1734
1735
  spacing: {
1735
1736
  objectLiterals: NEVER
1736
1737
  },
1737
- children: true
1738
+ when: "always"
1738
1739
  }],
1740
+ "react/jsx-equals-spacing": [ERROR, NEVER],
1741
+ "react/jsx-first-prop-new-line": [ERROR, "multiline-multiprop"],
1742
+ "react/jsx-indent": [ERROR, 2],
1739
1743
  "react/jsx-indent-props": [ERROR, 2],
1740
1744
  "react/jsx-key": OFF,
1745
+ "react/jsx-max-depth": OFF,
1741
1746
  "react/jsx-max-props-per-line": [ERROR, { maximum: 1, when: "multiline" }],
1747
+ "react/jsx-newline": ERROR,
1742
1748
  "react/jsx-no-duplicate-props": [ERROR, { ignoreCase: true }],
1743
1749
  "react/jsx-no-literals": [OFF, { noStrings: true }],
1750
+ "react/jsx-one-expression-per-line": [ERROR, { allow: "single-child" }],
1744
1751
  "react/jsx-pascal-case": [ERROR, {
1745
1752
  allowAllCaps: true,
1746
1753
  ignore: []
1747
1754
  }],
1748
- "react/jsx-sort-props": [OFF, {
1749
- ignoreCase: true,
1750
- callbacksLast: false,
1751
- shorthandFirst: false,
1752
- shorthandLast: false,
1753
- noSortAlphabetically: false,
1754
- reservedFirst: true
1755
- }],
1755
+ "react/jsx-props-no-multi-spaces": ERROR,
1756
1756
  "react/jsx-sort-default-props": [OFF, {
1757
1757
  ignoreCase: true
1758
1758
  }],
1759
- "react/no-danger": WARN,
1760
- "react/self-closing-comp": ERROR,
1761
- "react/jsx-wrap-multilines": [ERROR, {
1762
- declaration: "parens-new-line",
1763
- assignment: "parens-new-line",
1764
- return: "parens-new-line",
1765
- arrow: "parens-new-line",
1766
- condition: "parens-new-line",
1767
- logical: "parens-new-line",
1768
- prop: "parens-new-line"
1769
- }],
1770
- "react/jsx-first-prop-new-line": [ERROR, "multiline-multiprop"],
1771
- "react/jsx-equals-spacing": [ERROR, NEVER],
1772
- "react/jsx-indent": [ERROR, 2],
1773
- "react/style-prop-object": ERROR,
1759
+ // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-jsx-props
1760
+ "react/jsx-sort-props": [OFF],
1774
1761
  "react/jsx-tag-spacing": [ERROR, {
1775
- closingSlash: NEVER,
1776
- beforeSelfClosing: "always",
1777
1762
  afterOpening: NEVER,
1778
- beforeClosing: NEVER
1779
- }],
1780
- "react/boolean-prop-naming": [OFF, {
1781
- propTypeNames: ["bool", "mutuallyExclusiveTrueProps"],
1782
- rule: "^(is|has)[A-Z]([A-Za-z0-9]?)+",
1783
- message: ""
1763
+ beforeClosing: NEVER,
1764
+ beforeSelfClosing: "always",
1765
+ closingSlash: NEVER
1784
1766
  }],
1785
- "react/jsx-curly-brace-presence": [ERROR, { props: NEVER, children: NEVER }],
1786
- "react/jsx-one-expression-per-line": [ERROR, { allow: "single-child" }],
1787
- "react/destructuring-assignment": [ERROR, "always"],
1788
- "react/jsx-child-element-spacing": OFF,
1789
- "react/jsx-max-depth": OFF,
1790
- "react/jsx-props-no-multi-spaces": ERROR,
1791
- "react/jsx-curly-newline": [ERROR, {
1792
- multiline: "consistent",
1793
- singleline: "consistent"
1767
+ "react/jsx-wrap-multilines": [ERROR, {
1768
+ arrow: STR_PARENS_NEW_LINE,
1769
+ assignment: STR_PARENS_NEW_LINE,
1770
+ condition: STR_PARENS_NEW_LINE,
1771
+ declaration: STR_PARENS_NEW_LINE,
1772
+ logical: STR_PARENS_NEW_LINE,
1773
+ prop: STR_PARENS_NEW_LINE,
1774
+ return: STR_PARENS_NEW_LINE
1794
1775
  }],
1795
- "react/jsx-newline": ERROR,
1776
+ "react/no-danger": WARN,
1796
1777
  "react/react-in-jsx-scope": OFF,
1778
+ "react/self-closing-comp": ERROR,
1779
+ "react/style-prop-object": ERROR,
1780
+ "style/jsx-quotes": [ERROR, "prefer-double"],
1797
1781
  ...overrides
1782
+ },
1783
+ settings: {
1784
+ react: {
1785
+ version: "detect"
1786
+ }
1798
1787
  }
1799
1788
  }
1800
1789
  ];
@@ -1804,8 +1793,8 @@ function react(options = {}) {
1804
1793
  function sortPackageJson() {
1805
1794
  return [
1806
1795
  {
1807
- name: "vinicunca:sort-package-json",
1808
1796
  files: ["**/package.json"],
1797
+ name: "vinicunca:sort-package-json",
1809
1798
  rules: {
1810
1799
  "jsonc/sort-array-values": [
1811
1800
  ERROR,
@@ -1893,8 +1882,8 @@ function sortPackageJson() {
1893
1882
  function sortTsconfig() {
1894
1883
  return [
1895
1884
  {
1896
- name: "vinicunca:sort-tsconfig",
1897
1885
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
1886
+ name: "vinicunca:sort-tsconfig",
1898
1887
  rules: {
1899
1888
  "jsonc/sort-keys": [
1900
1889
  ERROR,
@@ -2022,18 +2011,19 @@ function stylistic() {
2022
2011
  {
2023
2012
  name: "vinicunca:stylistic",
2024
2013
  plugins: {
2025
- vinicunca: import_eslint_plugin_vinicunca.default,
2026
- style: import_eslint_plugin.default
2014
+ style: import_eslint_plugin.default,
2015
+ vinicunca: import_eslint_plugin_vinicunca.default
2027
2016
  },
2028
2017
  rules: {
2029
2018
  "curly": [ERROR, "all"],
2030
2019
  "style/array-bracket-newline": [ERROR, CONSISTENT],
2031
2020
  "style/array-bracket-spacing": [ERROR, NEVER],
2032
2021
  "style/array-element-newline": [ERROR, CONSISTENT],
2033
- "style/arrow-spacing": [ERROR, { before: true, after: true }],
2022
+ "style/arrow-spacing": [ERROR, { after: true, before: true }],
2034
2023
  "style/block-spacing": [ERROR, ALWAYS],
2035
2024
  "style/brace-style": [ERROR],
2036
- "style/comma-spacing": [ERROR, { before: false, after: true }],
2025
+ "style/comma-dangle": [ERROR, "always-multiline"],
2026
+ "style/comma-spacing": [ERROR, { after: true, before: false }],
2037
2027
  "style/comma-style": [ERROR, "last"],
2038
2028
  "style/computed-property-spacing": [ERROR, NEVER, { enforceForClassMembers: true }],
2039
2029
  "style/dot-location": [ERROR, "property"],
@@ -2077,8 +2067,8 @@ function stylistic() {
2077
2067
  offsetTernaryExpressions: true,
2078
2068
  outerIIFEBody: 1
2079
2069
  }],
2080
- "style/key-spacing": [ERROR, { beforeColon: false, afterColon: true }],
2081
- "style/keyword-spacing": [ERROR, { before: true, after: true }],
2070
+ "style/key-spacing": [ERROR, { afterColon: true, beforeColon: false }],
2071
+ "style/keyword-spacing": [ERROR, { after: true, before: true }],
2082
2072
  "style/lines-between-class-members": [ERROR, ALWAYS, { exceptAfterSingleLine: true }],
2083
2073
  "style/max-statements-per-line": [ERROR, { max: 1 }],
2084
2074
  "style/member-delimiter-style": [ERROR],
@@ -2087,12 +2077,12 @@ function stylistic() {
2087
2077
  "style/no-extra-parens": [ERROR, "functions"],
2088
2078
  "style/no-floating-decimal": ERROR,
2089
2079
  "style/no-mixed-operators": [ERROR, {
2080
+ allowSamePrecedence: true,
2090
2081
  groups: [
2091
2082
  ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
2092
2083
  ["&&", "||"],
2093
2084
  ["in", "instanceof"]
2094
- ],
2095
- allowSamePrecedence: true
2085
+ ]
2096
2086
  }],
2097
2087
  "style/no-mixed-spaces-and-tabs": ERROR,
2098
2088
  "style/no-multi-spaces": ERROR,
@@ -2100,34 +2090,34 @@ function stylistic() {
2100
2090
  "style/no-tabs": ERROR,
2101
2091
  "style/no-trailing-spaces": ERROR,
2102
2092
  "style/no-whitespace-before-property": ERROR,
2103
- "style/object-curly-newline": [ERROR, { multiline: true, consistent: true }],
2093
+ "style/object-curly-newline": [ERROR, { consistent: true, multiline: true }],
2104
2094
  "style/object-curly-spacing": [ERROR, ALWAYS],
2105
2095
  "style/object-property-newline": [ERROR, { allowMultiplePropertiesPerLine: true }],
2106
2096
  "style/operator-linebreak": [ERROR, "before"],
2107
- "style/padded-blocks": [ERROR, { blocks: NEVER, switches: NEVER, classes: NEVER }],
2097
+ "style/padded-blocks": [ERROR, { blocks: NEVER, classes: NEVER, switches: NEVER }],
2108
2098
  "style/quote-props": [ERROR, "consistent-as-needed"],
2109
2099
  "style/quotes": [ERROR, "single"],
2110
2100
  "style/rest-spread-spacing": [ERROR, NEVER],
2111
2101
  "style/semi": [ERROR, ALWAYS],
2112
- "style/semi-spacing": [ERROR, { before: false, after: true }],
2102
+ "style/semi-spacing": [ERROR, { after: true, before: false }],
2113
2103
  "style/space-before-blocks": [ERROR, ALWAYS],
2114
2104
  "style/space-before-function-paren": [ERROR, {
2115
2105
  anonymous: NEVER,
2116
- named: NEVER,
2117
- asyncArrow: ALWAYS
2106
+ asyncArrow: ALWAYS,
2107
+ named: NEVER
2118
2108
  }],
2119
2109
  "style/space-in-parens": [ERROR, NEVER],
2120
2110
  "style/space-infix-ops": ERROR,
2121
- "style/space-unary-ops": [ERROR, { words: true, nonwords: false }],
2111
+ "style/space-unary-ops": [ERROR, { nonwords: false, words: true }],
2122
2112
  "style/spaced-comment": [ERROR, "always", {
2123
- line: {
2124
- markers: ["/"],
2125
- exceptions: ["/", "#"]
2126
- },
2127
2113
  block: {
2128
- markers: ["!"],
2114
+ balanced: true,
2129
2115
  exceptions: ["*"],
2130
- balanced: true
2116
+ markers: ["!"]
2117
+ },
2118
+ line: {
2119
+ exceptions: ["/", "#"],
2120
+ markers: ["/"]
2131
2121
  }
2132
2122
  }],
2133
2123
  "style/template-curly-spacing": ERROR,
@@ -2137,7 +2127,6 @@ function stylistic() {
2137
2127
  functionPrototypeMethods: true
2138
2128
  }],
2139
2129
  "style/yield-star-spacing": [ERROR, "both"],
2140
- "style/comma-dangle": [ERROR, "always-multiline"],
2141
2130
  "vinicunca/consistent-list-newline": ERROR,
2142
2131
  "vinicunca/if-newline": ERROR,
2143
2132
  "vinicunca/top-level-function": ERROR
@@ -2173,8 +2162,8 @@ function test(options = {}) {
2173
2162
  }
2174
2163
  },
2175
2164
  {
2176
- name: "vinicunca:test:rules",
2177
2165
  files: GLOB_TESTS,
2166
+ name: "vinicunca:test:rules",
2178
2167
  rules: {
2179
2168
  "test/consistent-test-it": [ERROR, { fn: "it", withinDescribe: "it" }],
2180
2169
  "test/no-identical-title": ERROR,
@@ -2223,11 +2212,11 @@ function typescript(options) {
2223
2212
  "ts/no-floating-promises": ERROR,
2224
2213
  "ts/no-for-in-array": ERROR,
2225
2214
  "ts/no-implied-eval": ERROR,
2226
- "ts/no-misused-promises": ERROR,
2215
+ // Temporary turning it off due to performance
2216
+ "ts/no-misused-promises": OFF,
2227
2217
  "ts/no-throw-literal": ERROR,
2228
2218
  "ts/restrict-plus-operands": ERROR,
2229
- "ts/restrict-template-expressions": ERROR,
2230
- "ts/unbound-method": ERROR
2219
+ "ts/restrict-template-expressions": ERROR
2231
2220
  };
2232
2221
  let tsConfigOptions = {};
2233
2222
  let additionalTypeAwareRules = {};
@@ -2243,13 +2232,12 @@ function typescript(options) {
2243
2232
  // Install the plugins without globs, so they can be configured separately.
2244
2233
  name: "vinicunca:typescript:setup",
2245
2234
  plugins: {
2246
- vinicunca: import_eslint_plugin_vinicunca.default,
2247
2235
  import: pluginImport,
2248
- ts: import_eslint_plugin2.default
2236
+ ts: import_eslint_plugin2.default,
2237
+ vinicunca: import_eslint_plugin_vinicunca.default
2249
2238
  }
2250
2239
  },
2251
2240
  {
2252
- name: "vinicunca:typescript:rules",
2253
2241
  files: [
2254
2242
  GLOB_SRC,
2255
2243
  ...componentExts.map((ext) => `**/*.${ext}`)
@@ -2257,11 +2245,13 @@ function typescript(options) {
2257
2245
  languageOptions: {
2258
2246
  parser: parserTs,
2259
2247
  parserOptions: {
2248
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
2260
2249
  sourceType: "module",
2261
2250
  ...tsConfigOptions,
2262
2251
  ...parserOptions
2263
2252
  }
2264
2253
  },
2254
+ name: "vinicunca:typescript:rules",
2265
2255
  rules: {
2266
2256
  ...renameRules(
2267
2257
  import_eslint_plugin2.default.configs["eslint-recommended"].overrides[0].rules,
@@ -2274,37 +2264,37 @@ function typescript(options) {
2274
2264
  "ts/"
2275
2265
  ),
2276
2266
  "no-dupe-class-members": OFF,
2277
- "ts/no-dupe-class-members": ERROR,
2278
2267
  "no-invalid-this": OFF,
2279
- "ts/no-invalid-this": ERROR,
2280
2268
  "no-loss-of-precision": OFF,
2281
- "ts/no-loss-of-precision": ERROR,
2282
2269
  "no-redeclare": OFF,
2283
- "ts/no-redeclare": ERROR,
2270
+ "no-unused-vars": OFF,
2284
2271
  "no-use-before-define": OFF,
2285
- "ts/no-use-before-define": [ERROR, { functions: false, classes: false, variables: true }],
2286
2272
  "no-useless-constructor": OFF,
2287
2273
  "ts/ban-ts-comment": [ERROR, { "ts-ignore": "allow-with-description" }],
2288
2274
  "ts/ban-types": [ERROR, { types: { Function: false } }],
2289
2275
  "ts/consistent-type-definitions": [ERROR, "interface"],
2290
- "ts/consistent-type-imports": [ERROR, { prefer: "type-imports", disallowTypeAnnotations: false }],
2276
+ "ts/consistent-type-imports": [ERROR, { disallowTypeAnnotations: false, prefer: "type-imports" }],
2291
2277
  "ts/explicit-function-return-type": OFF,
2292
2278
  "ts/explicit-member-accessibility": OFF,
2293
2279
  "ts/explicit-module-boundary-types": OFF,
2294
2280
  "ts/naming-convention": OFF,
2281
+ "ts/no-dupe-class-members": ERROR,
2295
2282
  "ts/no-empty-function": OFF,
2296
2283
  "ts/no-empty-interface": OFF,
2297
2284
  "ts/no-explicit-any": OFF,
2298
2285
  "ts/no-import-type-side-effects": ERROR,
2286
+ "ts/no-invalid-this": ERROR,
2299
2287
  "ts/no-invalid-void-type": OFF,
2288
+ "ts/no-loss-of-precision": ERROR,
2300
2289
  "ts/no-non-null-assertion": OFF,
2290
+ "ts/no-redeclare": ERROR,
2301
2291
  "ts/no-require-imports": ERROR,
2302
- "no-unused-vars": OFF,
2303
2292
  "ts/no-unused-vars": [ERROR, {
2304
2293
  argsIgnorePattern: "^_",
2305
2294
  destructuredArrayIgnorePattern: "^_",
2306
2295
  ignoreRestSiblings: true
2307
2296
  }],
2297
+ "ts/no-use-before-define": [ERROR, { classes: false, functions: false, variables: true }],
2308
2298
  "ts/parameter-properties": OFF,
2309
2299
  "ts/prefer-ts-expect-error": ERROR,
2310
2300
  "ts/triple-slash-reference": OFF,
@@ -2317,8 +2307,8 @@ function typescript(options) {
2317
2307
  }
2318
2308
  },
2319
2309
  {
2320
- name: "vinicunca:typescript:dts-overrides",
2321
2310
  files: ["**/*.d.ts"],
2311
+ name: "vinicunca:typescript:dts-overrides",
2322
2312
  rules: {
2323
2313
  "eslint-comments/no-unlimited-disable": OFF,
2324
2314
  "import/no-duplicates": OFF,
@@ -2326,15 +2316,15 @@ function typescript(options) {
2326
2316
  }
2327
2317
  },
2328
2318
  {
2329
- name: "vinicunca:typescript:tests-overrides",
2330
2319
  files: ["**/*.{test,spec}.ts?(x)"],
2320
+ name: "vinicunca:typescript:tests-overrides",
2331
2321
  rules: {
2332
2322
  "no-unused-expressions": OFF
2333
2323
  }
2334
2324
  },
2335
2325
  {
2336
- name: "vinicunca:typescript:javascript-overrides",
2337
2326
  files: ["**/*.js", "**/*.cjs"],
2327
+ name: "vinicunca:typescript:javascript-overrides",
2338
2328
  rules: {
2339
2329
  "ts/no-require-imports": OFF,
2340
2330
  "ts/no-var-requires": OFF
@@ -2361,11 +2351,11 @@ function unicorn(options = {}) {
2361
2351
  "unicorn/no-new-array": ERROR,
2362
2352
  "unicorn/no-new-buffer": ERROR,
2363
2353
  "unicorn/number-literal-case": ERROR,
2354
+ "unicorn/prefer-dom-node-text-content": ERROR,
2364
2355
  "unicorn/prefer-includes": ERROR,
2365
2356
  "unicorn/prefer-node-protocol": ERROR,
2366
2357
  "unicorn/prefer-number-properties": ERROR,
2367
2358
  "unicorn/prefer-string-starts-ends-with": ERROR,
2368
- "unicorn/prefer-dom-node-text-content": ERROR,
2369
2359
  "unicorn/prefer-type-error": ERROR,
2370
2360
  "unicorn/throw-new-error": ERROR,
2371
2361
  ...overrides
@@ -2378,8 +2368,8 @@ function unicorn(options = {}) {
2378
2368
  var import_node_process2 = __toESM(require("process"), 1);
2379
2369
  function vue(options = {}) {
2380
2370
  const {
2381
- typescript: typescript2 = {},
2382
- overrides = {}
2371
+ overrides = {},
2372
+ typescript: typescript2 = {}
2383
2373
  } = options;
2384
2374
  let tsConfigOptions = {};
2385
2375
  const tsconfigPath = typescript2.tsconfigPath ?? [];
@@ -2397,7 +2387,6 @@ function vue(options = {}) {
2397
2387
  }
2398
2388
  },
2399
2389
  {
2400
- name: "vinicunca:vue:rules",
2401
2390
  files: [GLOB_VUE],
2402
2391
  languageOptions: {
2403
2392
  parser: import_vue_eslint_parser.default,
@@ -2411,6 +2400,7 @@ function vue(options = {}) {
2411
2400
  ...tsConfigOptions
2412
2401
  }
2413
2402
  },
2403
+ name: "vinicunca:vue:rules",
2414
2404
  processor: import_eslint_plugin_vue.default.processors[".vue"],
2415
2405
  rules: {
2416
2406
  ...import_eslint_plugin_vue.default.configs.base.rules,
@@ -2480,7 +2470,7 @@ function vue(options = {}) {
2480
2470
  "vue/no-useless-v-bind": ERROR,
2481
2471
  "vue/no-v-html": OFF,
2482
2472
  "vue/no-v-text-v-html-on-component": OFF,
2483
- "vue/object-curly-newline": [ERROR, { multiline: true, consistent: true }],
2473
+ "vue/object-curly-newline": [ERROR, { consistent: true, multiline: true }],
2484
2474
  "vue/object-curly-spacing": [ERROR, ALWAYS],
2485
2475
  "vue/object-property-newline": [ERROR, { allowMultiplePropertiesPerLine: true }],
2486
2476
  "vue/object-shorthand": [ERROR, ALWAYS, {
@@ -2521,11 +2511,11 @@ function yaml(options = {}) {
2521
2511
  }
2522
2512
  },
2523
2513
  {
2524
- name: "vinicunca:yaml:rules",
2525
2514
  files: [GLOB_YAML],
2526
2515
  languageOptions: {
2527
2516
  parser: import_yaml_eslint_parser.default
2528
2517
  },
2518
+ name: "vinicunca:yaml:rules",
2529
2519
  rules: {
2530
2520
  "style/spaced-comment": OFF,
2531
2521
  "yaml/block-mapping": ERROR,
@@ -2561,17 +2551,17 @@ var VuePackages = [
2561
2551
  ];
2562
2552
  function vinicuncaESLint({ options = {}, userConfigs = [] } = {}) {
2563
2553
  const {
2554
+ componentExts = [],
2564
2555
  isInEditor = !!((import_node_process3.default.env.VSCODE_PID || import_node_process3.default.env.JETBRAINS_IDE) && !import_node_process3.default.env.CI),
2565
- vue: enableVue = VuePackages.some((i) => (0, import_local_pkg.isPackageExists)(i)),
2566
- typescript: tsOptions = {},
2567
- stylistic: enableStylistic = true,
2568
- test: enableTest = true,
2569
2556
  jsonc: enableJsonc = true,
2570
- yaml: enableYaml = true,
2571
2557
  markdown: enableMarkdown = true,
2572
- react: enableReact = false,
2573
2558
  overrides = {},
2574
- componentExts = []
2559
+ react: enableReact = false,
2560
+ stylistic: enableStylistic = true,
2561
+ test: enableTest = true,
2562
+ typescript: tsOptions = {},
2563
+ vue: enableVue = VuePackages.some((i) => (0, import_local_pkg.isPackageExists)(i)),
2564
+ yaml: enableYaml = true
2575
2565
  } = options;
2576
2566
  const configs = [];
2577
2567
  configs.push(
@@ -2611,11 +2601,11 @@ function vinicuncaESLint({ options = {}, userConfigs = [] } = {}) {
2611
2601
  ;
2612
2602
  if (enableVue) {
2613
2603
  configs.push(vue({
2604
+ overrides: overrides.vue,
2614
2605
  typescript: {
2615
2606
  enabled: tsEnabled,
2616
2607
  ...tsParams
2617
- },
2618
- overrides: overrides.vue
2608
+ }
2619
2609
  }));
2620
2610
  }
2621
2611
  ;
@@ -2692,6 +2682,7 @@ var src_default = vinicuncaESLint;
2692
2682
  pluginMarkdown,
2693
2683
  pluginNoOnlyTests,
2694
2684
  pluginNode,
2685
+ pluginPerfectionist,
2695
2686
  pluginReact,
2696
2687
  pluginReactHooks,
2697
2688
  pluginStylistic,