@jsse/eslint-config 0.2.16 → 0.2.17

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
@@ -2971,6 +2971,16 @@ var require_globals2 = __commonJS({
2971
2971
  }
2972
2972
  });
2973
2973
 
2974
+ // src/const.ts
2975
+ var SLOW_RULES = [
2976
+ "@typescript-eslint/no-misused-promises",
2977
+ "@typescript-eslint/no-unsafe-assignment",
2978
+ "@typescript-eslint/no-unsafe-call",
2979
+ "@typescript-eslint/no-unsafe-member-access",
2980
+ "@typescript-eslint/no-unsafe-return",
2981
+ "unicorn/no-unnecessary-polyfills"
2982
+ ];
2983
+
2974
2984
  // src/factory.ts
2975
2985
  import fs2 from "node:fs";
2976
2986
  import process6 from "node:process";
@@ -10108,7 +10118,8 @@ var comments = async () => [
10108
10118
  var ignores = async () => {
10109
10119
  return [
10110
10120
  {
10111
- ignores: GLOB_EXCLUDE
10121
+ ignores: GLOB_EXCLUDE,
10122
+ name: "jsse/ignores"
10112
10123
  }
10113
10124
  ];
10114
10125
  };
@@ -11268,6 +11279,9 @@ var prettier = async () => {
11268
11279
  ];
11269
11280
  };
11270
11281
 
11282
+ // src/configs/react.ts
11283
+ import { fixupPluginRules } from "@eslint/compat";
11284
+
11271
11285
  // src/configs/ts/typescript-language-options.ts
11272
11286
  import process4 from "node:process";
11273
11287
  function typescriptLanguageOptions(options) {
@@ -11463,24 +11477,6 @@ function reactRules() {
11463
11477
  "react/void-dom-elements-no-children": "error"
11464
11478
  };
11465
11479
  }
11466
- function reactRefreshFlatConfigRules() {
11467
- return [
11468
- {
11469
- files: [GLOB_SRC],
11470
- name: "jsse/react/refresh",
11471
- rules: {
11472
- "react-refresh/only-export-components": "error"
11473
- }
11474
- },
11475
- {
11476
- files: ["**/*.stories.tsx"],
11477
- name: "jsse/react:refresh/stories",
11478
- rules: {
11479
- "react-refresh/only-export-components": "off"
11480
- }
11481
- }
11482
- ];
11483
- }
11484
11480
  function reactRecomendedRules() {
11485
11481
  return {
11486
11482
  "react/display-name": 2,
@@ -11532,13 +11528,14 @@ var react = async (options) => {
11532
11528
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11533
11529
  react: pluginReact,
11534
11530
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11535
- "react-hooks": pluginReactHooks,
11531
+ "react-hooks": fixupPluginRules(pluginReactHooks),
11536
11532
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11537
11533
  "react-refresh": pluginReactRefresh
11538
11534
  }
11539
11535
  },
11540
11536
  {
11541
11537
  files: [GLOB_SRC],
11538
+ name: "jsse/react/rules",
11542
11539
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11543
11540
  rules: {
11544
11541
  ...reactRecomendedRules(),
@@ -11551,10 +11548,39 @@ var react = async (options) => {
11551
11548
  version: "detect"
11552
11549
  }
11553
11550
  }
11551
+ },
11552
+ {
11553
+ files: [GLOB_SRC],
11554
+ name: "jsse/react-hooks/rules",
11555
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11556
+ rules: {
11557
+ "react-hooks/exhaustive-deps": "error",
11558
+ "react-hooks/rules-of-hooks": "error"
11559
+ },
11560
+ settings: {
11561
+ react: {
11562
+ version: "detect"
11563
+ }
11564
+ }
11554
11565
  }
11555
11566
  ];
11556
11567
  if (reactRefresh) {
11557
- config.push(...reactRefreshFlatConfigRules());
11568
+ config.push(
11569
+ {
11570
+ files: [GLOB_SRC],
11571
+ name: "jsse/react/refresh",
11572
+ rules: {
11573
+ "react-refresh/only-export-components": "error"
11574
+ }
11575
+ },
11576
+ {
11577
+ files: ["**/*.stories.tsx"],
11578
+ name: "jsse/react-refresh/stories",
11579
+ rules: {
11580
+ "react-refresh/only-export-components": "off"
11581
+ }
11582
+ }
11583
+ );
11558
11584
  }
11559
11585
  return config;
11560
11586
  };
@@ -11872,6 +11898,7 @@ function typescriptParser(options) {
11872
11898
  componentExts = [],
11873
11899
  filesTypeAware: files = [GLOB_TS, GLOB_TSX],
11874
11900
  ignoresTypeAware: ignores2 = [GLOB_MARKDOWN],
11901
+ name,
11875
11902
  parserOptions: parserOptionsOverride = {},
11876
11903
  react: react2,
11877
11904
  tsconfig,
@@ -11899,7 +11926,7 @@ function typescriptParser(options) {
11899
11926
  ...parserOptionsOverride
11900
11927
  }
11901
11928
  },
11902
- name: `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`
11929
+ name: name ?? `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`
11903
11930
  };
11904
11931
  }
11905
11932
  return {
@@ -11919,7 +11946,7 @@ function typescriptParser(options) {
11919
11946
  ...parserOptionsOverride
11920
11947
  }
11921
11948
  },
11922
- name: `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`
11949
+ name: name ?? `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`
11923
11950
  };
11924
11951
  }
11925
11952
 
@@ -12224,7 +12251,7 @@ var yml = async (options) => {
12224
12251
  languageOptions: {
12225
12252
  parser: parserYaml
12226
12253
  },
12227
- name: "antfu:yaml/rules",
12254
+ name: "jsse/yaml/rules",
12228
12255
  rules: {
12229
12256
  "style/spaced-comment": "off",
12230
12257
  "yaml/block-mapping": "error",
@@ -12333,15 +12360,6 @@ var Lager = class {
12333
12360
  };
12334
12361
  var log = new Lager();
12335
12362
 
12336
- // src/slow.ts
12337
- var slowRules = [
12338
- "@typescript-eslint/no-misused-promises",
12339
- "@typescript-eslint/no-unsafe-assignment",
12340
- "@typescript-eslint/no-unsafe-call",
12341
- "@typescript-eslint/no-unsafe-member-access",
12342
- "@typescript-eslint/no-unsafe-return"
12343
- ];
12344
-
12345
12363
  // src/factory.ts
12346
12364
  var flatConfigProps = [
12347
12365
  "files",
@@ -12379,7 +12397,7 @@ function normalizeOptions(options = {}) {
12379
12397
  const off = [
12380
12398
  .../* @__PURE__ */ new Set([
12381
12399
  ...options.off ?? [],
12382
- ...options.fast ? [...slowRules] : []
12400
+ ...options.fast ? [...SLOW_RULES] : []
12383
12401
  ])
12384
12402
  ].sort(
12385
12403
  (a, b) => a.localeCompare(b, void 0, { numeric: true, sensitivity: "base" })
@@ -12575,21 +12593,6 @@ async function jsse(options = {}, ...userConfigs) {
12575
12593
  }
12576
12594
  }
12577
12595
  }
12578
- if (normalizedOptions.preReturn) {
12579
- log.debug("Running preReturn");
12580
- const preReturned = normalizedOptions.preReturn(combinedConfigs);
12581
- if (preReturned instanceof Promise) {
12582
- const res = await preReturned;
12583
- log.debug("preReturn finished");
12584
- log.debug("final config", res);
12585
- return res;
12586
- } else {
12587
- const res = preReturned;
12588
- log.debug("preReturn finished");
12589
- log.debug("final config", res);
12590
- return res;
12591
- }
12592
- }
12593
12596
  for (const config of combinedConfigs) {
12594
12597
  if (config.plugins) {
12595
12598
  for (const [key, value] of Object.entries(config.plugins)) {
@@ -12608,6 +12611,21 @@ async function jsse(options = {}, ...userConfigs) {
12608
12611
  }
12609
12612
  }
12610
12613
  }
12614
+ if (normalizedOptions.preReturn) {
12615
+ log.debug("Running preReturn");
12616
+ const preReturned = normalizedOptions.preReturn(combinedConfigs);
12617
+ if (preReturned instanceof Promise) {
12618
+ const res = await preReturned;
12619
+ log.debug("preReturn finished");
12620
+ log.debug("final config", res);
12621
+ return res;
12622
+ } else {
12623
+ const res = preReturned;
12624
+ log.debug("preReturn finished");
12625
+ log.debug("final config", res);
12626
+ return res;
12627
+ }
12628
+ }
12611
12629
  return combinedConfigs;
12612
12630
  }
12613
12631
 
@@ -12652,6 +12670,7 @@ export {
12652
12670
  GLOB_TSCONFIG,
12653
12671
  GLOB_TSX,
12654
12672
  GLOB_YAML,
12673
+ SLOW_RULES,
12655
12674
  combine,
12656
12675
  combineAsync,
12657
12676
  jsse as default,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jsse/eslint-config",
3
3
  "type": "module",
4
- "version": "0.2.16",
4
+ "version": "0.2.17",
5
5
  "description": "@jsse/eslint-config ~ WYSIWYG",
6
6
  "author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
7
7
  "license": "MIT",
@@ -59,7 +59,8 @@
59
59
  }
60
60
  },
61
61
  "dependencies": {
62
- "@eslint/js": "~9.10.0",
62
+ "@eslint/compat": "^1.1.1",
63
+ "@eslint/js": "~9.11.0",
63
64
  "@eslint/markdown": "^6.1.0",
64
65
  "@stylistic/eslint-plugin": "2.8.0",
65
66
  "@typescript-eslint/eslint-plugin": "^8.6.0",
@@ -123,7 +124,7 @@
123
124
  "build-fast": "tsup src/index.ts src/cli.ts --format esm,cjs --clean",
124
125
  "gen": "tsx scripts/gen.ts && prettier -w src",
125
126
  "dev": "tsup src/index.ts --format esm,cjs --watch",
126
- "fmt": "prettier -w --cache .",
127
+ "fmt": "prettier -w .",
127
128
  "fmtc": "prettier --check .",
128
129
  "lint": "pnpm run build-fast && eslint .",
129
130
  "change": "changeset",