@jsse/eslint-config 0.2.10 → 0.2.12

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
@@ -9832,86 +9832,6 @@ function resolvePackage(name, options = {}) {
9832
9832
  }
9833
9833
  }
9834
9834
 
9835
- // src/lager.ts
9836
- var levels = {
9837
- trace: 10,
9838
- debug: 20,
9839
- info: 30,
9840
- warn: 40,
9841
- error: 50,
9842
- fatal: 60
9843
- };
9844
- function isLagerLevel(level) {
9845
- return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
9846
- }
9847
- var Lager = class {
9848
- _level = "info";
9849
- id = "lager";
9850
- levelNo = levels[this._level];
9851
- prefix = "";
9852
- constructor(options) {
9853
- const { level, id, prefix } = {
9854
- level: "info",
9855
- id: "lager",
9856
- prefix: "@jsse/eslint-config",
9857
- ...options
9858
- };
9859
- this.id = id;
9860
- this._level = isLagerLevel(level) ? level : "info";
9861
- this.levelNo = levels[this._level];
9862
- this.prefix = prefix;
9863
- this.log = this.log.bind(this);
9864
- this.debug = this.debug.bind(this);
9865
- }
9866
- get level() {
9867
- return this._level;
9868
- }
9869
- set level(level) {
9870
- this._level = level;
9871
- this.levelNo = levels[level];
9872
- }
9873
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9874
- log(...args) {
9875
- console.log(...args);
9876
- }
9877
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9878
- trace(...args) {
9879
- if (this.levelNo > levels.trace) {
9880
- return;
9881
- }
9882
- console.trace(...args);
9883
- }
9884
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9885
- debug(...args) {
9886
- if (this.levelNo > levels.debug) {
9887
- return;
9888
- }
9889
- console.debug(...args);
9890
- }
9891
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9892
- info(...args) {
9893
- if (this.levelNo > levels.info) {
9894
- return;
9895
- }
9896
- console.info("[@jsse/eslint-config]", ...args);
9897
- }
9898
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9899
- warn(...args) {
9900
- if (this.levelNo > levels.warn) {
9901
- return;
9902
- }
9903
- console.warn(...args);
9904
- }
9905
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9906
- error(...args) {
9907
- if (this.levelNo > levels.error) {
9908
- return;
9909
- }
9910
- console.error(...args);
9911
- }
9912
- };
9913
- var log = new Lager();
9914
-
9915
9835
  // src/globs.ts
9916
9836
  var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
9917
9837
  var GLOB_JS_SRC_EXT = "?([cm])js?(x)";
@@ -9929,8 +9849,10 @@ var GLOB_JSON5 = "**/*.json5";
9929
9849
  var GLOB_JSONC = "**/*.jsonc";
9930
9850
  var GLOB_TOML = "**/*.toml";
9931
9851
  var GLOB_MARKDOWN = "**/*.md";
9852
+ var GLOB_GRAPHQL = ["**/*.graphql", "**/*.gql"];
9932
9853
  var GLOB_YAML = "**/*.y?(a)ml";
9933
9854
  var GLOB_HTML = "**/*.htm?(l)";
9855
+ var GLOB_TSCONFIG = ["**/tsconfig.json", "**/tsconfig.*.json"];
9934
9856
  var GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
9935
9857
  var GLOB_TESTS = [
9936
9858
  `**/__tests__/**/*.${GLOB_SRC_EXT}`,
@@ -10019,17 +9941,30 @@ function isCI() {
10019
9941
  function isInEditor() {
10020
9942
  return !!((process3.env.VSCODE_PID || process3.env.JETBRAINS_IDE) && !isCI());
10021
9943
  }
9944
+ function uniqueStrings(...strings) {
9945
+ const set = /* @__PURE__ */ new Set();
9946
+ for (const item of strings) {
9947
+ if (typeof item === "string") {
9948
+ set.add(item);
9949
+ } else {
9950
+ for (const str of item) {
9951
+ set.add(str);
9952
+ }
9953
+ }
9954
+ }
9955
+ return [...set];
9956
+ }
10022
9957
 
10023
9958
  // src/plugins.ts
10024
- import { default as default2 } from "eslint-plugin-antfu";
10025
- import { default as default3 } from "eslint-plugin-eslint-comments";
10026
- import * as pluginImport from "eslint-plugin-import-x";
10027
- import { default as default4 } from "eslint-plugin-n";
10028
- import { default as default5 } from "eslint-plugin-perfectionist";
10029
- import { default as default6 } from "eslint-plugin-unicorn";
10030
- import { default as default7 } from "eslint-plugin-unused-imports";
10031
- import { default as default8 } from "@typescript-eslint/eslint-plugin";
9959
+ import { default as default2 } from "@typescript-eslint/eslint-plugin";
10032
9960
  import * as parserTs from "@typescript-eslint/parser";
9961
+ import { default as default3 } from "eslint-plugin-antfu";
9962
+ import { default as default4 } from "eslint-plugin-eslint-comments";
9963
+ import * as pluginImport from "eslint-plugin-import-x";
9964
+ import { default as default5 } from "eslint-plugin-n";
9965
+ import { default as default6 } from "eslint-plugin-perfectionist";
9966
+ import { default as default7 } from "eslint-plugin-unicorn";
9967
+ import { default as default8 } from "eslint-plugin-unused-imports";
10033
9968
  async function importPluginReact() {
10034
9969
  const pluginReact = await interopDefault2(import("eslint-plugin-react"));
10035
9970
  return {
@@ -10125,7 +10060,7 @@ var antfu = async () => {
10125
10060
  {
10126
10061
  name: "jsse/antfu",
10127
10062
  plugins: {
10128
- antfu: default2
10063
+ antfu: default3
10129
10064
  },
10130
10065
  // @ts-expect-error - antfu plugin types err
10131
10066
  rules: {
@@ -10158,7 +10093,7 @@ var comments = async () => [
10158
10093
  name: "jsse/eslint-comments",
10159
10094
  plugins: {
10160
10095
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10161
- "eslint-comments": default3
10096
+ "eslint-comments": default4
10162
10097
  },
10163
10098
  rules: {
10164
10099
  "eslint-comments/no-aggregating-enable": "error",
@@ -10194,7 +10129,7 @@ var imports = async (options) => {
10194
10129
  "import/no-named-default": "error",
10195
10130
  "import/no-self-import": "error",
10196
10131
  "import/no-webpack-loader-syntax": "error",
10197
- "import/order": "error",
10132
+ "import/order": "off",
10198
10133
  ...stylistic2 ? {
10199
10134
  "import/newline-after-import": [
10200
10135
  "error",
@@ -10242,7 +10177,7 @@ var javascript = async (options) => {
10242
10177
  name: "jsse/javascript",
10243
10178
  plugins: {
10244
10179
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10245
- "unused-imports": default7
10180
+ "unused-imports": default8
10246
10181
  },
10247
10182
  rules: {
10248
10183
  ...eslintjs.configs.recommended.rules,
@@ -11104,7 +11039,7 @@ var n = async () => {
11104
11039
  {
11105
11040
  name: "jsse/n",
11106
11041
  plugins: {
11107
- n: default4
11042
+ n: default5
11108
11043
  },
11109
11044
  rules: {
11110
11045
  "n/handle-callback-err": ["error", "^(err|error)$"],
@@ -11154,7 +11089,50 @@ var perfectionist = async () => {
11154
11089
  name: "jsse/perfectionist",
11155
11090
  plugins: {
11156
11091
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11157
- perfectionist: default5
11092
+ perfectionist: default6
11093
+ },
11094
+ rules: {
11095
+ "perfectionist/sort-exports": [
11096
+ "error",
11097
+ { order: "asc", type: "natural" }
11098
+ ],
11099
+ "perfectionist/sort-imports": [
11100
+ "error",
11101
+ {
11102
+ customGroups: {
11103
+ type: {
11104
+ react: ["react", "react-*"]
11105
+ },
11106
+ value: {
11107
+ react: ["react", "react-*"]
11108
+ }
11109
+ },
11110
+ groups: [
11111
+ "react",
11112
+ // react and react-* packages come first if they exist
11113
+ "type",
11114
+ "builtin",
11115
+ "external",
11116
+ "internal-type",
11117
+ "internal",
11118
+ ["parent-type", "sibling-type", "index-type"],
11119
+ ["parent", "sibling", "index"],
11120
+ "object",
11121
+ "unknown"
11122
+ ],
11123
+ newlinesBetween: "ignore",
11124
+ order: "asc",
11125
+ type: "natural"
11126
+ }
11127
+ ],
11128
+ "perfectionist/sort-named-exports": [
11129
+ "error",
11130
+ { order: "asc", type: "natural" }
11131
+ ],
11132
+ "perfectionist/sort-named-imports": [
11133
+ "error",
11134
+ { order: "asc", type: "natural" }
11135
+ ]
11158
11136
  }
11159
11137
  }
11160
11138
  ];
@@ -11662,10 +11640,13 @@ var sortPackageJson = async () => {
11662
11640
  };
11663
11641
 
11664
11642
  // src/configs/sort-tsconfig.ts
11665
- var sortTsconfig = async () => {
11643
+ var tsconfigGlobs = (extendGlobs) => {
11644
+ return extendGlobs === void 0 || extendGlobs.length === 0 ? GLOB_TSCONFIG : uniqueStrings(GLOB_TSCONFIG, extendGlobs);
11645
+ };
11646
+ var sortTsconfig = async (options) => {
11666
11647
  return [
11667
11648
  {
11668
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
11649
+ files: tsconfigGlobs(options?.extendTsconfigGlobs),
11669
11650
  name: "jsse/sort/tsconfig",
11670
11651
  rules: {
11671
11652
  "jsonc/sort-keys": [
@@ -11980,9 +11961,9 @@ var typescript = async (options) => {
11980
11961
  const tsPrefixTo = prefix?.to ?? "@typescript-eslint";
11981
11962
  const tsRules = {
11982
11963
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11983
- ...(default8.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
11964
+ ...(default2.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
11984
11965
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11985
- ...default8.configs.strict?.rules,
11966
+ ...default2.configs.strict?.rules,
11986
11967
  "no-invalid-this": "off",
11987
11968
  ...typescriptRules({
11988
11969
  typeAware: false
@@ -11995,7 +11976,7 @@ var typescript = async (options) => {
11995
11976
  name: "jsse/typescript/setup",
11996
11977
  plugins: {
11997
11978
  import: pluginImport,
11998
- [tsPrefixTo]: default8
11979
+ [tsPrefixTo]: default2
11999
11980
  }
12000
11981
  },
12001
11982
  ...parserConfigs,
@@ -12074,7 +12055,6 @@ function unicornOff() {
12074
12055
  return {
12075
12056
  "unicorn/catch-error-name": "off",
12076
12057
  "unicorn/consistent-destructuring": "off",
12077
- // "unicorn/no-array-for-each": "off",
12078
12058
  "unicorn/no-array-reduce": "off",
12079
12059
  "unicorn/no-nested-ternary": "off",
12080
12060
  // conflicts with prettier
@@ -12087,7 +12067,7 @@ function unicornOff() {
12087
12067
  };
12088
12068
  }
12089
12069
  function unicornRecommended() {
12090
- const rules = default6.configs.recommended.rules;
12070
+ const rules = default7.configs.recommended.rules;
12091
12071
  if (rules === void 0) {
12092
12072
  throw new Error("Expected rules to be defined in unicorn plugin");
12093
12073
  }
@@ -12099,7 +12079,7 @@ var unicorn = async () => {
12099
12079
  name: "jsse/unicorn",
12100
12080
  plugins: {
12101
12081
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12102
- unicorn: default6
12082
+ unicorn: default7
12103
12083
  },
12104
12084
  rules: {
12105
12085
  ...unicornRecommended(),
@@ -12188,7 +12168,7 @@ var unicorn = async () => {
12188
12168
  // src/configs/vitest.ts
12189
12169
  var vitest = async (options = {}) => {
12190
12170
  const { overrides = {} } = options;
12191
- const pluginVitest = await interopDefault2(import("eslint-plugin-vitest"));
12171
+ const pluginVitest = await interopDefault2(import("@vitest/eslint-plugin"));
12192
12172
  return [
12193
12173
  {
12194
12174
  name: "jsse/vitest/setup",
@@ -12267,6 +12247,86 @@ var yml = async (options) => {
12267
12247
  ];
12268
12248
  };
12269
12249
 
12250
+ // src/lager.ts
12251
+ var levels = {
12252
+ trace: 10,
12253
+ debug: 20,
12254
+ info: 30,
12255
+ warn: 40,
12256
+ error: 50,
12257
+ fatal: 60
12258
+ };
12259
+ function isLagerLevel(level) {
12260
+ return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
12261
+ }
12262
+ var Lager = class {
12263
+ _level = "info";
12264
+ id = "lager";
12265
+ levelNo = levels[this._level];
12266
+ prefix = "";
12267
+ constructor(options) {
12268
+ const { level, id, prefix } = {
12269
+ level: "info",
12270
+ id: "lager",
12271
+ prefix: "@jsse/eslint-config",
12272
+ ...options
12273
+ };
12274
+ this.id = id;
12275
+ this._level = isLagerLevel(level) ? level : "info";
12276
+ this.levelNo = levels[this._level];
12277
+ this.prefix = prefix;
12278
+ this.log = this.log.bind(this);
12279
+ this.debug = this.debug.bind(this);
12280
+ }
12281
+ get level() {
12282
+ return this._level;
12283
+ }
12284
+ set level(level) {
12285
+ this._level = level;
12286
+ this.levelNo = levels[level];
12287
+ }
12288
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12289
+ log(...args) {
12290
+ console.log(...args);
12291
+ }
12292
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12293
+ trace(...args) {
12294
+ if (this.levelNo > levels.trace) {
12295
+ return;
12296
+ }
12297
+ console.trace(...args);
12298
+ }
12299
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12300
+ debug(...args) {
12301
+ if (this.levelNo > levels.debug) {
12302
+ return;
12303
+ }
12304
+ console.debug(...args);
12305
+ }
12306
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12307
+ info(...args) {
12308
+ if (this.levelNo > levels.info) {
12309
+ return;
12310
+ }
12311
+ console.info("[@jsse/eslint-config]", ...args);
12312
+ }
12313
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12314
+ warn(...args) {
12315
+ if (this.levelNo > levels.warn) {
12316
+ return;
12317
+ }
12318
+ console.warn(...args);
12319
+ }
12320
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12321
+ error(...args) {
12322
+ if (this.levelNo > levels.error) {
12323
+ return;
12324
+ }
12325
+ console.error(...args);
12326
+ }
12327
+ };
12328
+ var log = new Lager();
12329
+
12270
12330
  // src/slow.ts
12271
12331
  var slowRules = [
12272
12332
  "@typescript-eslint/no-misused-promises",
@@ -12448,7 +12508,9 @@ async function jsse(options = {}, ...userConfigs) {
12448
12508
  stylistic: stylisticOptions
12449
12509
  }),
12450
12510
  sortPackageJson(),
12451
- sortTsconfig()
12511
+ sortTsconfig({
12512
+ extendTsconfigGlobs: normalizedOptions.extendTsconfigLintGlobs
12513
+ })
12452
12514
  );
12453
12515
  }
12454
12516
  if (normalizedOptions.tailwind) {
@@ -12563,6 +12625,7 @@ export {
12563
12625
  GLOB_ALL_SRC,
12564
12626
  GLOB_CSS,
12565
12627
  GLOB_EXCLUDE,
12628
+ GLOB_GRAPHQL,
12566
12629
  GLOB_HTML,
12567
12630
  GLOB_JS,
12568
12631
  GLOB_JSON,
@@ -12580,6 +12643,7 @@ export {
12580
12643
  GLOB_TESTS,
12581
12644
  GLOB_TOML,
12582
12645
  GLOB_TS,
12646
+ GLOB_TSCONFIG,
12583
12647
  GLOB_TSX,
12584
12648
  GLOB_YAML,
12585
12649
  combine,
@@ -12605,13 +12669,14 @@ export {
12605
12669
  jsseReact,
12606
12670
  jssestd,
12607
12671
  parserTs,
12608
- default2 as pluginAntfu,
12609
- default3 as pluginEslintComments,
12672
+ default3 as pluginAntfu,
12673
+ default4 as pluginEslintComments,
12610
12674
  pluginImport,
12611
- default4 as pluginN,
12612
- default5 as pluginPerfectionist,
12613
- default8 as pluginTs,
12614
- default6 as pluginUnicorn,
12615
- default7 as pluginUnusedImports,
12616
- renameRules
12675
+ default5 as pluginN,
12676
+ default6 as pluginPerfectionist,
12677
+ default2 as pluginTs,
12678
+ default7 as pluginUnicorn,
12679
+ default8 as pluginUnusedImports,
12680
+ renameRules,
12681
+ uniqueStrings
12617
12682
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jsse/eslint-config",
3
3
  "type": "module",
4
- "version": "0.2.10",
4
+ "version": "0.2.12",
5
5
  "description": "@jsse/eslint-config ~ WYSIWYG",
6
6
  "author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
7
7
  "license": "MIT",
@@ -30,7 +30,8 @@
30
30
  "dist"
31
31
  ],
32
32
  "peerDependencies": {
33
- "eslint": ">=8.40.0",
33
+ "@eslint-react/eslint-plugin": "^1.5.8",
34
+ "eslint": "^9.10.0",
34
35
  "eslint-plugin-react": "^7.33.2",
35
36
  "eslint-plugin-react-hooks": "^4.6.0",
36
37
  "eslint-plugin-react-refresh": "^0.4.4",
@@ -59,15 +60,17 @@
59
60
  },
60
61
  "dependencies": {
61
62
  "@eslint/js": "~9.10.0",
63
+ "@eslint/markdown": "^6.1.0",
62
64
  "@stylistic/eslint-plugin": "2.8.0",
63
65
  "@typescript-eslint/eslint-plugin": "^8.6.0",
64
66
  "@typescript-eslint/parser": "^8.6.0",
67
+ "@vitest/eslint-plugin": "^1.1.4",
65
68
  "eslint-config-flat-gitignore": "^0.3.0",
66
69
  "eslint-define-config": "^2.1.0",
67
- "eslint-plugin-antfu": "^2.6.0",
70
+ "eslint-plugin-antfu": "^2.7.0",
68
71
  "eslint-plugin-eslint-comments": "^3.2.0",
69
72
  "eslint-plugin-import-x": "^4.2.1",
70
- "eslint-plugin-jsdoc": "^50.2.3",
73
+ "eslint-plugin-jsdoc": "^50.2.4",
71
74
  "eslint-plugin-jsonc": "^2.16.0",
72
75
  "eslint-plugin-markdown": "^5.1.0",
73
76
  "eslint-plugin-n": "^17.10.3",
@@ -80,7 +83,6 @@
80
83
  "eslint-plugin-tsdoc": "^0.3.0",
81
84
  "eslint-plugin-unicorn": "^55.0.0",
82
85
  "eslint-plugin-unused-imports": "^4.1.4",
83
- "eslint-plugin-vitest": "0.5.4",
84
86
  "eslint-plugin-yml": "^1.14.0",
85
87
  "jsonc-eslint-parser": "^2.4.0",
86
88
  "picocolors": "^1.1.0",
@@ -89,7 +91,7 @@
89
91
  "yaml-eslint-parser": "^1.2.3"
90
92
  },
91
93
  "devDependencies": {
92
- "@biomejs/biome": "1.9.1",
94
+ "@biomejs/biome": "1.9.2",
93
95
  "@changesets/cli": "^2.27.8",
94
96
  "@jsse/prettier-config": "^0.1.0",
95
97
  "@types/eslint": "^9.6.1",