@vinicunca/eslint-config 2.0.3 → 2.0.5

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,85 @@ 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,
1684
+ "react/prop-types": OFF,
1704
1685
  "react/react-in-jsx-scope": OFF,
1686
+ "react/self-closing-comp": ERROR,
1687
+ "react/style-prop-object": ERROR,
1688
+ "style/jsx-quotes": [ERROR, "prefer-double"],
1705
1689
  ...overrides
1690
+ },
1691
+ settings: {
1692
+ react: {
1693
+ version: "detect"
1694
+ }
1706
1695
  }
1707
1696
  }
1708
1697
  ];
@@ -1712,8 +1701,8 @@ function react(options = {}) {
1712
1701
  function sortPackageJson() {
1713
1702
  return [
1714
1703
  {
1715
- name: "vinicunca:sort-package-json",
1716
1704
  files: ["**/package.json"],
1705
+ name: "vinicunca:sort-package-json",
1717
1706
  rules: {
1718
1707
  "jsonc/sort-array-values": [
1719
1708
  ERROR,
@@ -1801,8 +1790,8 @@ function sortPackageJson() {
1801
1790
  function sortTsconfig() {
1802
1791
  return [
1803
1792
  {
1804
- name: "vinicunca:sort-tsconfig",
1805
1793
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
1794
+ name: "vinicunca:sort-tsconfig",
1806
1795
  rules: {
1807
1796
  "jsonc/sort-keys": [
1808
1797
  ERROR,
@@ -1930,18 +1919,19 @@ function stylistic() {
1930
1919
  {
1931
1920
  name: "vinicunca:stylistic",
1932
1921
  plugins: {
1933
- vinicunca: default3,
1934
- style: default2
1922
+ style: default2,
1923
+ vinicunca: default4
1935
1924
  },
1936
1925
  rules: {
1937
1926
  "curly": [ERROR, "all"],
1938
1927
  "style/array-bracket-newline": [ERROR, CONSISTENT],
1939
1928
  "style/array-bracket-spacing": [ERROR, NEVER],
1940
1929
  "style/array-element-newline": [ERROR, CONSISTENT],
1941
- "style/arrow-spacing": [ERROR, { before: true, after: true }],
1930
+ "style/arrow-spacing": [ERROR, { after: true, before: true }],
1942
1931
  "style/block-spacing": [ERROR, ALWAYS],
1943
1932
  "style/brace-style": [ERROR],
1944
- "style/comma-spacing": [ERROR, { before: false, after: true }],
1933
+ "style/comma-dangle": [ERROR, "always-multiline"],
1934
+ "style/comma-spacing": [ERROR, { after: true, before: false }],
1945
1935
  "style/comma-style": [ERROR, "last"],
1946
1936
  "style/computed-property-spacing": [ERROR, NEVER, { enforceForClassMembers: true }],
1947
1937
  "style/dot-location": [ERROR, "property"],
@@ -1985,8 +1975,8 @@ function stylistic() {
1985
1975
  offsetTernaryExpressions: true,
1986
1976
  outerIIFEBody: 1
1987
1977
  }],
1988
- "style/key-spacing": [ERROR, { beforeColon: false, afterColon: true }],
1989
- "style/keyword-spacing": [ERROR, { before: true, after: true }],
1978
+ "style/key-spacing": [ERROR, { afterColon: true, beforeColon: false }],
1979
+ "style/keyword-spacing": [ERROR, { after: true, before: true }],
1990
1980
  "style/lines-between-class-members": [ERROR, ALWAYS, { exceptAfterSingleLine: true }],
1991
1981
  "style/max-statements-per-line": [ERROR, { max: 1 }],
1992
1982
  "style/member-delimiter-style": [ERROR],
@@ -1995,12 +1985,12 @@ function stylistic() {
1995
1985
  "style/no-extra-parens": [ERROR, "functions"],
1996
1986
  "style/no-floating-decimal": ERROR,
1997
1987
  "style/no-mixed-operators": [ERROR, {
1988
+ allowSamePrecedence: true,
1998
1989
  groups: [
1999
1990
  ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
2000
1991
  ["&&", "||"],
2001
1992
  ["in", "instanceof"]
2002
- ],
2003
- allowSamePrecedence: true
1993
+ ]
2004
1994
  }],
2005
1995
  "style/no-mixed-spaces-and-tabs": ERROR,
2006
1996
  "style/no-multi-spaces": ERROR,
@@ -2008,34 +1998,34 @@ function stylistic() {
2008
1998
  "style/no-tabs": ERROR,
2009
1999
  "style/no-trailing-spaces": ERROR,
2010
2000
  "style/no-whitespace-before-property": ERROR,
2011
- "style/object-curly-newline": [ERROR, { multiline: true, consistent: true }],
2001
+ "style/object-curly-newline": [ERROR, { consistent: true, multiline: true }],
2012
2002
  "style/object-curly-spacing": [ERROR, ALWAYS],
2013
2003
  "style/object-property-newline": [ERROR, { allowMultiplePropertiesPerLine: true }],
2014
2004
  "style/operator-linebreak": [ERROR, "before"],
2015
- "style/padded-blocks": [ERROR, { blocks: NEVER, switches: NEVER, classes: NEVER }],
2005
+ "style/padded-blocks": [ERROR, { blocks: NEVER, classes: NEVER, switches: NEVER }],
2016
2006
  "style/quote-props": [ERROR, "consistent-as-needed"],
2017
2007
  "style/quotes": [ERROR, "single"],
2018
2008
  "style/rest-spread-spacing": [ERROR, NEVER],
2019
2009
  "style/semi": [ERROR, ALWAYS],
2020
- "style/semi-spacing": [ERROR, { before: false, after: true }],
2010
+ "style/semi-spacing": [ERROR, { after: true, before: false }],
2021
2011
  "style/space-before-blocks": [ERROR, ALWAYS],
2022
2012
  "style/space-before-function-paren": [ERROR, {
2023
2013
  anonymous: NEVER,
2024
- named: NEVER,
2025
- asyncArrow: ALWAYS
2014
+ asyncArrow: ALWAYS,
2015
+ named: NEVER
2026
2016
  }],
2027
2017
  "style/space-in-parens": [ERROR, NEVER],
2028
2018
  "style/space-infix-ops": ERROR,
2029
- "style/space-unary-ops": [ERROR, { words: true, nonwords: false }],
2019
+ "style/space-unary-ops": [ERROR, { nonwords: false, words: true }],
2030
2020
  "style/spaced-comment": [ERROR, "always", {
2031
- line: {
2032
- markers: ["/"],
2033
- exceptions: ["/", "#"]
2034
- },
2035
2021
  block: {
2036
- markers: ["!"],
2022
+ balanced: true,
2037
2023
  exceptions: ["*"],
2038
- balanced: true
2024
+ markers: ["!"]
2025
+ },
2026
+ line: {
2027
+ exceptions: ["/", "#"],
2028
+ markers: ["/"]
2039
2029
  }
2040
2030
  }],
2041
2031
  "style/template-curly-spacing": ERROR,
@@ -2045,7 +2035,6 @@ function stylistic() {
2045
2035
  functionPrototypeMethods: true
2046
2036
  }],
2047
2037
  "style/yield-star-spacing": [ERROR, "both"],
2048
- "style/comma-dangle": [ERROR, "always-multiline"],
2049
2038
  "vinicunca/consistent-list-newline": ERROR,
2050
2039
  "vinicunca/if-newline": ERROR,
2051
2040
  "vinicunca/top-level-function": ERROR
@@ -2081,8 +2070,8 @@ function test(options = {}) {
2081
2070
  }
2082
2071
  },
2083
2072
  {
2084
- name: "vinicunca:test:rules",
2085
2073
  files: GLOB_TESTS,
2074
+ name: "vinicunca:test:rules",
2086
2075
  rules: {
2087
2076
  "test/consistent-test-it": [ERROR, { fn: "it", withinDescribe: "it" }],
2088
2077
  "test/no-identical-title": ERROR,
@@ -2131,11 +2120,11 @@ function typescript(options) {
2131
2120
  "ts/no-floating-promises": ERROR,
2132
2121
  "ts/no-for-in-array": ERROR,
2133
2122
  "ts/no-implied-eval": ERROR,
2134
- "ts/no-misused-promises": ERROR,
2123
+ // Temporary turning it off due to performance
2124
+ "ts/no-misused-promises": OFF,
2135
2125
  "ts/no-throw-literal": ERROR,
2136
2126
  "ts/restrict-plus-operands": ERROR,
2137
- "ts/restrict-template-expressions": ERROR,
2138
- "ts/unbound-method": ERROR
2127
+ "ts/restrict-template-expressions": ERROR
2139
2128
  };
2140
2129
  let tsConfigOptions = {};
2141
2130
  let additionalTypeAwareRules = {};
@@ -2151,13 +2140,12 @@ function typescript(options) {
2151
2140
  // Install the plugins without globs, so they can be configured separately.
2152
2141
  name: "vinicunca:typescript:setup",
2153
2142
  plugins: {
2154
- vinicunca: default3,
2155
2143
  import: pluginImport,
2156
- ts: default4
2144
+ ts: default3,
2145
+ vinicunca: default4
2157
2146
  }
2158
2147
  },
2159
2148
  {
2160
- name: "vinicunca:typescript:rules",
2161
2149
  files: [
2162
2150
  GLOB_SRC,
2163
2151
  ...componentExts.map((ext) => `**/*.${ext}`)
@@ -2165,54 +2153,56 @@ function typescript(options) {
2165
2153
  languageOptions: {
2166
2154
  parser: parserTs,
2167
2155
  parserOptions: {
2156
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
2168
2157
  sourceType: "module",
2169
2158
  ...tsConfigOptions,
2170
2159
  ...parserOptions
2171
2160
  }
2172
2161
  },
2162
+ name: "vinicunca:typescript:rules",
2173
2163
  rules: {
2174
2164
  ...renameRules(
2175
- default4.configs["eslint-recommended"].overrides[0].rules,
2165
+ default3.configs["eslint-recommended"].overrides[0].rules,
2176
2166
  "@typescript-eslint/",
2177
2167
  "ts/"
2178
2168
  ),
2179
2169
  ...renameRules(
2180
- default4.configs.strict.rules,
2170
+ default3.configs.strict.rules,
2181
2171
  "@typescript-eslint/",
2182
2172
  "ts/"
2183
2173
  ),
2184
2174
  "no-dupe-class-members": OFF,
2185
- "ts/no-dupe-class-members": ERROR,
2186
2175
  "no-invalid-this": OFF,
2187
- "ts/no-invalid-this": ERROR,
2188
2176
  "no-loss-of-precision": OFF,
2189
- "ts/no-loss-of-precision": ERROR,
2190
2177
  "no-redeclare": OFF,
2191
- "ts/no-redeclare": ERROR,
2178
+ "no-unused-vars": OFF,
2192
2179
  "no-use-before-define": OFF,
2193
- "ts/no-use-before-define": [ERROR, { functions: false, classes: false, variables: true }],
2194
2180
  "no-useless-constructor": OFF,
2195
2181
  "ts/ban-ts-comment": [ERROR, { "ts-ignore": "allow-with-description" }],
2196
2182
  "ts/ban-types": [ERROR, { types: { Function: false } }],
2197
2183
  "ts/consistent-type-definitions": [ERROR, "interface"],
2198
- "ts/consistent-type-imports": [ERROR, { prefer: "type-imports", disallowTypeAnnotations: false }],
2184
+ "ts/consistent-type-imports": [ERROR, { disallowTypeAnnotations: false, prefer: "type-imports" }],
2199
2185
  "ts/explicit-function-return-type": OFF,
2200
2186
  "ts/explicit-member-accessibility": OFF,
2201
2187
  "ts/explicit-module-boundary-types": OFF,
2202
2188
  "ts/naming-convention": OFF,
2189
+ "ts/no-dupe-class-members": ERROR,
2203
2190
  "ts/no-empty-function": OFF,
2204
2191
  "ts/no-empty-interface": OFF,
2205
2192
  "ts/no-explicit-any": OFF,
2206
2193
  "ts/no-import-type-side-effects": ERROR,
2194
+ "ts/no-invalid-this": ERROR,
2207
2195
  "ts/no-invalid-void-type": OFF,
2196
+ "ts/no-loss-of-precision": ERROR,
2208
2197
  "ts/no-non-null-assertion": OFF,
2198
+ "ts/no-redeclare": ERROR,
2209
2199
  "ts/no-require-imports": ERROR,
2210
- "no-unused-vars": OFF,
2211
2200
  "ts/no-unused-vars": [ERROR, {
2212
2201
  argsIgnorePattern: "^_",
2213
2202
  destructuredArrayIgnorePattern: "^_",
2214
2203
  ignoreRestSiblings: true
2215
2204
  }],
2205
+ "ts/no-use-before-define": [ERROR, { classes: false, functions: false, variables: true }],
2216
2206
  "ts/parameter-properties": OFF,
2217
2207
  "ts/prefer-ts-expect-error": ERROR,
2218
2208
  "ts/triple-slash-reference": OFF,
@@ -2225,8 +2215,8 @@ function typescript(options) {
2225
2215
  }
2226
2216
  },
2227
2217
  {
2228
- name: "vinicunca:typescript:dts-overrides",
2229
2218
  files: ["**/*.d.ts"],
2219
+ name: "vinicunca:typescript:dts-overrides",
2230
2220
  rules: {
2231
2221
  "eslint-comments/no-unlimited-disable": OFF,
2232
2222
  "import/no-duplicates": OFF,
@@ -2234,15 +2224,15 @@ function typescript(options) {
2234
2224
  }
2235
2225
  },
2236
2226
  {
2237
- name: "vinicunca:typescript:tests-overrides",
2238
2227
  files: ["**/*.{test,spec}.ts?(x)"],
2228
+ name: "vinicunca:typescript:tests-overrides",
2239
2229
  rules: {
2240
2230
  "no-unused-expressions": OFF
2241
2231
  }
2242
2232
  },
2243
2233
  {
2244
- name: "vinicunca:typescript:javascript-overrides",
2245
2234
  files: ["**/*.js", "**/*.cjs"],
2235
+ name: "vinicunca:typescript:javascript-overrides",
2246
2236
  rules: {
2247
2237
  "ts/no-require-imports": OFF,
2248
2238
  "ts/no-var-requires": OFF
@@ -2260,7 +2250,7 @@ function unicorn(options = {}) {
2260
2250
  {
2261
2251
  name: "vinicunca:unicorn",
2262
2252
  plugins: {
2263
- unicorn: default10
2253
+ unicorn: default13
2264
2254
  },
2265
2255
  rules: {
2266
2256
  "unicorn/error-message": ERROR,
@@ -2269,11 +2259,11 @@ function unicorn(options = {}) {
2269
2259
  "unicorn/no-new-array": ERROR,
2270
2260
  "unicorn/no-new-buffer": ERROR,
2271
2261
  "unicorn/number-literal-case": ERROR,
2262
+ "unicorn/prefer-dom-node-text-content": ERROR,
2272
2263
  "unicorn/prefer-includes": ERROR,
2273
2264
  "unicorn/prefer-node-protocol": ERROR,
2274
2265
  "unicorn/prefer-number-properties": ERROR,
2275
2266
  "unicorn/prefer-string-starts-ends-with": ERROR,
2276
- "unicorn/prefer-dom-node-text-content": ERROR,
2277
2267
  "unicorn/prefer-type-error": ERROR,
2278
2268
  "unicorn/throw-new-error": ERROR,
2279
2269
  ...overrides
@@ -2286,8 +2276,8 @@ function unicorn(options = {}) {
2286
2276
  import process2 from "process";
2287
2277
  function vue(options = {}) {
2288
2278
  const {
2289
- typescript: typescript2 = {},
2290
- overrides = {}
2279
+ overrides = {},
2280
+ typescript: typescript2 = {}
2291
2281
  } = options;
2292
2282
  let tsConfigOptions = {};
2293
2283
  const tsconfigPath = typescript2.tsconfigPath ?? [];
@@ -2301,14 +2291,13 @@ function vue(options = {}) {
2301
2291
  {
2302
2292
  name: "vinicunca:vue:setup",
2303
2293
  plugins: {
2304
- vue: default14
2294
+ vue: default16
2305
2295
  }
2306
2296
  },
2307
2297
  {
2308
- name: "vinicunca:vue:rules",
2309
2298
  files: [GLOB_VUE],
2310
2299
  languageOptions: {
2311
- parser: default17,
2300
+ parser: default18,
2312
2301
  parserOptions: {
2313
2302
  ecmaFeatures: {
2314
2303
  jsx: true
@@ -2319,12 +2308,13 @@ function vue(options = {}) {
2319
2308
  ...tsConfigOptions
2320
2309
  }
2321
2310
  },
2322
- processor: default14.processors[".vue"],
2311
+ name: "vinicunca:vue:rules",
2312
+ processor: default16.processors[".vue"],
2323
2313
  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,
2314
+ ...default16.configs.base.rules,
2315
+ ...default16.configs["vue3-essential"].rules,
2316
+ ...default16.configs["vue3-strongly-recommended"].rules,
2317
+ ...default16.configs["vue3-recommended"].rules,
2328
2318
  "node/prefer-global/process": OFF,
2329
2319
  "vue/array-bracket-spacing": [ERROR, NEVER],
2330
2320
  "vue/arrow-spacing": [ERROR, {
@@ -2388,7 +2378,7 @@ function vue(options = {}) {
2388
2378
  "vue/no-useless-v-bind": ERROR,
2389
2379
  "vue/no-v-html": OFF,
2390
2380
  "vue/no-v-text-v-html-on-component": OFF,
2391
- "vue/object-curly-newline": [ERROR, { multiline: true, consistent: true }],
2381
+ "vue/object-curly-newline": [ERROR, { consistent: true, multiline: true }],
2392
2382
  "vue/object-curly-spacing": [ERROR, ALWAYS],
2393
2383
  "vue/object-property-newline": [ERROR, { allowMultiplePropertiesPerLine: true }],
2394
2384
  "vue/object-shorthand": [ERROR, ALWAYS, {
@@ -2429,11 +2419,11 @@ function yaml(options = {}) {
2429
2419
  }
2430
2420
  },
2431
2421
  {
2432
- name: "vinicunca:yaml:rules",
2433
2422
  files: [GLOB_YAML],
2434
2423
  languageOptions: {
2435
- parser: default18
2424
+ parser: default19
2436
2425
  },
2426
+ name: "vinicunca:yaml:rules",
2437
2427
  rules: {
2438
2428
  "style/spaced-comment": OFF,
2439
2429
  "yaml/block-mapping": ERROR,
@@ -2469,17 +2459,17 @@ var VuePackages = [
2469
2459
  ];
2470
2460
  function vinicuncaESLint({ options = {}, userConfigs = [] } = {}) {
2471
2461
  const {
2462
+ componentExts = [],
2472
2463
  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
2464
  jsonc: enableJsonc = true,
2478
- yaml: enableYaml = true,
2479
2465
  markdown: enableMarkdown = true,
2480
- react: enableReact = false,
2481
2466
  overrides = {},
2482
- componentExts = []
2467
+ react: enableReact = false,
2468
+ stylistic: enableStylistic = true,
2469
+ test: enableTest = true,
2470
+ typescript: tsOptions = {},
2471
+ vue: enableVue = VuePackages.some((i) => isPackageExists(i)),
2472
+ yaml: enableYaml = true
2483
2473
  } = options;
2484
2474
  const configs = [];
2485
2475
  configs.push(
@@ -2519,11 +2509,11 @@ function vinicuncaESLint({ options = {}, userConfigs = [] } = {}) {
2519
2509
  ;
2520
2510
  if (enableVue) {
2521
2511
  configs.push(vue({
2512
+ overrides: overrides.vue,
2522
2513
  typescript: {
2523
2514
  enabled: tsEnabled,
2524
2515
  ...tsParams
2525
- },
2526
- overrides: overrides.vue
2516
+ }
2527
2517
  }));
2528
2518
  }
2529
2519
  ;
@@ -2589,10 +2579,10 @@ export {
2589
2579
  jsonc,
2590
2580
  markdown,
2591
2581
  node,
2592
- default16 as parserJsonc,
2582
+ default17 as parserJsonc,
2593
2583
  parserTs,
2594
- default17 as parserVue,
2595
- default18 as parserYaml,
2584
+ default18 as parserVue,
2585
+ default19 as parserYaml,
2596
2586
  default5 as pluginComments,
2597
2587
  pluginImport,
2598
2588
  default6 as pluginJsdoc,
@@ -2600,15 +2590,16 @@ export {
2600
2590
  default7 as pluginMarkdown,
2601
2591
  default9 as pluginNoOnlyTests,
2602
2592
  default8 as pluginNode,
2603
- default12 as pluginReact,
2604
- default13 as pluginReactHooks,
2593
+ default10 as pluginPerfectionist,
2594
+ default11 as pluginReact,
2595
+ default12 as pluginReactHooks,
2605
2596
  default2 as pluginStylistic,
2606
- default4 as pluginTs,
2607
- default10 as pluginUnicorn,
2608
- default11 as pluginUnusedImports,
2609
- default3 as pluginVinicunca,
2597
+ default3 as pluginTs,
2598
+ default13 as pluginUnicorn,
2599
+ default14 as pluginUnusedImports,
2600
+ default4 as pluginVinicunca,
2610
2601
  default15 as pluginVitest,
2611
- default14 as pluginVue,
2602
+ default16 as pluginVue,
2612
2603
  pluginYaml,
2613
2604
  react,
2614
2605
  renameRules,