@jsse/eslint-config 0.2.10 → 0.2.11

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,40 @@ 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
+ groups: [
11103
+ "type",
11104
+ "builtin",
11105
+ "external",
11106
+ "internal-type",
11107
+ "internal",
11108
+ ["parent-type", "sibling-type", "index-type"],
11109
+ ["parent", "sibling", "index"],
11110
+ "object",
11111
+ "unknown"
11112
+ ],
11113
+ newlinesBetween: "ignore",
11114
+ order: "asc",
11115
+ type: "natural"
11116
+ }
11117
+ ],
11118
+ "perfectionist/sort-named-exports": [
11119
+ "error",
11120
+ { order: "asc", type: "natural" }
11121
+ ],
11122
+ "perfectionist/sort-named-imports": [
11123
+ "error",
11124
+ { order: "asc", type: "natural" }
11125
+ ]
11158
11126
  }
11159
11127
  }
11160
11128
  ];
@@ -11662,10 +11630,13 @@ var sortPackageJson = async () => {
11662
11630
  };
11663
11631
 
11664
11632
  // src/configs/sort-tsconfig.ts
11665
- var sortTsconfig = async () => {
11633
+ var tsconfigGlobs = (extendGlobs) => {
11634
+ return extendGlobs === void 0 || extendGlobs.length === 0 ? GLOB_TSCONFIG : uniqueStrings(GLOB_TSCONFIG, extendGlobs);
11635
+ };
11636
+ var sortTsconfig = async (options) => {
11666
11637
  return [
11667
11638
  {
11668
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
11639
+ files: tsconfigGlobs(options?.extendTsconfigGlobs),
11669
11640
  name: "jsse/sort/tsconfig",
11670
11641
  rules: {
11671
11642
  "jsonc/sort-keys": [
@@ -11980,9 +11951,9 @@ var typescript = async (options) => {
11980
11951
  const tsPrefixTo = prefix?.to ?? "@typescript-eslint";
11981
11952
  const tsRules = {
11982
11953
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11983
- ...(default8.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
11954
+ ...(default2.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
11984
11955
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11985
- ...default8.configs.strict?.rules,
11956
+ ...default2.configs.strict?.rules,
11986
11957
  "no-invalid-this": "off",
11987
11958
  ...typescriptRules({
11988
11959
  typeAware: false
@@ -11995,7 +11966,7 @@ var typescript = async (options) => {
11995
11966
  name: "jsse/typescript/setup",
11996
11967
  plugins: {
11997
11968
  import: pluginImport,
11998
- [tsPrefixTo]: default8
11969
+ [tsPrefixTo]: default2
11999
11970
  }
12000
11971
  },
12001
11972
  ...parserConfigs,
@@ -12074,7 +12045,6 @@ function unicornOff() {
12074
12045
  return {
12075
12046
  "unicorn/catch-error-name": "off",
12076
12047
  "unicorn/consistent-destructuring": "off",
12077
- // "unicorn/no-array-for-each": "off",
12078
12048
  "unicorn/no-array-reduce": "off",
12079
12049
  "unicorn/no-nested-ternary": "off",
12080
12050
  // conflicts with prettier
@@ -12087,7 +12057,7 @@ function unicornOff() {
12087
12057
  };
12088
12058
  }
12089
12059
  function unicornRecommended() {
12090
- const rules = default6.configs.recommended.rules;
12060
+ const rules = default7.configs.recommended.rules;
12091
12061
  if (rules === void 0) {
12092
12062
  throw new Error("Expected rules to be defined in unicorn plugin");
12093
12063
  }
@@ -12099,7 +12069,7 @@ var unicorn = async () => {
12099
12069
  name: "jsse/unicorn",
12100
12070
  plugins: {
12101
12071
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12102
- unicorn: default6
12072
+ unicorn: default7
12103
12073
  },
12104
12074
  rules: {
12105
12075
  ...unicornRecommended(),
@@ -12188,7 +12158,7 @@ var unicorn = async () => {
12188
12158
  // src/configs/vitest.ts
12189
12159
  var vitest = async (options = {}) => {
12190
12160
  const { overrides = {} } = options;
12191
- const pluginVitest = await interopDefault2(import("eslint-plugin-vitest"));
12161
+ const pluginVitest = await interopDefault2(import("@vitest/eslint-plugin"));
12192
12162
  return [
12193
12163
  {
12194
12164
  name: "jsse/vitest/setup",
@@ -12267,6 +12237,86 @@ var yml = async (options) => {
12267
12237
  ];
12268
12238
  };
12269
12239
 
12240
+ // src/lager.ts
12241
+ var levels = {
12242
+ trace: 10,
12243
+ debug: 20,
12244
+ info: 30,
12245
+ warn: 40,
12246
+ error: 50,
12247
+ fatal: 60
12248
+ };
12249
+ function isLagerLevel(level) {
12250
+ return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
12251
+ }
12252
+ var Lager = class {
12253
+ _level = "info";
12254
+ id = "lager";
12255
+ levelNo = levels[this._level];
12256
+ prefix = "";
12257
+ constructor(options) {
12258
+ const { level, id, prefix } = {
12259
+ level: "info",
12260
+ id: "lager",
12261
+ prefix: "@jsse/eslint-config",
12262
+ ...options
12263
+ };
12264
+ this.id = id;
12265
+ this._level = isLagerLevel(level) ? level : "info";
12266
+ this.levelNo = levels[this._level];
12267
+ this.prefix = prefix;
12268
+ this.log = this.log.bind(this);
12269
+ this.debug = this.debug.bind(this);
12270
+ }
12271
+ get level() {
12272
+ return this._level;
12273
+ }
12274
+ set level(level) {
12275
+ this._level = level;
12276
+ this.levelNo = levels[level];
12277
+ }
12278
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12279
+ log(...args) {
12280
+ console.log(...args);
12281
+ }
12282
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12283
+ trace(...args) {
12284
+ if (this.levelNo > levels.trace) {
12285
+ return;
12286
+ }
12287
+ console.trace(...args);
12288
+ }
12289
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12290
+ debug(...args) {
12291
+ if (this.levelNo > levels.debug) {
12292
+ return;
12293
+ }
12294
+ console.debug(...args);
12295
+ }
12296
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12297
+ info(...args) {
12298
+ if (this.levelNo > levels.info) {
12299
+ return;
12300
+ }
12301
+ console.info("[@jsse/eslint-config]", ...args);
12302
+ }
12303
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12304
+ warn(...args) {
12305
+ if (this.levelNo > levels.warn) {
12306
+ return;
12307
+ }
12308
+ console.warn(...args);
12309
+ }
12310
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12311
+ error(...args) {
12312
+ if (this.levelNo > levels.error) {
12313
+ return;
12314
+ }
12315
+ console.error(...args);
12316
+ }
12317
+ };
12318
+ var log = new Lager();
12319
+
12270
12320
  // src/slow.ts
12271
12321
  var slowRules = [
12272
12322
  "@typescript-eslint/no-misused-promises",
@@ -12448,7 +12498,9 @@ async function jsse(options = {}, ...userConfigs) {
12448
12498
  stylistic: stylisticOptions
12449
12499
  }),
12450
12500
  sortPackageJson(),
12451
- sortTsconfig()
12501
+ sortTsconfig({
12502
+ extendTsconfigGlobs: normalizedOptions.extendTsconfigLintGlobs
12503
+ })
12452
12504
  );
12453
12505
  }
12454
12506
  if (normalizedOptions.tailwind) {
@@ -12563,6 +12615,7 @@ export {
12563
12615
  GLOB_ALL_SRC,
12564
12616
  GLOB_CSS,
12565
12617
  GLOB_EXCLUDE,
12618
+ GLOB_GRAPHQL,
12566
12619
  GLOB_HTML,
12567
12620
  GLOB_JS,
12568
12621
  GLOB_JSON,
@@ -12580,6 +12633,7 @@ export {
12580
12633
  GLOB_TESTS,
12581
12634
  GLOB_TOML,
12582
12635
  GLOB_TS,
12636
+ GLOB_TSCONFIG,
12583
12637
  GLOB_TSX,
12584
12638
  GLOB_YAML,
12585
12639
  combine,
@@ -12605,13 +12659,14 @@ export {
12605
12659
  jsseReact,
12606
12660
  jssestd,
12607
12661
  parserTs,
12608
- default2 as pluginAntfu,
12609
- default3 as pluginEslintComments,
12662
+ default3 as pluginAntfu,
12663
+ default4 as pluginEslintComments,
12610
12664
  pluginImport,
12611
- default4 as pluginN,
12612
- default5 as pluginPerfectionist,
12613
- default8 as pluginTs,
12614
- default6 as pluginUnicorn,
12615
- default7 as pluginUnusedImports,
12616
- renameRules
12665
+ default5 as pluginN,
12666
+ default6 as pluginPerfectionist,
12667
+ default2 as pluginTs,
12668
+ default7 as pluginUnicorn,
12669
+ default8 as pluginUnusedImports,
12670
+ renameRules,
12671
+ uniqueStrings
12617
12672
  };
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.11",
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",