@vinicunca/eslint-config 2.4.4 → 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.cjs CHANGED
@@ -68,16 +68,18 @@ __export(src_exports, {
68
68
  node: () => node,
69
69
  parserPlain: () => parserPlain,
70
70
  perfectionist: () => perfectionist,
71
+ pluginAntfu: () => import_eslint_plugin_antfu.default,
71
72
  pluginComments: () => import_eslint_plugin_eslint_comments.default,
72
73
  pluginImport: () => pluginImport,
73
74
  pluginNode: () => import_eslint_plugin_n.default,
74
75
  pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
76
+ pluginSonar: () => import_eslint_plugin_sonarjs.default,
75
77
  pluginUnicorn: () => import_eslint_plugin_unicorn.default,
76
78
  pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
77
- pluginVinicunca: () => import_eslint_plugin_vinicunca.default,
78
79
  react: () => react,
79
80
  renamePluginInConfigs: () => renamePluginInConfigs,
80
81
  renameRules: () => renameRules,
82
+ sonar: () => sonar,
81
83
  sortPackageJson: () => sortPackageJson,
82
84
  sortTsconfig: () => sortTsconfig,
83
85
  stylistic: () => stylistic,
@@ -865,11 +867,12 @@ var NEVER = "never";
865
867
  var ALWAYS = "always";
866
868
 
867
869
  // src/plugins.ts
868
- var import_eslint_plugin_vinicunca = __toESM(require("@vinicunca/eslint-plugin-vinicunca"), 1);
870
+ var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
869
871
  var import_eslint_plugin_eslint_comments = __toESM(require("eslint-plugin-eslint-comments"), 1);
870
872
  var pluginImport = __toESM(require("eslint-plugin-import-x"), 1);
871
873
  var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
872
874
  var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
875
+ var import_eslint_plugin_sonarjs = __toESM(require("eslint-plugin-sonarjs"), 1);
873
876
  var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
874
877
  var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
875
878
 
@@ -1056,8 +1059,8 @@ async function stylistic(options = {}) {
1056
1059
  {
1057
1060
  name: "vinicunca/stylistic/rules",
1058
1061
  plugins: {
1059
- style: pluginStylistic,
1060
- vinicunca: import_eslint_plugin_vinicunca.default
1062
+ antfu: import_eslint_plugin_antfu.default,
1063
+ style: pluginStylistic
1061
1064
  },
1062
1065
  rules: {
1063
1066
  ...config.rules,
@@ -1119,17 +1122,8 @@ async function stylistic(options = {}) {
1119
1122
  "style/rest-spread-spacing": [ERROR, NEVER],
1120
1123
  "style/semi": [ERROR, semi ? ALWAYS : NEVER],
1121
1124
  "style/semi-spacing": [ERROR, { after: true, before: false }],
1122
- "vinicunca/consistent-list-newline": ERROR,
1123
- "vinicunca/if-newline": ERROR,
1124
- "vinicunca/top-level-function": ERROR,
1125
1125
  ...overrides
1126
1126
  }
1127
- },
1128
- {
1129
- files: [GLOB_JSX, GLOB_TSX],
1130
- rules: {
1131
- "vinicunca/consistent-list-newline": OFF
1132
- }
1133
1127
  }
1134
1128
  ];
1135
1129
  }
@@ -1310,8 +1304,8 @@ async function imports() {
1310
1304
  {
1311
1305
  name: "vinicunca/imports/rules",
1312
1306
  plugins: {
1313
- import: pluginImport,
1314
- vinicunca: import_eslint_plugin_vinicunca.default
1307
+ antfu: import_eslint_plugin_antfu.default,
1308
+ import: pluginImport
1315
1309
  },
1316
1310
  rules: {
1317
1311
  "import/export": ERROR,
@@ -1326,9 +1320,7 @@ async function imports() {
1326
1320
  "import/no-self-import": ERROR,
1327
1321
  "import/no-webpack-loader-syntax": ERROR,
1328
1322
  // Turned off to avoid conflicts with Perfectionist. https://eslint-plugin-perfectionist.azat.io/rules/sort-imports
1329
- "import/order": OFF,
1330
- "vinicunca/import-dedupe": ERROR,
1331
- "vinicunca/no-import-node-modules-by-path": ERROR
1323
+ "import/order": OFF
1332
1324
  }
1333
1325
  }
1334
1326
  ];
@@ -1367,8 +1359,8 @@ async function javascript(options = {}) {
1367
1359
  },
1368
1360
  name: "vinicunca/javascript/rules",
1369
1361
  plugins: {
1370
- "unused-imports": import_eslint_plugin_unused_imports.default,
1371
- "vinicunca": import_eslint_plugin_vinicunca.default
1362
+ "antfu": import_eslint_plugin_antfu.default,
1363
+ "unused-imports": import_eslint_plugin_unused_imports.default
1372
1364
  },
1373
1365
  rules: {
1374
1366
  "accessor-pairs": [ERROR, {
@@ -1588,7 +1580,6 @@ async function javascript(options = {}) {
1588
1580
  }],
1589
1581
  "vars-on-top": ERROR,
1590
1582
  "yoda": [ERROR, NEVER],
1591
- ...import_eslint_plugin_vinicunca.default.configs.recommended.rules,
1592
1583
  ...overrides
1593
1584
  }
1594
1585
  },
@@ -1806,7 +1797,6 @@ async function markdown(options = {}) {
1806
1797
  "ts/restrict-template-expressions": OFF,
1807
1798
  "ts/unbound-method": OFF
1808
1799
  },
1809
- "vinicunca/no-ts-export-equal": OFF,
1810
1800
  ...overrides
1811
1801
  }
1812
1802
  }
@@ -1945,6 +1935,21 @@ async function react(options = {}) {
1945
1935
  ];
1946
1936
  }
1947
1937
 
1938
+ // src/configs/sonar.ts
1939
+ async function sonar() {
1940
+ return [
1941
+ {
1942
+ name: "vinicunca/sonar/rules",
1943
+ plugins: {
1944
+ sonar: import_eslint_plugin_sonarjs.default
1945
+ },
1946
+ rules: {
1947
+ ...import_eslint_plugin_sonarjs.default.configs.recommended.rules
1948
+ }
1949
+ }
1950
+ ];
1951
+ }
1952
+
1948
1953
  // src/configs/sort-package-json.ts
1949
1954
  async function sortPackageJson() {
1950
1955
  return [
@@ -2285,8 +2290,8 @@ async function typescript(options = {}) {
2285
2290
  // Install the plugins without globs, so they can be configured separately.
2286
2291
  name: "vinicunca/typescript/setup",
2287
2292
  plugins: {
2288
- ts: pluginTs,
2289
- vinicunca: import_eslint_plugin_vinicunca.default
2293
+ antfu: import_eslint_plugin_antfu.default,
2294
+ ts: pluginTs
2290
2295
  }
2291
2296
  },
2292
2297
  // assign type-aware parser for type-aware files and type-unaware parser for the rest
@@ -2675,6 +2680,7 @@ var defaultPluginRenaming = {
2675
2680
  "@typescript-eslint": "ts",
2676
2681
  "import-x": "import",
2677
2682
  "n": "node",
2683
+ "sonarjs": "sonar",
2678
2684
  "vitest": "test",
2679
2685
  "yml": "yaml"
2680
2686
  };
@@ -2721,7 +2727,8 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2721
2727
  }),
2722
2728
  imports(),
2723
2729
  unicorn(),
2724
- perfectionist()
2730
+ perfectionist(),
2731
+ sonar()
2725
2732
  );
2726
2733
  if (enableVue) {
2727
2734
  componentExts.push("vue");
@@ -2808,15 +2815,15 @@ function vinicuncaESLint(options = {}, ...userConfigs) {
2808
2815
  configs.push([fusedConfig]);
2809
2816
  }
2810
2817
  ;
2811
- let pipeline = new import_eslint_flat_config_utils.FlatConfigComposer();
2812
- pipeline = pipeline.append(
2818
+ let composer = new import_eslint_flat_config_utils.FlatConfigComposer();
2819
+ composer = composer.append(
2813
2820
  ...configs,
2814
2821
  ...userConfigs
2815
2822
  );
2816
2823
  if (autoRenamePlugins) {
2817
- pipeline = pipeline.renamePlugins(defaultPluginRenaming);
2824
+ composer = composer.renamePlugins(defaultPluginRenaming);
2818
2825
  }
2819
- return pipeline;
2826
+ return composer;
2820
2827
  }
2821
2828
  function getOverrides(options, key) {
2822
2829
  const sub = resolveSubOptions(options, key);
@@ -2867,16 +2874,18 @@ function resolveSubOptions(options, key) {
2867
2874
  node,
2868
2875
  parserPlain,
2869
2876
  perfectionist,
2877
+ pluginAntfu,
2870
2878
  pluginComments,
2871
2879
  pluginImport,
2872
2880
  pluginNode,
2873
2881
  pluginPerfectionist,
2882
+ pluginSonar,
2874
2883
  pluginUnicorn,
2875
2884
  pluginUnusedImports,
2876
- pluginVinicunca,
2877
2885
  react,
2878
2886
  renamePluginInConfigs,
2879
2887
  renameRules,
2888
+ sonar,
2880
2889
  sortPackageJson,
2881
2890
  sortTsconfig,
2882
2891
  stylistic,