@vinicunca/eslint-config 2.4.3 → 2.5.0

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
@@ -771,13 +771,14 @@ var NEVER = "never";
771
771
  var ALWAYS = "always";
772
772
 
773
773
  // src/plugins.ts
774
- import { default as default2 } from "@vinicunca/eslint-plugin-vinicunca";
774
+ import { default as default2 } from "eslint-plugin-antfu";
775
775
  import { default as default3 } from "eslint-plugin-eslint-comments";
776
776
  import * as pluginImport from "eslint-plugin-import-x";
777
777
  import { default as default4 } from "eslint-plugin-n";
778
778
  import { default as default5 } from "eslint-plugin-perfectionist";
779
- import { default as default6 } from "eslint-plugin-unicorn";
780
- import { default as default7 } from "eslint-plugin-unused-imports";
779
+ import { default as default6 } from "eslint-plugin-sonarjs";
780
+ import { default as default7 } from "eslint-plugin-unicorn";
781
+ import { default as default8 } from "eslint-plugin-unused-imports";
781
782
 
782
783
  // src/configs/comments.ts
783
784
  async function comments() {
@@ -962,8 +963,8 @@ async function stylistic(options = {}) {
962
963
  {
963
964
  name: "vinicunca/stylistic/rules",
964
965
  plugins: {
965
- style: pluginStylistic,
966
- vinicunca: default2
966
+ antfu: default2,
967
+ style: pluginStylistic
967
968
  },
968
969
  rules: {
969
970
  ...config.rules,
@@ -1025,17 +1026,8 @@ async function stylistic(options = {}) {
1025
1026
  "style/rest-spread-spacing": [ERROR, NEVER],
1026
1027
  "style/semi": [ERROR, semi ? ALWAYS : NEVER],
1027
1028
  "style/semi-spacing": [ERROR, { after: true, before: false }],
1028
- "vinicunca/consistent-list-newline": ERROR,
1029
- "vinicunca/if-newline": ERROR,
1030
- "vinicunca/top-level-function": ERROR,
1031
1029
  ...overrides
1032
1030
  }
1033
- },
1034
- {
1035
- files: [GLOB_JSX, GLOB_TSX],
1036
- rules: {
1037
- "vinicunca/consistent-list-newline": OFF
1038
- }
1039
1031
  }
1040
1032
  ];
1041
1033
  }
@@ -1216,8 +1208,8 @@ async function imports() {
1216
1208
  {
1217
1209
  name: "vinicunca/imports/rules",
1218
1210
  plugins: {
1219
- import: pluginImport,
1220
- vinicunca: default2
1211
+ antfu: default2,
1212
+ import: pluginImport
1221
1213
  },
1222
1214
  rules: {
1223
1215
  "import/export": ERROR,
@@ -1232,9 +1224,7 @@ async function imports() {
1232
1224
  "import/no-self-import": ERROR,
1233
1225
  "import/no-webpack-loader-syntax": ERROR,
1234
1226
  // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-imports
1235
- "import/order": OFF,
1236
- "vinicunca/import-dedupe": ERROR,
1237
- "vinicunca/no-import-node-modules-by-path": ERROR
1227
+ "import/order": OFF
1238
1228
  }
1239
1229
  }
1240
1230
  ];
@@ -1273,8 +1263,8 @@ async function javascript(options = {}) {
1273
1263
  },
1274
1264
  name: "vinicunca/javascript/rules",
1275
1265
  plugins: {
1276
- "unused-imports": default7,
1277
- "vinicunca": default2
1266
+ "antfu": default2,
1267
+ "unused-imports": default8
1278
1268
  },
1279
1269
  rules: {
1280
1270
  "accessor-pairs": [ERROR, {
@@ -1494,7 +1484,6 @@ async function javascript(options = {}) {
1494
1484
  }],
1495
1485
  "vars-on-top": ERROR,
1496
1486
  "yoda": [ERROR, NEVER],
1497
- ...default2.configs.recommended.rules,
1498
1487
  ...overrides
1499
1488
  }
1500
1489
  },
@@ -1712,7 +1701,6 @@ async function markdown(options = {}) {
1712
1701
  "ts/restrict-template-expressions": OFF,
1713
1702
  "ts/unbound-method": OFF
1714
1703
  },
1715
- "vinicunca/no-ts-export-equal": OFF,
1716
1704
  ...overrides
1717
1705
  }
1718
1706
  }
@@ -1851,6 +1839,21 @@ async function react(options = {}) {
1851
1839
  ];
1852
1840
  }
1853
1841
 
1842
+ // src/configs/sonar.ts
1843
+ async function sonar() {
1844
+ return [
1845
+ {
1846
+ name: "vinicunca/sonar/rules",
1847
+ plugins: {
1848
+ sonar: default6
1849
+ },
1850
+ rules: {
1851
+ ...default6.configs.recommended.rules
1852
+ }
1853
+ }
1854
+ ];
1855
+ }
1856
+
1854
1857
  // src/configs/sort-package-json.ts
1855
1858
  async function sortPackageJson() {
1856
1859
  return [
@@ -2084,6 +2087,7 @@ function sortTsconfig() {
2084
2087
  }
2085
2088
 
2086
2089
  // src/configs/test.ts
2090
+ var _pluginTest;
2087
2091
  async function test(options = {}) {
2088
2092
  const {
2089
2093
  files = GLOB_TESTS,
@@ -2098,18 +2102,19 @@ async function test(options = {}) {
2098
2102
  // @ts-expect-error missing types
2099
2103
  interopDefault(import("eslint-plugin-no-only-tests"))
2100
2104
  ]);
2105
+ _pluginTest = _pluginTest || {
2106
+ ...pluginVitest,
2107
+ rules: {
2108
+ ...pluginVitest.rules,
2109
+ // extend `test/no-only-tests` rule
2110
+ ...pluginNoOnlyTests.rules
2111
+ }
2112
+ };
2101
2113
  return [
2102
2114
  {
2103
2115
  name: "vinicunca/test/setup",
2104
2116
  plugins: {
2105
- test: {
2106
- ...pluginVitest,
2107
- rules: {
2108
- ...pluginVitest.rules,
2109
- // extend `test/no-only-tests` rule
2110
- ...pluginNoOnlyTests.rules
2111
- }
2112
- }
2117
+ test: _pluginTest
2113
2118
  }
2114
2119
  },
2115
2120
  {
@@ -2189,8 +2194,8 @@ async function typescript(options = {}) {
2189
2194
  // Install the plugins without globs, so they can be configured separately.
2190
2195
  name: "vinicunca/typescript/setup",
2191
2196
  plugins: {
2192
- ts: pluginTs,
2193
- vinicunca: default2
2197
+ antfu: default2,
2198
+ ts: pluginTs
2194
2199
  }
2195
2200
  },
2196
2201
  // assign type-aware parser for type-aware files and type-unaware parser for the rest
@@ -2294,7 +2299,7 @@ async function unicorn() {
2294
2299
  {
2295
2300
  name: "vinicunca/unicorn/rules",
2296
2301
  plugins: {
2297
- unicorn: default6
2302
+ unicorn: default7
2298
2303
  },
2299
2304
  rules: {
2300
2305
  "unicorn/error-message": ERROR,
@@ -2579,6 +2584,7 @@ var defaultPluginRenaming = {
2579
2584
  "@typescript-eslint": "ts",
2580
2585
  "import-x": "import",
2581
2586
  "n": "node",
2587
+ "sonarjs": "sonar",
2582
2588
  "vitest": "test",
2583
2589
  "yml": "yaml"
2584
2590
  };
@@ -2625,7 +2631,8 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2625
2631
  }),
2626
2632
  imports(),
2627
2633
  unicorn(),
2628
- perfectionist()
2634
+ perfectionist(),
2635
+ sonar()
2629
2636
  );
2630
2637
  if (enableVue) {
2631
2638
  componentExts.push("vue");
@@ -2712,15 +2719,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2712
2719
  configs.push([fusedConfig]);
2713
2720
  }
2714
2721
  ;
2715
- let pipeline = new FlatConfigComposer();
2716
- pipeline = pipeline.append(
2722
+ let composer = new FlatConfigComposer();
2723
+ composer = composer.append(
2717
2724
  ...configs,
2718
2725
  ...userConfigs
2719
2726
  );
2720
2727
  if (autoRenamePlugins) {
2721
- pipeline = pipeline.renamePlugins(defaultPluginRenaming);
2728
+ composer = composer.renamePlugins(defaultPluginRenaming);
2722
2729
  }
2723
- return pipeline;
2730
+ return composer;
2724
2731
  }
2725
2732
  function getOverrides(options, key) {
2726
2733
  const sub = resolveSubOptions(options, key);
@@ -2770,16 +2777,18 @@ export {
2770
2777
  node,
2771
2778
  parserPlain,
2772
2779
  perfectionist,
2780
+ default2 as pluginAntfu,
2773
2781
  default3 as pluginComments,
2774
2782
  pluginImport,
2775
2783
  default4 as pluginNode,
2776
2784
  default5 as pluginPerfectionist,
2777
- default6 as pluginUnicorn,
2778
- default7 as pluginUnusedImports,
2779
- default2 as pluginVinicunca,
2785
+ default6 as pluginSonar,
2786
+ default7 as pluginUnicorn,
2787
+ default8 as pluginUnusedImports,
2780
2788
  react,
2781
2789
  renamePluginInConfigs,
2782
2790
  renameRules,
2791
+ sonar,
2783
2792
  sortPackageJson,
2784
2793
  sortTsconfig,
2785
2794
  stylistic,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vinicunca/eslint-config",
3
3
  "type": "module",
4
- "version": "2.4.3",
4
+ "version": "2.5.0",
5
5
  "description": "Vinicunca ESLint config",
6
6
  "author": {
7
7
  "name": "praburangki",
@@ -58,48 +58,48 @@
58
58
  "eslint": ">=8.57.0"
59
59
  },
60
60
  "dependencies": {
61
- "@stylistic/eslint-plugin": "^1.7.0",
62
- "@typescript-eslint/eslint-plugin": "^7.5.0",
63
- "@typescript-eslint/parser": "^7.5.0",
64
- "@unocss/eslint-plugin": "^0.58.9",
65
- "@vinicunca/eslint-plugin-vinicunca": "^1.0.10",
61
+ "@stylistic/eslint-plugin": "^2.1.0",
62
+ "@typescript-eslint/eslint-plugin": "^7.8.0",
63
+ "@typescript-eslint/parser": "^7.8.0",
64
+ "@unocss/eslint-plugin": "^0.60.0",
66
65
  "eslint-config-flat-gitignore": "^0.1.5",
67
- "eslint-flat-config-utils": "^0.2.0",
66
+ "eslint-flat-config-utils": "^0.2.4",
68
67
  "eslint-merge-processors": "^0.1.0",
68
+ "eslint-plugin-antfu": "^2.2.0",
69
69
  "eslint-plugin-eslint-comments": "^3.2.0",
70
- "eslint-plugin-format": "^0.1.0",
70
+ "eslint-plugin-format": "^0.1.1",
71
71
  "eslint-plugin-import-x": "^0.5.0",
72
- "eslint-plugin-jsdoc": "^48.2.2",
73
- "eslint-plugin-jsonc": "^2.15.0",
74
- "eslint-plugin-markdown": "^4.0.1",
75
- "eslint-plugin-n": "^16.6.2",
72
+ "eslint-plugin-jsdoc": "^48.2.4",
73
+ "eslint-plugin-jsonc": "^2.15.1",
74
+ "eslint-plugin-markdown": "^5.0.0",
75
+ "eslint-plugin-n": "^17.6.0",
76
76
  "eslint-plugin-no-only-tests": "^3.1.0",
77
- "eslint-plugin-perfectionist": "^2.7.0",
77
+ "eslint-plugin-perfectionist": "^2.10.0",
78
78
  "eslint-plugin-react": "^7.34.1",
79
- "eslint-plugin-react-hooks": "^4.6.0",
80
- "eslint-plugin-unicorn": "^51.0.1",
81
- "eslint-plugin-unused-imports": "^3.1.0",
82
- "eslint-plugin-vitest": "^0.4.1",
83
- "eslint-plugin-vue": "^9.24.0",
79
+ "eslint-plugin-react-hooks": "^4.6.2",
80
+ "eslint-plugin-sonarjs": "^1.0.3",
81
+ "eslint-plugin-unicorn": "^53.0.0",
82
+ "eslint-plugin-unused-imports": "^3.2.0",
83
+ "eslint-plugin-vitest": "^0.5.4",
84
+ "eslint-plugin-vue": "^9.26.0",
84
85
  "eslint-plugin-yml": "^1.14.0",
85
- "eslint-processor-vue-blocks": "^0.1.1",
86
- "eslint-typegen": "^0.2.0",
87
- "globals": "^15.0.0",
86
+ "eslint-processor-vue-blocks": "^0.1.2",
87
+ "globals": "^15.2.0",
88
88
  "jsonc-eslint-parser": "^2.4.0",
89
89
  "local-pkg": "^0.5.0",
90
90
  "vue-eslint-parser": "^9.4.2",
91
91
  "yaml-eslint-parser": "^1.2.2"
92
92
  },
93
93
  "devDependencies": {
94
- "@eslint-stylistic/metadata": "^1.7.0",
95
- "@types/eslint": "^8.56.7",
94
+ "@types/eslint": "^8.56.10",
96
95
  "@types/fs-extra": "^11.0.4",
97
- "execa": "^8.0.1",
96
+ "eslint-typegen": "^0.2.4",
97
+ "execa": "^9.0.2",
98
98
  "fast-glob": "^3.3.2",
99
99
  "fs-extra": "^11.2.0",
100
- "react": "^18.2.0",
100
+ "react": "^18.3.1",
101
101
  "tsup": "^8.0.2",
102
- "vue": "^3.4.21"
102
+ "vue": "^3.4.27"
103
103
  },
104
104
  "scripts": {
105
105
  "lint": "eslint -v",