@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.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/base.ts
2
- import process3 from "process";
3
2
  import { isPackageExists } from "local-pkg";
3
+ import process3 from "process";
4
4
 
5
5
  // src/flags.ts
6
6
  var ERROR = "error";
@@ -12,9 +12,9 @@ var ALWAYS = "always";
12
12
 
13
13
  // src/plugins.ts
14
14
  import { default as default2 } from "@stylistic/eslint-plugin";
15
- import { default as default3 } from "@vinicunca/eslint-plugin-vinicunca";
16
- import { default as default4 } from "@typescript-eslint/eslint-plugin";
15
+ import { default as default3 } from "@typescript-eslint/eslint-plugin";
17
16
  import * as parserTs from "@typescript-eslint/parser";
17
+ import { default as default4 } from "@vinicunca/eslint-plugin-vinicunca";
18
18
  import { default as default5 } from "eslint-plugin-eslint-comments";
19
19
  import * as pluginImport from "eslint-plugin-i";
20
20
  import { default as default6 } from "eslint-plugin-jsdoc";
@@ -22,16 +22,17 @@ import * as pluginJsonc from "eslint-plugin-jsonc";
22
22
  import { default as default7 } from "eslint-plugin-markdown";
23
23
  import { default as default8 } from "eslint-plugin-n";
24
24
  import { default as default9 } from "eslint-plugin-no-only-tests";
25
- import { default as default10 } from "eslint-plugin-unicorn";
26
- import { default as default11 } from "eslint-plugin-unused-imports";
27
- import { default as default12 } from "eslint-plugin-react";
28
- import { default as default13 } from "eslint-plugin-react-hooks";
29
- import { default as default14 } from "eslint-plugin-vue";
30
- import * as pluginYaml from "eslint-plugin-yml";
25
+ import { default as default10 } from "eslint-plugin-perfectionist";
26
+ import { default as default11 } from "eslint-plugin-react";
27
+ import { default as default12 } from "eslint-plugin-react-hooks";
28
+ import { default as default13 } from "eslint-plugin-unicorn";
29
+ import { default as default14 } from "eslint-plugin-unused-imports";
31
30
  import { default as default15 } from "eslint-plugin-vitest";
32
- import { default as default16 } from "jsonc-eslint-parser";
33
- import { default as default17 } from "vue-eslint-parser";
34
- import { default as default18 } from "yaml-eslint-parser";
31
+ import { default as default16 } from "eslint-plugin-vue";
32
+ import * as pluginYaml from "eslint-plugin-yml";
33
+ import { default as default17 } from "jsonc-eslint-parser";
34
+ import { default as default18 } from "vue-eslint-parser";
35
+ import { default as default19 } from "yaml-eslint-parser";
35
36
 
36
37
  // src/configs/comments.ts
37
38
  function comments() {
@@ -51,10 +52,6 @@ function comments() {
51
52
  ];
52
53
  }
53
54
 
54
- // src/configs/ignores.ts
55
- import fs from "fs";
56
- import parseGitignore from "parse-gitignore";
57
-
58
55
  // ../node_modules/.pnpm/@vinicunca+perkakas@0.0.10/node_modules/@vinicunca/perkakas/dist/index.js
59
56
  function purry(fn, args, lazy) {
60
57
  const diff = fn.length - args.length;
@@ -1029,6 +1026,10 @@ function toPairs(object) {
1029
1026
  toPairs2.strict = strict;
1030
1027
  })(toPairs || (toPairs = {}));
1031
1028
 
1029
+ // src/configs/ignores.ts
1030
+ import fs from "fs";
1031
+ import parseGitignore from "parse-gitignore";
1032
+
1032
1033
  // src/globs.ts
1033
1034
  var GLOB_JS = "**/*.?([cm])js";
1034
1035
  var GLOB_JSX = "**/*.?([cm])jsx";
@@ -1083,19 +1084,17 @@ function ignores({
1083
1084
  replace = false
1084
1085
  } = {}) {
1085
1086
  const ignoreList = [];
1086
- if (enableGitignore) {
1087
- if (fs.existsSync(".gitignore")) {
1088
- const gitignoreContent = fs.readFileSync(".gitignore", "utf8");
1089
- const parsed = parseGitignore(gitignoreContent);
1090
- const globs = parsed.globs();
1091
- for (const glob of globs) {
1092
- if (glob.type === "ignore") {
1093
- ignoreList.push(...glob.patterns);
1094
- } else if (glob.type === "unignore") {
1095
- ignoreList.push(...glob.patterns.map((pattern) => `!${pattern}`));
1096
- }
1097
- ;
1087
+ if (enableGitignore && fs.existsSync(".gitignore")) {
1088
+ const gitignoreContent = fs.readFileSync(".gitignore", "utf8");
1089
+ const parsed = parseGitignore(gitignoreContent);
1090
+ const globs = parsed.globs();
1091
+ for (const glob of globs) {
1092
+ if (glob.type === "ignore") {
1093
+ ignoreList.push(...glob.patterns);
1094
+ } else if (glob.type === "unignore") {
1095
+ ignoreList.push(...glob.patterns.map((pattern) => `!${pattern}`));
1098
1096
  }
1097
+ ;
1099
1098
  }
1100
1099
  }
1101
1100
  if (replace) {
@@ -1117,12 +1116,12 @@ function imports() {
1117
1116
  name: "vinicunca:imports",
1118
1117
  plugins: {
1119
1118
  import: pluginImport,
1120
- vinicunca: default3
1119
+ vinicunca: default4
1121
1120
  },
1122
1121
  rules: {
1123
1122
  "import/export": ERROR,
1124
1123
  "import/first": ERROR,
1125
- "import/newline-after-import": [ERROR, {
1124
+ "import/newline-after-import": [OFF, {
1126
1125
  considerComments: true,
1127
1126
  count: 1
1128
1127
  }],
@@ -1131,7 +1130,8 @@ function imports() {
1131
1130
  "import/no-named-default": ERROR,
1132
1131
  "import/no-self-import": ERROR,
1133
1132
  "import/no-webpack-loader-syntax": ERROR,
1134
- "import/order": ERROR,
1133
+ // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-imports
1134
+ "import/order": OFF,
1135
1135
  "vinicunca/import-dedupe": ERROR,
1136
1136
  "vinicunca/no-import-node-modules-by-path": ERROR
1137
1137
  }
@@ -1148,7 +1148,6 @@ function javascript(options = {}) {
1148
1148
  } = options;
1149
1149
  return [
1150
1150
  {
1151
- name: "vinicunca:javascript",
1152
1151
  languageOptions: {
1153
1152
  ecmaVersion: 2022,
1154
1153
  globals: {
@@ -1168,22 +1167,24 @@ function javascript(options = {}) {
1168
1167
  linterOptions: {
1169
1168
  reportUnusedDisableDirectives: true
1170
1169
  },
1170
+ name: "vinicunca:javascript",
1171
1171
  plugins: {
1172
- "vinicunca": default3,
1173
- "unused-imports": default11
1172
+ "perfectionist": default10,
1173
+ "unused-imports": default14,
1174
+ "vinicunca": default4
1174
1175
  },
1175
1176
  rules: {
1176
1177
  "accessor-pairs": [ERROR, {
1177
- setWithoutGet: true,
1178
- enforceForClassMembers: true
1178
+ enforceForClassMembers: true,
1179
+ setWithoutGet: true
1179
1180
  }],
1180
1181
  "array-callback-return": [ERROR, { checkForEach: true }],
1181
1182
  "arrow-parens": [ERROR, ALWAYS],
1182
1183
  "block-scoped-var": ERROR,
1183
1184
  "camelcase": [ERROR, {
1184
1185
  allow: ["^UNSAFE_"],
1185
- properties: NEVER,
1186
- ignoreGlobals: true
1186
+ ignoreGlobals: true,
1187
+ properties: NEVER
1187
1188
  }],
1188
1189
  "constructor-super": ERROR,
1189
1190
  "default-case-last": ERROR,
@@ -1202,10 +1203,10 @@ function javascript(options = {}) {
1202
1203
  "no-case-declarations": ERROR,
1203
1204
  "no-class-assign": ERROR,
1204
1205
  "no-compare-neg-zero": ERROR,
1206
+ "no-cond-assign": [ERROR, ALWAYS],
1205
1207
  "no-console": [ERROR, {
1206
1208
  allow: [WARN, ERROR]
1207
1209
  }],
1208
- "no-cond-assign": [ERROR, ALWAYS],
1209
1210
  "no-const-assign": ERROR,
1210
1211
  "no-constant-binary-expression": ERROR,
1211
1212
  "no-constant-condition": [ERROR, {
@@ -1235,8 +1236,8 @@ function javascript(options = {}) {
1235
1236
  "no-global-assign": ERROR,
1236
1237
  "no-implied-eval": ERROR,
1237
1238
  "no-import-assign": ERROR,
1238
- "no-invalid-this": ERROR,
1239
1239
  "no-invalid-regexp": ERROR,
1240
+ "no-invalid-this": ERROR,
1240
1241
  "no-irregular-whitespace": ERROR,
1241
1242
  "no-iterator": ERROR,
1242
1243
  "no-labels": ERROR,
@@ -1263,35 +1264,35 @@ function javascript(options = {}) {
1263
1264
  "no-restricted-globals": [
1264
1265
  ERROR,
1265
1266
  {
1266
- name: "global",
1267
- message: "Use `globalThis` instead."
1267
+ message: "Use `globalThis` instead.",
1268
+ name: "global"
1268
1269
  },
1269
1270
  {
1270
- name: "self",
1271
- message: "Use `globalThis` instead."
1271
+ message: "Use `globalThis` instead.",
1272
+ name: "self"
1272
1273
  }
1273
1274
  ],
1274
1275
  "no-restricted-properties": [
1275
1276
  ERROR,
1276
1277
  {
1277
- property: "__proto__",
1278
- message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead."
1278
+ message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
1279
+ property: "__proto__"
1279
1280
  },
1280
1281
  {
1281
- property: "__defineGetter__",
1282
- message: "Use `Object.defineProperty` instead."
1282
+ message: "Use `Object.defineProperty` instead.",
1283
+ property: "__defineGetter__"
1283
1284
  },
1284
1285
  {
1285
- property: "__defineSetter__",
1286
- message: "Use `Object.defineProperty` instead."
1286
+ message: "Use `Object.defineProperty` instead.",
1287
+ property: "__defineSetter__"
1287
1288
  },
1288
1289
  {
1289
- property: "__lookupGetter__",
1290
- message: "Use `Object.getOwnPropertyDescriptor` instead."
1290
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
1291
+ property: "__lookupGetter__"
1291
1292
  },
1292
1293
  {
1293
- property: "__lookupSetter__",
1294
- message: "Use `Object.getOwnPropertyDescriptor` instead."
1294
+ message: "Use `Object.getOwnPropertyDescriptor` instead.",
1295
+ property: "__lookupSetter__"
1295
1296
  }
1296
1297
  ],
1297
1298
  "no-restricted-syntax": [
@@ -1327,8 +1328,8 @@ function javascript(options = {}) {
1327
1328
  "no-unsafe-negation": ERROR,
1328
1329
  "no-unused-expressions": [ERROR, {
1329
1330
  allowShortCircuit: true,
1330
- allowTernary: true,
1331
- allowTaggedTemplates: true
1331
+ allowTaggedTemplates: true,
1332
+ allowTernary: true
1332
1333
  }],
1333
1334
  "no-unused-vars": [ERROR, {
1334
1335
  args: "none",
@@ -1337,8 +1338,8 @@ function javascript(options = {}) {
1337
1338
  vars: "all"
1338
1339
  }],
1339
1340
  "no-use-before-define": [ERROR, {
1340
- functions: false,
1341
1341
  classes: false,
1342
+ functions: false,
1342
1343
  variables: true
1343
1344
  }],
1344
1345
  "no-useless-backreference": ERROR,
@@ -1352,8 +1353,8 @@ function javascript(options = {}) {
1352
1353
  "no-void": ERROR,
1353
1354
  "no-with": ERROR,
1354
1355
  "object-shorthand": [ERROR, ALWAYS, {
1355
- ignoreConstructors: false,
1356
- avoidQuotes: true
1356
+ avoidQuotes: true,
1357
+ ignoreConstructors: false
1357
1358
  }],
1358
1359
  "one-var": [ERROR, {
1359
1360
  initialized: NEVER
@@ -1371,44 +1372,36 @@ function javascript(options = {}) {
1371
1372
  "prefer-rest-params": ERROR,
1372
1373
  "prefer-spread": ERROR,
1373
1374
  "prefer-template": ERROR,
1374
- "sort-imports": [ERROR, {
1375
- ignoreCase: false,
1376
- ignoreDeclarationSort: true,
1377
- ignoreMemberSort: false,
1378
- memberSyntaxSortOrder: [
1379
- "none",
1380
- "all",
1381
- "multiple",
1382
- "single"
1383
- ],
1384
- allowSeparatedGroups: false
1385
- }],
1375
+ // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-imports
1376
+ "sort-imports": [OFF],
1386
1377
  "symbol-description": ERROR,
1387
1378
  "unicode-bom": [ERROR, NEVER],
1379
+ "unused-imports/no-unused-imports": isInEditor ? OFF : ERROR,
1380
+ "unused-imports/no-unused-vars": [WARN, {
1381
+ args: "after-used",
1382
+ argsIgnorePattern: "^_",
1383
+ ignoreRestSiblings: true,
1384
+ vars: "all",
1385
+ varsIgnorePattern: "^_"
1386
+ }],
1388
1387
  "use-isnan": [ERROR, {
1389
- enforceForSwitchCase: true,
1390
- enforceForIndexOf: true
1388
+ enforceForIndexOf: true,
1389
+ enforceForSwitchCase: true
1391
1390
  }],
1392
1391
  "valid-typeof": [ERROR, {
1393
1392
  requireStringLiterals: true
1394
1393
  }],
1395
1394
  "vars-on-top": ERROR,
1396
1395
  "yoda": [ERROR, NEVER],
1397
- "unused-imports/no-unused-imports": isInEditor ? OFF : ERROR,
1398
- "unused-imports/no-unused-vars": [WARN, {
1399
- vars: "all",
1400
- varsIgnorePattern: "^_",
1401
- args: "after-used",
1402
- argsIgnorePattern: "^_",
1403
- ignoreRestSiblings: true
1404
- }],
1405
- ...default3.configs.recommended.rules,
1396
+ ...default4.configs.recommended.rules,
1397
+ ...default10.configs["recommended-natural"].rules,
1398
+ "perfectionist/sort-vue-attributes": [OFF],
1406
1399
  ...overrides
1407
1400
  }
1408
1401
  },
1409
1402
  {
1410
- name: "vinicunca:javascript:overrides",
1411
1403
  files: [`**/scripts/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
1404
+ name: "vinicunca:javascript:overrides",
1412
1405
  rules: {
1413
1406
  "no-console": OFF
1414
1407
  }
@@ -1462,11 +1455,11 @@ function jsonc(options = {}) {
1462
1455
  }
1463
1456
  },
1464
1457
  {
1465
- name: "vinicunca:jsonc:rules",
1466
1458
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
1467
1459
  languageOptions: {
1468
- parser: default16
1460
+ parser: default17
1469
1461
  },
1462
+ name: "vinicunca:jsonc:rules",
1470
1463
  rules: {
1471
1464
  "jsonc/array-bracket-spacing": [ERROR, NEVER],
1472
1465
  "jsonc/comma-dangle": [ERROR, NEVER],
@@ -1524,12 +1517,11 @@ function markdown(options = {}) {
1524
1517
  }
1525
1518
  },
1526
1519
  {
1527
- name: "vinicunca:markdown:processor",
1528
1520
  files: [GLOB_MARKDOWN],
1521
+ name: "vinicunca:markdown:processor",
1529
1522
  processor: "markdown/markdown"
1530
1523
  },
1531
1524
  {
1532
- name: "vinicunca:markdown:rules",
1533
1525
  files: [
1534
1526
  GLOB_MARKDOWN_CODE,
1535
1527
  ...componentExts.map((ext) => `${GLOB_MARKDOWN}/**/*.${ext}`)
@@ -1541,6 +1533,7 @@ function markdown(options = {}) {
1541
1533
  }
1542
1534
  }
1543
1535
  },
1536
+ name: "vinicunca:markdown:rules",
1544
1537
  rules: {
1545
1538
  "no-alert": OFF,
1546
1539
  "no-console": OFF,
@@ -1611,6 +1604,7 @@ function node() {
1611
1604
  }
1612
1605
 
1613
1606
  // src/configs/react.ts
1607
+ var STR_PARENS_NEW_LINE = "parens-new-line";
1614
1608
  function react(options = {}) {
1615
1609
  const {
1616
1610
  overrides = {}
@@ -1619,90 +1613,84 @@ function react(options = {}) {
1619
1613
  {
1620
1614
  name: "vinicunca:react:setup",
1621
1615
  plugins: {
1622
- "react": default12,
1623
- "react-hooks": default13
1616
+ "react": default11,
1617
+ "react-hooks": default12
1624
1618
  }
1625
1619
  },
1626
1620
  {
1627
1621
  name: "vinicunca:react:rules",
1628
- settings: {
1629
- react: {
1630
- version: "detect"
1631
- }
1632
- },
1633
1622
  rules: {
1623
+ ...default11.configs.recommended.rules,
1634
1624
  ...default12.configs.recommended.rules,
1635
- ...default13.configs.recommended.rules,
1636
- "style/jsx-quotes": [ERROR, "prefer-double"],
1625
+ "react/boolean-prop-naming": [OFF, {
1626
+ message: "",
1627
+ propTypeNames: ["bool", "mutuallyExclusiveTrueProps"],
1628
+ rule: "^(is|has)[A-Z]([A-Za-z0-9]?)+"
1629
+ }],
1630
+ "react/destructuring-assignment": [ERROR, "always"],
1637
1631
  "react/jsx-boolean-value": [ERROR, NEVER, { always: [] }],
1632
+ "react/jsx-child-element-spacing": OFF,
1638
1633
  "react/jsx-closing-bracket-location": [ERROR, "line-aligned"],
1639
1634
  "react/jsx-closing-tag-location": ERROR,
1635
+ "react/jsx-curly-brace-presence": [ERROR, { children: NEVER, props: NEVER }],
1636
+ "react/jsx-curly-newline": [ERROR, {
1637
+ multiline: "consistent",
1638
+ singleline: "consistent"
1639
+ }],
1640
1640
  "react/jsx-curly-spacing": [ERROR, {
1641
- when: "always",
1641
+ children: true,
1642
1642
  spacing: {
1643
1643
  objectLiterals: NEVER
1644
1644
  },
1645
- children: true
1645
+ when: "always"
1646
1646
  }],
1647
+ "react/jsx-equals-spacing": [ERROR, NEVER],
1648
+ "react/jsx-first-prop-new-line": [ERROR, "multiline-multiprop"],
1649
+ "react/jsx-indent": [ERROR, 2],
1647
1650
  "react/jsx-indent-props": [ERROR, 2],
1648
1651
  "react/jsx-key": OFF,
1652
+ "react/jsx-max-depth": OFF,
1649
1653
  "react/jsx-max-props-per-line": [ERROR, { maximum: 1, when: "multiline" }],
1654
+ "react/jsx-newline": ERROR,
1650
1655
  "react/jsx-no-duplicate-props": [ERROR, { ignoreCase: true }],
1651
1656
  "react/jsx-no-literals": [OFF, { noStrings: true }],
1657
+ "react/jsx-one-expression-per-line": [ERROR, { allow: "single-child" }],
1652
1658
  "react/jsx-pascal-case": [ERROR, {
1653
1659
  allowAllCaps: true,
1654
1660
  ignore: []
1655
1661
  }],
1656
- "react/jsx-sort-props": [OFF, {
1657
- ignoreCase: true,
1658
- callbacksLast: false,
1659
- shorthandFirst: false,
1660
- shorthandLast: false,
1661
- noSortAlphabetically: false,
1662
- reservedFirst: true
1663
- }],
1662
+ "react/jsx-props-no-multi-spaces": ERROR,
1664
1663
  "react/jsx-sort-default-props": [OFF, {
1665
1664
  ignoreCase: true
1666
1665
  }],
1667
- "react/no-danger": WARN,
1668
- "react/self-closing-comp": ERROR,
1669
- "react/jsx-wrap-multilines": [ERROR, {
1670
- declaration: "parens-new-line",
1671
- assignment: "parens-new-line",
1672
- return: "parens-new-line",
1673
- arrow: "parens-new-line",
1674
- condition: "parens-new-line",
1675
- logical: "parens-new-line",
1676
- prop: "parens-new-line"
1677
- }],
1678
- "react/jsx-first-prop-new-line": [ERROR, "multiline-multiprop"],
1679
- "react/jsx-equals-spacing": [ERROR, NEVER],
1680
- "react/jsx-indent": [ERROR, 2],
1681
- "react/style-prop-object": ERROR,
1666
+ // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-jsx-props
1667
+ "react/jsx-sort-props": [OFF],
1682
1668
  "react/jsx-tag-spacing": [ERROR, {
1683
- closingSlash: NEVER,
1684
- beforeSelfClosing: "always",
1685
1669
  afterOpening: NEVER,
1686
- beforeClosing: NEVER
1687
- }],
1688
- "react/boolean-prop-naming": [OFF, {
1689
- propTypeNames: ["bool", "mutuallyExclusiveTrueProps"],
1690
- rule: "^(is|has)[A-Z]([A-Za-z0-9]?)+",
1691
- message: ""
1670
+ beforeClosing: NEVER,
1671
+ beforeSelfClosing: "always",
1672
+ closingSlash: NEVER
1692
1673
  }],
1693
- "react/jsx-curly-brace-presence": [ERROR, { props: NEVER, children: NEVER }],
1694
- "react/jsx-one-expression-per-line": [ERROR, { allow: "single-child" }],
1695
- "react/destructuring-assignment": [ERROR, "always"],
1696
- "react/jsx-child-element-spacing": OFF,
1697
- "react/jsx-max-depth": OFF,
1698
- "react/jsx-props-no-multi-spaces": ERROR,
1699
- "react/jsx-curly-newline": [ERROR, {
1700
- multiline: "consistent",
1701
- singleline: "consistent"
1674
+ "react/jsx-wrap-multilines": [ERROR, {
1675
+ arrow: STR_PARENS_NEW_LINE,
1676
+ assignment: STR_PARENS_NEW_LINE,
1677
+ condition: STR_PARENS_NEW_LINE,
1678
+ declaration: STR_PARENS_NEW_LINE,
1679
+ logical: STR_PARENS_NEW_LINE,
1680
+ prop: STR_PARENS_NEW_LINE,
1681
+ return: STR_PARENS_NEW_LINE
1702
1682
  }],
1703
- "react/jsx-newline": ERROR,
1683
+ "react/no-danger": WARN,
1704
1684
  "react/react-in-jsx-scope": OFF,
1685
+ "react/self-closing-comp": ERROR,
1686
+ "react/style-prop-object": ERROR,
1687
+ "style/jsx-quotes": [ERROR, "prefer-double"],
1705
1688
  ...overrides
1689
+ },
1690
+ settings: {
1691
+ react: {
1692
+ version: "detect"
1693
+ }
1706
1694
  }
1707
1695
  }
1708
1696
  ];
@@ -1712,8 +1700,8 @@ function react(options = {}) {
1712
1700
  function sortPackageJson() {
1713
1701
  return [
1714
1702
  {
1715
- name: "vinicunca:sort-package-json",
1716
1703
  files: ["**/package.json"],
1704
+ name: "vinicunca:sort-package-json",
1717
1705
  rules: {
1718
1706
  "jsonc/sort-array-values": [
1719
1707
  ERROR,
@@ -1801,8 +1789,8 @@ function sortPackageJson() {
1801
1789
  function sortTsconfig() {
1802
1790
  return [
1803
1791
  {
1804
- name: "vinicunca:sort-tsconfig",
1805
1792
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
1793
+ name: "vinicunca:sort-tsconfig",
1806
1794
  rules: {
1807
1795
  "jsonc/sort-keys": [
1808
1796
  ERROR,
@@ -1930,18 +1918,19 @@ function stylistic() {
1930
1918
  {
1931
1919
  name: "vinicunca:stylistic",
1932
1920
  plugins: {
1933
- vinicunca: default3,
1934
- style: default2
1921
+ style: default2,
1922
+ vinicunca: default4
1935
1923
  },
1936
1924
  rules: {
1937
1925
  "curly": [ERROR, "all"],
1938
1926
  "style/array-bracket-newline": [ERROR, CONSISTENT],
1939
1927
  "style/array-bracket-spacing": [ERROR, NEVER],
1940
1928
  "style/array-element-newline": [ERROR, CONSISTENT],
1941
- "style/arrow-spacing": [ERROR, { before: true, after: true }],
1929
+ "style/arrow-spacing": [ERROR, { after: true, before: true }],
1942
1930
  "style/block-spacing": [ERROR, ALWAYS],
1943
1931
  "style/brace-style": [ERROR],
1944
- "style/comma-spacing": [ERROR, { before: false, after: true }],
1932
+ "style/comma-dangle": [ERROR, "always-multiline"],
1933
+ "style/comma-spacing": [ERROR, { after: true, before: false }],
1945
1934
  "style/comma-style": [ERROR, "last"],
1946
1935
  "style/computed-property-spacing": [ERROR, NEVER, { enforceForClassMembers: true }],
1947
1936
  "style/dot-location": [ERROR, "property"],
@@ -1985,8 +1974,8 @@ function stylistic() {
1985
1974
  offsetTernaryExpressions: true,
1986
1975
  outerIIFEBody: 1
1987
1976
  }],
1988
- "style/key-spacing": [ERROR, { beforeColon: false, afterColon: true }],
1989
- "style/keyword-spacing": [ERROR, { before: true, after: true }],
1977
+ "style/key-spacing": [ERROR, { afterColon: true, beforeColon: false }],
1978
+ "style/keyword-spacing": [ERROR, { after: true, before: true }],
1990
1979
  "style/lines-between-class-members": [ERROR, ALWAYS, { exceptAfterSingleLine: true }],
1991
1980
  "style/max-statements-per-line": [ERROR, { max: 1 }],
1992
1981
  "style/member-delimiter-style": [ERROR],
@@ -1995,12 +1984,12 @@ function stylistic() {
1995
1984
  "style/no-extra-parens": [ERROR, "functions"],
1996
1985
  "style/no-floating-decimal": ERROR,
1997
1986
  "style/no-mixed-operators": [ERROR, {
1987
+ allowSamePrecedence: true,
1998
1988
  groups: [
1999
1989
  ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
2000
1990
  ["&&", "||"],
2001
1991
  ["in", "instanceof"]
2002
- ],
2003
- allowSamePrecedence: true
1992
+ ]
2004
1993
  }],
2005
1994
  "style/no-mixed-spaces-and-tabs": ERROR,
2006
1995
  "style/no-multi-spaces": ERROR,
@@ -2008,34 +1997,34 @@ function stylistic() {
2008
1997
  "style/no-tabs": ERROR,
2009
1998
  "style/no-trailing-spaces": ERROR,
2010
1999
  "style/no-whitespace-before-property": ERROR,
2011
- "style/object-curly-newline": [ERROR, { multiline: true, consistent: true }],
2000
+ "style/object-curly-newline": [ERROR, { consistent: true, multiline: true }],
2012
2001
  "style/object-curly-spacing": [ERROR, ALWAYS],
2013
2002
  "style/object-property-newline": [ERROR, { allowMultiplePropertiesPerLine: true }],
2014
2003
  "style/operator-linebreak": [ERROR, "before"],
2015
- "style/padded-blocks": [ERROR, { blocks: NEVER, switches: NEVER, classes: NEVER }],
2004
+ "style/padded-blocks": [ERROR, { blocks: NEVER, classes: NEVER, switches: NEVER }],
2016
2005
  "style/quote-props": [ERROR, "consistent-as-needed"],
2017
2006
  "style/quotes": [ERROR, "single"],
2018
2007
  "style/rest-spread-spacing": [ERROR, NEVER],
2019
2008
  "style/semi": [ERROR, ALWAYS],
2020
- "style/semi-spacing": [ERROR, { before: false, after: true }],
2009
+ "style/semi-spacing": [ERROR, { after: true, before: false }],
2021
2010
  "style/space-before-blocks": [ERROR, ALWAYS],
2022
2011
  "style/space-before-function-paren": [ERROR, {
2023
2012
  anonymous: NEVER,
2024
- named: NEVER,
2025
- asyncArrow: ALWAYS
2013
+ asyncArrow: ALWAYS,
2014
+ named: NEVER
2026
2015
  }],
2027
2016
  "style/space-in-parens": [ERROR, NEVER],
2028
2017
  "style/space-infix-ops": ERROR,
2029
- "style/space-unary-ops": [ERROR, { words: true, nonwords: false }],
2018
+ "style/space-unary-ops": [ERROR, { nonwords: false, words: true }],
2030
2019
  "style/spaced-comment": [ERROR, "always", {
2031
- line: {
2032
- markers: ["/"],
2033
- exceptions: ["/", "#"]
2034
- },
2035
2020
  block: {
2036
- markers: ["!"],
2021
+ balanced: true,
2037
2022
  exceptions: ["*"],
2038
- balanced: true
2023
+ markers: ["!"]
2024
+ },
2025
+ line: {
2026
+ exceptions: ["/", "#"],
2027
+ markers: ["/"]
2039
2028
  }
2040
2029
  }],
2041
2030
  "style/template-curly-spacing": ERROR,
@@ -2045,7 +2034,6 @@ function stylistic() {
2045
2034
  functionPrototypeMethods: true
2046
2035
  }],
2047
2036
  "style/yield-star-spacing": [ERROR, "both"],
2048
- "style/comma-dangle": [ERROR, "always-multiline"],
2049
2037
  "vinicunca/consistent-list-newline": ERROR,
2050
2038
  "vinicunca/if-newline": ERROR,
2051
2039
  "vinicunca/top-level-function": ERROR
@@ -2081,8 +2069,8 @@ function test(options = {}) {
2081
2069
  }
2082
2070
  },
2083
2071
  {
2084
- name: "vinicunca:test:rules",
2085
2072
  files: GLOB_TESTS,
2073
+ name: "vinicunca:test:rules",
2086
2074
  rules: {
2087
2075
  "test/consistent-test-it": [ERROR, { fn: "it", withinDescribe: "it" }],
2088
2076
  "test/no-identical-title": ERROR,
@@ -2131,11 +2119,11 @@ function typescript(options) {
2131
2119
  "ts/no-floating-promises": ERROR,
2132
2120
  "ts/no-for-in-array": ERROR,
2133
2121
  "ts/no-implied-eval": ERROR,
2134
- "ts/no-misused-promises": ERROR,
2122
+ // Temporary turning it off due to performance
2123
+ "ts/no-misused-promises": OFF,
2135
2124
  "ts/no-throw-literal": ERROR,
2136
2125
  "ts/restrict-plus-operands": ERROR,
2137
- "ts/restrict-template-expressions": ERROR,
2138
- "ts/unbound-method": ERROR
2126
+ "ts/restrict-template-expressions": ERROR
2139
2127
  };
2140
2128
  let tsConfigOptions = {};
2141
2129
  let additionalTypeAwareRules = {};
@@ -2151,13 +2139,12 @@ function typescript(options) {
2151
2139
  // Install the plugins without globs, so they can be configured separately.
2152
2140
  name: "vinicunca:typescript:setup",
2153
2141
  plugins: {
2154
- vinicunca: default3,
2155
2142
  import: pluginImport,
2156
- ts: default4
2143
+ ts: default3,
2144
+ vinicunca: default4
2157
2145
  }
2158
2146
  },
2159
2147
  {
2160
- name: "vinicunca:typescript:rules",
2161
2148
  files: [
2162
2149
  GLOB_SRC,
2163
2150
  ...componentExts.map((ext) => `**/*.${ext}`)
@@ -2165,54 +2152,56 @@ function typescript(options) {
2165
2152
  languageOptions: {
2166
2153
  parser: parserTs,
2167
2154
  parserOptions: {
2155
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
2168
2156
  sourceType: "module",
2169
2157
  ...tsConfigOptions,
2170
2158
  ...parserOptions
2171
2159
  }
2172
2160
  },
2161
+ name: "vinicunca:typescript:rules",
2173
2162
  rules: {
2174
2163
  ...renameRules(
2175
- default4.configs["eslint-recommended"].overrides[0].rules,
2164
+ default3.configs["eslint-recommended"].overrides[0].rules,
2176
2165
  "@typescript-eslint/",
2177
2166
  "ts/"
2178
2167
  ),
2179
2168
  ...renameRules(
2180
- default4.configs.strict.rules,
2169
+ default3.configs.strict.rules,
2181
2170
  "@typescript-eslint/",
2182
2171
  "ts/"
2183
2172
  ),
2184
2173
  "no-dupe-class-members": OFF,
2185
- "ts/no-dupe-class-members": ERROR,
2186
2174
  "no-invalid-this": OFF,
2187
- "ts/no-invalid-this": ERROR,
2188
2175
  "no-loss-of-precision": OFF,
2189
- "ts/no-loss-of-precision": ERROR,
2190
2176
  "no-redeclare": OFF,
2191
- "ts/no-redeclare": ERROR,
2177
+ "no-unused-vars": OFF,
2192
2178
  "no-use-before-define": OFF,
2193
- "ts/no-use-before-define": [ERROR, { functions: false, classes: false, variables: true }],
2194
2179
  "no-useless-constructor": OFF,
2195
2180
  "ts/ban-ts-comment": [ERROR, { "ts-ignore": "allow-with-description" }],
2196
2181
  "ts/ban-types": [ERROR, { types: { Function: false } }],
2197
2182
  "ts/consistent-type-definitions": [ERROR, "interface"],
2198
- "ts/consistent-type-imports": [ERROR, { prefer: "type-imports", disallowTypeAnnotations: false }],
2183
+ "ts/consistent-type-imports": [ERROR, { disallowTypeAnnotations: false, prefer: "type-imports" }],
2199
2184
  "ts/explicit-function-return-type": OFF,
2200
2185
  "ts/explicit-member-accessibility": OFF,
2201
2186
  "ts/explicit-module-boundary-types": OFF,
2202
2187
  "ts/naming-convention": OFF,
2188
+ "ts/no-dupe-class-members": ERROR,
2203
2189
  "ts/no-empty-function": OFF,
2204
2190
  "ts/no-empty-interface": OFF,
2205
2191
  "ts/no-explicit-any": OFF,
2206
2192
  "ts/no-import-type-side-effects": ERROR,
2193
+ "ts/no-invalid-this": ERROR,
2207
2194
  "ts/no-invalid-void-type": OFF,
2195
+ "ts/no-loss-of-precision": ERROR,
2208
2196
  "ts/no-non-null-assertion": OFF,
2197
+ "ts/no-redeclare": ERROR,
2209
2198
  "ts/no-require-imports": ERROR,
2210
- "no-unused-vars": OFF,
2211
2199
  "ts/no-unused-vars": [ERROR, {
2212
2200
  argsIgnorePattern: "^_",
2213
2201
  destructuredArrayIgnorePattern: "^_",
2214
2202
  ignoreRestSiblings: true
2215
2203
  }],
2204
+ "ts/no-use-before-define": [ERROR, { classes: false, functions: false, variables: true }],
2216
2205
  "ts/parameter-properties": OFF,
2217
2206
  "ts/prefer-ts-expect-error": ERROR,
2218
2207
  "ts/triple-slash-reference": OFF,
@@ -2225,8 +2214,8 @@ function typescript(options) {
2225
2214
  }
2226
2215
  },
2227
2216
  {
2228
- name: "vinicunca:typescript:dts-overrides",
2229
2217
  files: ["**/*.d.ts"],
2218
+ name: "vinicunca:typescript:dts-overrides",
2230
2219
  rules: {
2231
2220
  "eslint-comments/no-unlimited-disable": OFF,
2232
2221
  "import/no-duplicates": OFF,
@@ -2234,15 +2223,15 @@ function typescript(options) {
2234
2223
  }
2235
2224
  },
2236
2225
  {
2237
- name: "vinicunca:typescript:tests-overrides",
2238
2226
  files: ["**/*.{test,spec}.ts?(x)"],
2227
+ name: "vinicunca:typescript:tests-overrides",
2239
2228
  rules: {
2240
2229
  "no-unused-expressions": OFF
2241
2230
  }
2242
2231
  },
2243
2232
  {
2244
- name: "vinicunca:typescript:javascript-overrides",
2245
2233
  files: ["**/*.js", "**/*.cjs"],
2234
+ name: "vinicunca:typescript:javascript-overrides",
2246
2235
  rules: {
2247
2236
  "ts/no-require-imports": OFF,
2248
2237
  "ts/no-var-requires": OFF
@@ -2260,7 +2249,7 @@ function unicorn(options = {}) {
2260
2249
  {
2261
2250
  name: "vinicunca:unicorn",
2262
2251
  plugins: {
2263
- unicorn: default10
2252
+ unicorn: default13
2264
2253
  },
2265
2254
  rules: {
2266
2255
  "unicorn/error-message": ERROR,
@@ -2269,11 +2258,11 @@ function unicorn(options = {}) {
2269
2258
  "unicorn/no-new-array": ERROR,
2270
2259
  "unicorn/no-new-buffer": ERROR,
2271
2260
  "unicorn/number-literal-case": ERROR,
2261
+ "unicorn/prefer-dom-node-text-content": ERROR,
2272
2262
  "unicorn/prefer-includes": ERROR,
2273
2263
  "unicorn/prefer-node-protocol": ERROR,
2274
2264
  "unicorn/prefer-number-properties": ERROR,
2275
2265
  "unicorn/prefer-string-starts-ends-with": ERROR,
2276
- "unicorn/prefer-dom-node-text-content": ERROR,
2277
2266
  "unicorn/prefer-type-error": ERROR,
2278
2267
  "unicorn/throw-new-error": ERROR,
2279
2268
  ...overrides
@@ -2286,8 +2275,8 @@ function unicorn(options = {}) {
2286
2275
  import process2 from "process";
2287
2276
  function vue(options = {}) {
2288
2277
  const {
2289
- typescript: typescript2 = {},
2290
- overrides = {}
2278
+ overrides = {},
2279
+ typescript: typescript2 = {}
2291
2280
  } = options;
2292
2281
  let tsConfigOptions = {};
2293
2282
  const tsconfigPath = typescript2.tsconfigPath ?? [];
@@ -2301,14 +2290,13 @@ function vue(options = {}) {
2301
2290
  {
2302
2291
  name: "vinicunca:vue:setup",
2303
2292
  plugins: {
2304
- vue: default14
2293
+ vue: default16
2305
2294
  }
2306
2295
  },
2307
2296
  {
2308
- name: "vinicunca:vue:rules",
2309
2297
  files: [GLOB_VUE],
2310
2298
  languageOptions: {
2311
- parser: default17,
2299
+ parser: default18,
2312
2300
  parserOptions: {
2313
2301
  ecmaFeatures: {
2314
2302
  jsx: true
@@ -2319,12 +2307,13 @@ function vue(options = {}) {
2319
2307
  ...tsConfigOptions
2320
2308
  }
2321
2309
  },
2322
- processor: default14.processors[".vue"],
2310
+ name: "vinicunca:vue:rules",
2311
+ processor: default16.processors[".vue"],
2323
2312
  rules: {
2324
- ...default14.configs.base.rules,
2325
- ...default14.configs["vue3-essential"].rules,
2326
- ...default14.configs["vue3-strongly-recommended"].rules,
2327
- ...default14.configs["vue3-recommended"].rules,
2313
+ ...default16.configs.base.rules,
2314
+ ...default16.configs["vue3-essential"].rules,
2315
+ ...default16.configs["vue3-strongly-recommended"].rules,
2316
+ ...default16.configs["vue3-recommended"].rules,
2328
2317
  "node/prefer-global/process": OFF,
2329
2318
  "vue/array-bracket-spacing": [ERROR, NEVER],
2330
2319
  "vue/arrow-spacing": [ERROR, {
@@ -2388,7 +2377,7 @@ function vue(options = {}) {
2388
2377
  "vue/no-useless-v-bind": ERROR,
2389
2378
  "vue/no-v-html": OFF,
2390
2379
  "vue/no-v-text-v-html-on-component": OFF,
2391
- "vue/object-curly-newline": [ERROR, { multiline: true, consistent: true }],
2380
+ "vue/object-curly-newline": [ERROR, { consistent: true, multiline: true }],
2392
2381
  "vue/object-curly-spacing": [ERROR, ALWAYS],
2393
2382
  "vue/object-property-newline": [ERROR, { allowMultiplePropertiesPerLine: true }],
2394
2383
  "vue/object-shorthand": [ERROR, ALWAYS, {
@@ -2429,11 +2418,11 @@ function yaml(options = {}) {
2429
2418
  }
2430
2419
  },
2431
2420
  {
2432
- name: "vinicunca:yaml:rules",
2433
2421
  files: [GLOB_YAML],
2434
2422
  languageOptions: {
2435
- parser: default18
2423
+ parser: default19
2436
2424
  },
2425
+ name: "vinicunca:yaml:rules",
2437
2426
  rules: {
2438
2427
  "style/spaced-comment": OFF,
2439
2428
  "yaml/block-mapping": ERROR,
@@ -2469,17 +2458,17 @@ var VuePackages = [
2469
2458
  ];
2470
2459
  function vinicuncaESLint({ options = {}, userConfigs = [] } = {}) {
2471
2460
  const {
2461
+ componentExts = [],
2472
2462
  isInEditor = !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE) && !process3.env.CI),
2473
- vue: enableVue = VuePackages.some((i) => isPackageExists(i)),
2474
- typescript: tsOptions = {},
2475
- stylistic: enableStylistic = true,
2476
- test: enableTest = true,
2477
2463
  jsonc: enableJsonc = true,
2478
- yaml: enableYaml = true,
2479
2464
  markdown: enableMarkdown = true,
2480
- react: enableReact = false,
2481
2465
  overrides = {},
2482
- componentExts = []
2466
+ react: enableReact = false,
2467
+ stylistic: enableStylistic = true,
2468
+ test: enableTest = true,
2469
+ typescript: tsOptions = {},
2470
+ vue: enableVue = VuePackages.some((i) => isPackageExists(i)),
2471
+ yaml: enableYaml = true
2483
2472
  } = options;
2484
2473
  const configs = [];
2485
2474
  configs.push(
@@ -2519,11 +2508,11 @@ function vinicuncaESLint({ options = {}, userConfigs = [] } = {}) {
2519
2508
  ;
2520
2509
  if (enableVue) {
2521
2510
  configs.push(vue({
2511
+ overrides: overrides.vue,
2522
2512
  typescript: {
2523
2513
  enabled: tsEnabled,
2524
2514
  ...tsParams
2525
- },
2526
- overrides: overrides.vue
2515
+ }
2527
2516
  }));
2528
2517
  }
2529
2518
  ;
@@ -2589,10 +2578,10 @@ export {
2589
2578
  jsonc,
2590
2579
  markdown,
2591
2580
  node,
2592
- default16 as parserJsonc,
2581
+ default17 as parserJsonc,
2593
2582
  parserTs,
2594
- default17 as parserVue,
2595
- default18 as parserYaml,
2583
+ default18 as parserVue,
2584
+ default19 as parserYaml,
2596
2585
  default5 as pluginComments,
2597
2586
  pluginImport,
2598
2587
  default6 as pluginJsdoc,
@@ -2600,15 +2589,16 @@ export {
2600
2589
  default7 as pluginMarkdown,
2601
2590
  default9 as pluginNoOnlyTests,
2602
2591
  default8 as pluginNode,
2603
- default12 as pluginReact,
2604
- default13 as pluginReactHooks,
2592
+ default10 as pluginPerfectionist,
2593
+ default11 as pluginReact,
2594
+ default12 as pluginReactHooks,
2605
2595
  default2 as pluginStylistic,
2606
- default4 as pluginTs,
2607
- default10 as pluginUnicorn,
2608
- default11 as pluginUnusedImports,
2609
- default3 as pluginVinicunca,
2596
+ default3 as pluginTs,
2597
+ default13 as pluginUnicorn,
2598
+ default14 as pluginUnusedImports,
2599
+ default4 as pluginVinicunca,
2610
2600
  default15 as pluginVitest,
2611
- default14 as pluginVue,
2601
+ default16 as pluginVue,
2612
2602
  pluginYaml,
2613
2603
  react,
2614
2604
  renameRules,