@jsse/eslint-config 0.2.19 → 0.2.20

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
@@ -24,9 +24,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
 
27
- // node_modules/.pnpm/globals@15.10.0/node_modules/globals/globals.json
27
+ // node_modules/.pnpm/globals@15.11.0/node_modules/globals/globals.json
28
28
  var require_globals = __commonJS({
29
- "node_modules/.pnpm/globals@15.10.0/node_modules/globals/globals.json"(exports, module) {
29
+ "node_modules/.pnpm/globals@15.11.0/node_modules/globals/globals.json"(exports, module) {
30
30
  module.exports = {
31
31
  amd: {
32
32
  define: false,
@@ -1954,6 +1954,38 @@ var require_globals = __commonJS({
1954
1954
  WeakRef: false,
1955
1955
  WeakSet: false
1956
1956
  },
1957
+ es3: {
1958
+ Array: false,
1959
+ Boolean: false,
1960
+ Date: false,
1961
+ decodeURI: false,
1962
+ decodeURIComponent: false,
1963
+ encodeURI: false,
1964
+ encodeURIComponent: false,
1965
+ Error: false,
1966
+ escape: false,
1967
+ eval: false,
1968
+ EvalError: false,
1969
+ Function: false,
1970
+ Infinity: false,
1971
+ isFinite: false,
1972
+ isNaN: false,
1973
+ Math: false,
1974
+ NaN: false,
1975
+ Number: false,
1976
+ Object: false,
1977
+ parseFloat: false,
1978
+ parseInt: false,
1979
+ RangeError: false,
1980
+ ReferenceError: false,
1981
+ RegExp: false,
1982
+ String: false,
1983
+ SyntaxError: false,
1984
+ TypeError: false,
1985
+ undefined: false,
1986
+ unescape: false,
1987
+ URIError: false
1988
+ },
1957
1989
  es5: {
1958
1990
  Array: false,
1959
1991
  Boolean: false,
@@ -2968,9 +3000,9 @@ var require_globals = __commonJS({
2968
3000
  }
2969
3001
  });
2970
3002
 
2971
- // node_modules/.pnpm/globals@15.10.0/node_modules/globals/index.js
3003
+ // node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js
2972
3004
  var require_globals2 = __commonJS({
2973
- "node_modules/.pnpm/globals@15.10.0/node_modules/globals/index.js"(exports, module) {
3005
+ "node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js"(exports, module) {
2974
3006
  "use strict";
2975
3007
  module.exports = require_globals();
2976
3008
  }
@@ -6097,11 +6129,11 @@ var pp$4 = Parser.prototype;
6097
6129
  pp$4.raise = function(pos, message) {
6098
6130
  var loc = getLineInfo(this.input, pos);
6099
6131
  message += " (" + loc.line + ":" + loc.column + ")";
6100
- var err = new SyntaxError(message);
6101
- err.pos = pos;
6102
- err.loc = loc;
6103
- err.raisedAt = this.pos;
6104
- throw err;
6132
+ var err2 = new SyntaxError(message);
6133
+ err2.pos = pos;
6134
+ err2.loc = loc;
6135
+ err2.raisedAt = this.pos;
6136
+ throw err2;
6105
6137
  };
6106
6138
  pp$4.raiseRecoverable = pp$4.raise;
6107
6139
  pp$4.curPosition = function() {
@@ -8171,11 +8203,11 @@ pp.tryReadTemplateToken = function() {
8171
8203
  this.inTemplateElement = true;
8172
8204
  try {
8173
8205
  this.readTmplToken();
8174
- } catch (err) {
8175
- if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
8206
+ } catch (err2) {
8207
+ if (err2 === INVALID_TEMPLATE_ESCAPE_ERROR) {
8176
8208
  this.readInvalidTemplateToken();
8177
8209
  } else {
8178
- throw err;
8210
+ throw err2;
8179
8211
  }
8180
8212
  }
8181
8213
  this.inTemplateElement = false;
@@ -8414,11 +8446,11 @@ Parser.acorn = {
8414
8446
  nonASCIIwhitespace
8415
8447
  };
8416
8448
 
8417
- // node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
8449
+ // node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
8418
8450
  import { builtinModules, createRequire } from "node:module";
8419
8451
  import fs, { realpathSync, statSync, promises } from "node:fs";
8420
8452
 
8421
- // node_modules/.pnpm/ufo@1.5.3/node_modules/ufo/dist/index.mjs
8453
+ // node_modules/.pnpm/ufo@1.5.4/node_modules/ufo/dist/index.mjs
8422
8454
  var r = String.fromCharCode;
8423
8455
  var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
8424
8456
  var JOIN_LEADING_SLASH_RE = /^\.?\//;
@@ -8471,7 +8503,7 @@ var isAbsolute = function(p) {
8471
8503
  return _IS_ABSOLUTE_RE.test(p);
8472
8504
  };
8473
8505
 
8474
- // node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
8506
+ // node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
8475
8507
  import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "node:url";
8476
8508
  import assert from "node:assert";
8477
8509
  import process$1 from "node:process";
@@ -9786,7 +9818,7 @@ function _resolve(id, options = {}) {
9786
9818
  for (const prefix of ["", "/index"]) {
9787
9819
  for (const extension of options.extensions || DEFAULT_EXTENSIONS) {
9788
9820
  resolved = _tryModuleResolve(
9789
- id + prefix + extension,
9821
+ joinURL(id, prefix) + extension,
9790
9822
  url,
9791
9823
  conditionsSet
9792
9824
  );
@@ -9864,6 +9896,7 @@ var GLOB_JSON5 = "**/*.json5";
9864
9896
  var GLOB_JSONC = "**/*.jsonc";
9865
9897
  var GLOB_TOML = "**/*.toml";
9866
9898
  var GLOB_MARKDOWN = "**/*.md";
9899
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
9867
9900
  var GLOB_GRAPHQL = ["**/*.graphql", "**/*.gql"];
9868
9901
  var GLOB_YAML = "**/*.y?(a)ml";
9869
9902
  var GLOB_HTML = "**/*.htm?(l)";
@@ -9921,8 +9954,505 @@ var GLOB_EXCLUDE = [
9921
9954
  "**/yarn.lock"
9922
9955
  ];
9923
9956
 
9957
+ // node_modules/.pnpm/neverthrow@8.0.0/node_modules/neverthrow/dist/index.es.js
9958
+ var defaultErrorConfig = {
9959
+ withStackTrace: false
9960
+ };
9961
+ var createNeverThrowError = (message, result, config = defaultErrorConfig) => {
9962
+ const data2 = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
9963
+ const maybeStack = config.withStackTrace ? new Error().stack : void 0;
9964
+ return {
9965
+ data: data2,
9966
+ message,
9967
+ stack: maybeStack
9968
+ };
9969
+ };
9970
+ function __awaiter(thisArg, _arguments, P, generator) {
9971
+ function adopt(value) {
9972
+ return value instanceof P ? value : new P(function(resolve2) {
9973
+ resolve2(value);
9974
+ });
9975
+ }
9976
+ return new (P || (P = Promise))(function(resolve2, reject) {
9977
+ function fulfilled(value) {
9978
+ try {
9979
+ step(generator.next(value));
9980
+ } catch (e) {
9981
+ reject(e);
9982
+ }
9983
+ }
9984
+ function rejected(value) {
9985
+ try {
9986
+ step(generator["throw"](value));
9987
+ } catch (e) {
9988
+ reject(e);
9989
+ }
9990
+ }
9991
+ function step(result) {
9992
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
9993
+ }
9994
+ step((generator = generator.apply(thisArg, [])).next());
9995
+ });
9996
+ }
9997
+ function __values(o) {
9998
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
9999
+ if (m) return m.call(o);
10000
+ if (o && typeof o.length === "number") return {
10001
+ next: function() {
10002
+ if (o && i >= o.length) o = void 0;
10003
+ return { value: o && o[i++], done: !o };
10004
+ }
10005
+ };
10006
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
10007
+ }
10008
+ function __await(v) {
10009
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
10010
+ }
10011
+ function __asyncGenerator(thisArg, _arguments, generator) {
10012
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
10013
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
10014
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
10015
+ return this;
10016
+ }, i;
10017
+ function verb(n2) {
10018
+ if (g[n2]) i[n2] = function(v) {
10019
+ return new Promise(function(a, b) {
10020
+ q.push([n2, v, a, b]) > 1 || resume(n2, v);
10021
+ });
10022
+ };
10023
+ }
10024
+ function resume(n2, v) {
10025
+ try {
10026
+ step(g[n2](v));
10027
+ } catch (e) {
10028
+ settle(q[0][3], e);
10029
+ }
10030
+ }
10031
+ function step(r2) {
10032
+ r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
10033
+ }
10034
+ function fulfill(value) {
10035
+ resume("next", value);
10036
+ }
10037
+ function reject(value) {
10038
+ resume("throw", value);
10039
+ }
10040
+ function settle(f, v) {
10041
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
10042
+ }
10043
+ }
10044
+ function __asyncDelegator(o) {
10045
+ var i, p;
10046
+ return i = {}, verb("next"), verb("throw", function(e) {
10047
+ throw e;
10048
+ }), verb("return"), i[Symbol.iterator] = function() {
10049
+ return this;
10050
+ }, i;
10051
+ function verb(n2, f) {
10052
+ i[n2] = o[n2] ? function(v) {
10053
+ return (p = !p) ? { value: __await(o[n2](v)), done: n2 === "return" } : f ? f(v) : v;
10054
+ } : f;
10055
+ }
10056
+ }
10057
+ function __asyncValues(o) {
10058
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
10059
+ var m = o[Symbol.asyncIterator], i;
10060
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
10061
+ return this;
10062
+ }, i);
10063
+ function verb(n2) {
10064
+ i[n2] = o[n2] && function(v) {
10065
+ return new Promise(function(resolve2, reject) {
10066
+ v = o[n2](v), settle(resolve2, reject, v.done, v.value);
10067
+ });
10068
+ };
10069
+ }
10070
+ function settle(resolve2, reject, d, v) {
10071
+ Promise.resolve(v).then(function(v2) {
10072
+ resolve2({ value: v2, done: d });
10073
+ }, reject);
10074
+ }
10075
+ }
10076
+ var ResultAsync = class _ResultAsync {
10077
+ constructor(res) {
10078
+ this._promise = res;
10079
+ }
10080
+ static fromSafePromise(promise) {
10081
+ const newPromise = promise.then((value) => new Ok(value));
10082
+ return new _ResultAsync(newPromise);
10083
+ }
10084
+ static fromPromise(promise, errorFn) {
10085
+ const newPromise = promise.then((value) => new Ok(value)).catch((e) => new Err(errorFn(e)));
10086
+ return new _ResultAsync(newPromise);
10087
+ }
10088
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10089
+ static fromThrowable(fn, errorFn) {
10090
+ return (...args) => {
10091
+ return new _ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
10092
+ try {
10093
+ return new Ok(yield fn(...args));
10094
+ } catch (error) {
10095
+ return new Err(errorFn ? errorFn(error) : error);
10096
+ }
10097
+ }))());
10098
+ };
10099
+ }
10100
+ static combine(asyncResultList) {
10101
+ return combineResultAsyncList(asyncResultList);
10102
+ }
10103
+ static combineWithAllErrors(asyncResultList) {
10104
+ return combineResultAsyncListWithAllErrors(asyncResultList);
10105
+ }
10106
+ map(f) {
10107
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10108
+ if (res.isErr()) {
10109
+ return new Err(res.error);
10110
+ }
10111
+ return new Ok(yield f(res.value));
10112
+ })));
10113
+ }
10114
+ andThrough(f) {
10115
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10116
+ if (res.isErr()) {
10117
+ return new Err(res.error);
10118
+ }
10119
+ const newRes = yield f(res.value);
10120
+ if (newRes.isErr()) {
10121
+ return new Err(newRes.error);
10122
+ }
10123
+ return new Ok(res.value);
10124
+ })));
10125
+ }
10126
+ andTee(f) {
10127
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10128
+ if (res.isErr()) {
10129
+ return new Err(res.error);
10130
+ }
10131
+ try {
10132
+ yield f(res.value);
10133
+ } catch (e) {
10134
+ }
10135
+ return new Ok(res.value);
10136
+ })));
10137
+ }
10138
+ mapErr(f) {
10139
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10140
+ if (res.isOk()) {
10141
+ return new Ok(res.value);
10142
+ }
10143
+ return new Err(yield f(res.error));
10144
+ })));
10145
+ }
10146
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10147
+ andThen(f) {
10148
+ return new _ResultAsync(this._promise.then((res) => {
10149
+ if (res.isErr()) {
10150
+ return new Err(res.error);
10151
+ }
10152
+ const newValue = f(res.value);
10153
+ return newValue instanceof _ResultAsync ? newValue._promise : newValue;
10154
+ }));
10155
+ }
10156
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10157
+ orElse(f) {
10158
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10159
+ if (res.isErr()) {
10160
+ return f(res.error);
10161
+ }
10162
+ return new Ok(res.value);
10163
+ })));
10164
+ }
10165
+ match(ok2, _err) {
10166
+ return this._promise.then((res) => res.match(ok2, _err));
10167
+ }
10168
+ unwrapOr(t) {
10169
+ return this._promise.then((res) => res.unwrapOr(t));
10170
+ }
10171
+ /**
10172
+ * Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
10173
+ */
10174
+ safeUnwrap() {
10175
+ return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
10176
+ return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
10177
+ });
10178
+ }
10179
+ // Makes ResultAsync implement PromiseLike<Result>
10180
+ then(successCallback, failureCallback) {
10181
+ return this._promise.then(successCallback, failureCallback);
10182
+ }
10183
+ };
10184
+ var errAsync = (err2) => new ResultAsync(Promise.resolve(new Err(err2)));
10185
+ var fromPromise = ResultAsync.fromPromise;
10186
+ var fromSafePromise = ResultAsync.fromSafePromise;
10187
+ var fromAsyncThrowable = ResultAsync.fromThrowable;
10188
+ var combineResultList = (resultList) => {
10189
+ let acc = ok([]);
10190
+ for (const result of resultList) {
10191
+ if (result.isErr()) {
10192
+ acc = err(result.error);
10193
+ break;
10194
+ } else {
10195
+ acc.map((list) => list.push(result.value));
10196
+ }
10197
+ }
10198
+ return acc;
10199
+ };
10200
+ var combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
10201
+ var combineResultListWithAllErrors = (resultList) => {
10202
+ let acc = ok([]);
10203
+ for (const result of resultList) {
10204
+ if (result.isErr() && acc.isErr()) {
10205
+ acc.error.push(result.error);
10206
+ } else if (result.isErr() && acc.isOk()) {
10207
+ acc = err([result.error]);
10208
+ } else if (result.isOk() && acc.isOk()) {
10209
+ acc.value.push(result.value);
10210
+ }
10211
+ }
10212
+ return acc;
10213
+ };
10214
+ var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
10215
+ var Result;
10216
+ (function(Result2) {
10217
+ function fromThrowable2(fn, errorFn) {
10218
+ return (...args) => {
10219
+ try {
10220
+ const result = fn(...args);
10221
+ return ok(result);
10222
+ } catch (e) {
10223
+ return err(errorFn ? errorFn(e) : e);
10224
+ }
10225
+ };
10226
+ }
10227
+ Result2.fromThrowable = fromThrowable2;
10228
+ function combine2(resultList) {
10229
+ return combineResultList(resultList);
10230
+ }
10231
+ Result2.combine = combine2;
10232
+ function combineWithAllErrors(resultList) {
10233
+ return combineResultListWithAllErrors(resultList);
10234
+ }
10235
+ Result2.combineWithAllErrors = combineWithAllErrors;
10236
+ })(Result || (Result = {}));
10237
+ var ok = (value) => new Ok(value);
10238
+ function err(err2) {
10239
+ return new Err(err2);
10240
+ }
10241
+ var Ok = class {
10242
+ constructor(value) {
10243
+ this.value = value;
10244
+ }
10245
+ isOk() {
10246
+ return true;
10247
+ }
10248
+ isErr() {
10249
+ return !this.isOk();
10250
+ }
10251
+ map(f) {
10252
+ return ok(f(this.value));
10253
+ }
10254
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10255
+ mapErr(_f) {
10256
+ return ok(this.value);
10257
+ }
10258
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10259
+ andThen(f) {
10260
+ return f(this.value);
10261
+ }
10262
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10263
+ andThrough(f) {
10264
+ return f(this.value).map((_value) => this.value);
10265
+ }
10266
+ andTee(f) {
10267
+ try {
10268
+ f(this.value);
10269
+ } catch (e) {
10270
+ }
10271
+ return ok(this.value);
10272
+ }
10273
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10274
+ orElse(_f) {
10275
+ return ok(this.value);
10276
+ }
10277
+ asyncAndThen(f) {
10278
+ return f(this.value);
10279
+ }
10280
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10281
+ asyncAndThrough(f) {
10282
+ return f(this.value).map(() => this.value);
10283
+ }
10284
+ asyncMap(f) {
10285
+ return ResultAsync.fromSafePromise(f(this.value));
10286
+ }
10287
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10288
+ unwrapOr(_v) {
10289
+ return this.value;
10290
+ }
10291
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10292
+ match(ok2, _err) {
10293
+ return ok2(this.value);
10294
+ }
10295
+ safeUnwrap() {
10296
+ const value = this.value;
10297
+ return function* () {
10298
+ return value;
10299
+ }();
10300
+ }
10301
+ _unsafeUnwrap(_) {
10302
+ return this.value;
10303
+ }
10304
+ _unsafeUnwrapErr(config) {
10305
+ throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
10306
+ }
10307
+ };
10308
+ var Err = class {
10309
+ constructor(error) {
10310
+ this.error = error;
10311
+ }
10312
+ isOk() {
10313
+ return false;
10314
+ }
10315
+ isErr() {
10316
+ return !this.isOk();
10317
+ }
10318
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10319
+ map(_f) {
10320
+ return err(this.error);
10321
+ }
10322
+ mapErr(f) {
10323
+ return err(f(this.error));
10324
+ }
10325
+ andThrough(_f) {
10326
+ return err(this.error);
10327
+ }
10328
+ andTee(_f) {
10329
+ return err(this.error);
10330
+ }
10331
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10332
+ andThen(_f) {
10333
+ return err(this.error);
10334
+ }
10335
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10336
+ orElse(f) {
10337
+ return f(this.error);
10338
+ }
10339
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10340
+ asyncAndThen(_f) {
10341
+ return errAsync(this.error);
10342
+ }
10343
+ asyncAndThrough(_f) {
10344
+ return errAsync(this.error);
10345
+ }
10346
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10347
+ asyncMap(_f) {
10348
+ return errAsync(this.error);
10349
+ }
10350
+ unwrapOr(v) {
10351
+ return v;
10352
+ }
10353
+ match(_ok, err2) {
10354
+ return err2(this.error);
10355
+ }
10356
+ safeUnwrap() {
10357
+ const error = this.error;
10358
+ return function* () {
10359
+ yield err(error);
10360
+ throw new Error("Do not use this generator out of `safeTry`");
10361
+ }();
10362
+ }
10363
+ _unsafeUnwrap(config) {
10364
+ throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config);
10365
+ }
10366
+ _unsafeUnwrapErr(_) {
10367
+ return this.error;
10368
+ }
10369
+ };
10370
+ var fromThrowable = Result.fromThrowable;
10371
+
9924
10372
  // src/utils.ts
9925
10373
  import process3 from "node:process";
10374
+
10375
+ // src/lager.ts
10376
+ var levels = {
10377
+ trace: 10,
10378
+ debug: 20,
10379
+ info: 30,
10380
+ warn: 40,
10381
+ error: 50,
10382
+ fatal: 60
10383
+ };
10384
+ function isLagerLevel(level) {
10385
+ return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
10386
+ }
10387
+ var Lager = class {
10388
+ _level = "info";
10389
+ id = "lager";
10390
+ levelNo = levels[this._level];
10391
+ prefix = "";
10392
+ constructor(options) {
10393
+ const { level, id, prefix } = {
10394
+ level: "info",
10395
+ id: "lager",
10396
+ prefix: "@jsse/eslint-config",
10397
+ ...options
10398
+ };
10399
+ this.id = id;
10400
+ this._level = isLagerLevel(level) ? level : "info";
10401
+ this.levelNo = levels[this._level];
10402
+ this.prefix = prefix;
10403
+ this.log = this.log.bind(this);
10404
+ this.debug = this.debug.bind(this);
10405
+ }
10406
+ get level() {
10407
+ return this._level;
10408
+ }
10409
+ set level(level) {
10410
+ this._level = level;
10411
+ this.levelNo = levels[level];
10412
+ }
10413
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10414
+ log(...args) {
10415
+ console.log(...args);
10416
+ }
10417
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10418
+ trace(...args) {
10419
+ if (this.levelNo > levels.trace) {
10420
+ return;
10421
+ }
10422
+ console.trace(...args);
10423
+ }
10424
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10425
+ debug(...args) {
10426
+ if (this.levelNo > levels.debug) {
10427
+ return;
10428
+ }
10429
+ console.debug(...args);
10430
+ }
10431
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10432
+ info(...args) {
10433
+ if (this.levelNo > levels.info) {
10434
+ return;
10435
+ }
10436
+ console.info("[@jsse/eslint-config]", ...args);
10437
+ }
10438
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10439
+ warn(...args) {
10440
+ if (this.levelNo > levels.warn) {
10441
+ return;
10442
+ }
10443
+ console.warn(...args);
10444
+ }
10445
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10446
+ error(...args) {
10447
+ if (this.levelNo > levels.error) {
10448
+ return;
10449
+ }
10450
+ console.error(...args);
10451
+ }
10452
+ };
10453
+ var log = new Lager();
10454
+
10455
+ // src/utils.ts
9926
10456
  async function combine(...configs) {
9927
10457
  const resolved = await Promise.all(configs);
9928
10458
  return resolved.flat();
@@ -9969,6 +10499,57 @@ function uniqueStrings(...strings) {
9969
10499
  }
9970
10500
  return [...set];
9971
10501
  }
10502
+ var parserPlain = {
10503
+ meta: {
10504
+ name: "parser-plain"
10505
+ },
10506
+ parseForESLint: (code) => ({
10507
+ ast: {
10508
+ body: [],
10509
+ comments: [],
10510
+ loc: { end: code.length, start: 0 },
10511
+ range: [0, code.length],
10512
+ tokens: [],
10513
+ type: "Program"
10514
+ },
10515
+ scopeManager: void 0,
10516
+ services: { isPlain: true },
10517
+ visitorKeys: {
10518
+ Program: []
10519
+ }
10520
+ })
10521
+ };
10522
+ function turnOffRules(configs, off) {
10523
+ if (off && off.length > 0) {
10524
+ for (const rule of off) {
10525
+ log.debug(`turning-off: ${rule}`);
10526
+ }
10527
+ const currentlyActiveRules = /* @__PURE__ */ new Set();
10528
+ for (const config of configs) {
10529
+ for (const rule of Object.keys(config.rules ?? {}))
10530
+ currentlyActiveRules.add(rule);
10531
+ }
10532
+ for (const rule of off) {
10533
+ if (!currentlyActiveRules.has(rule)) {
10534
+ log.info(
10535
+ `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
10536
+ );
10537
+ }
10538
+ }
10539
+ for (const config of configs) {
10540
+ for (const cfgRules of [config.rules, config.plugins]) {
10541
+ if (cfgRules) {
10542
+ for (const rule of off) {
10543
+ if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
10544
+ cfgRules[rule] = "off";
10545
+ }
10546
+ }
10547
+ }
10548
+ }
10549
+ }
10550
+ }
10551
+ return configs;
10552
+ }
9972
10553
 
9973
10554
  // src/plugins.ts
9974
10555
  import { default as default2 } from "@typescript-eslint/eslint-plugin";
@@ -9988,6 +10569,7 @@ async function importPluginReact() {
9988
10569
  }
9989
10570
  async function importPluginReactHooks() {
9990
10571
  const pluginReactHooks = await interopDefault2(
10572
+ // @ts-expect-error - bad types
9991
10573
  import("eslint-plugin-react-hooks")
9992
10574
  );
9993
10575
  return {
@@ -9996,6 +10578,7 @@ async function importPluginReactHooks() {
9996
10578
  }
9997
10579
  async function importPluginReactRefresh() {
9998
10580
  const pluginReactRefresh = await interopDefault2(
10581
+ // @ts-expect-error - bad types
9999
10582
  import("eslint-plugin-react-refresh")
10000
10583
  );
10001
10584
  return {
@@ -10006,7 +10589,9 @@ async function importReactPlugins() {
10006
10589
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
10007
10590
  [
10008
10591
  interopDefault2(import("eslint-plugin-react")),
10592
+ // @ts-expect-error - bad types
10009
10593
  interopDefault2(import("eslint-plugin-react-hooks")),
10594
+ // @ts-expect-error - bad types
10010
10595
  interopDefault2(import("eslint-plugin-react-refresh"))
10011
10596
  ]
10012
10597
  );
@@ -10039,7 +10624,7 @@ async function importYmlLibs() {
10039
10624
  return { parserYaml, pluginYaml };
10040
10625
  }
10041
10626
  async function importPluginMarkdown() {
10042
- const pluginMarkdown = await interopDefault2(import("eslint-plugin-markdown"));
10627
+ const pluginMarkdown = await interopDefault2(import("@eslint/markdown"));
10043
10628
  return {
10044
10629
  pluginMarkdown
10045
10630
  };
@@ -10064,10 +10649,23 @@ async function importPluginStylistic() {
10064
10649
  }
10065
10650
  async function importPluginTailwind() {
10066
10651
  const pluginTailwind = await interopDefault2(
10652
+ // @ts-expect-error - bad types
10067
10653
  import("eslint-plugin-tailwindcss")
10068
10654
  );
10069
10655
  return { pluginTailwind };
10070
10656
  }
10657
+ async function safeImportPluginTailwind() {
10658
+ try {
10659
+ const plugin = await importPluginTailwind();
10660
+ return ok(plugin);
10661
+ } catch (e) {
10662
+ return err(
10663
+ new Error(
10664
+ `Failed to import \`eslint-plugin-tailwindcss\`. You might need to install it. ${e}`
10665
+ )
10666
+ );
10667
+ }
10668
+ }
10071
10669
 
10072
10670
  // src/configs/antfu.ts
10073
10671
  var antfu = async () => {
@@ -10530,6 +11128,9 @@ var jsonc = async (options) => {
10530
11128
  ];
10531
11129
  };
10532
11130
 
11131
+ // src/configs/markdown.ts
11132
+ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
11133
+
10533
11134
  // src/configs/ts/typescript-rules.ts
10534
11135
  function typescriptRulesTypeAware() {
10535
11136
  return {
@@ -10951,6 +11552,7 @@ function typescriptRules(props) {
10951
11552
  // src/configs/markdown.ts
10952
11553
  var markdown = async (options) => {
10953
11554
  const { componentExts = [], overrides = {} } = options ?? {};
11555
+ const files = [GLOB_MARKDOWN];
10954
11556
  const { pluginMarkdown } = await importPluginMarkdown();
10955
11557
  const tsRulesOff = Object.fromEntries(
10956
11558
  // @ts-expect-error - undefined
@@ -10959,6 +11561,13 @@ var markdown = async (options) => {
10959
11561
  "off"
10960
11562
  ])
10961
11563
  );
11564
+ const processor = mergeProcessors(
11565
+ [
11566
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11567
+ pluginMarkdown.processors.markdown,
11568
+ processorPassThrough
11569
+ ].filter((processor2) => processor2 !== void 0)
11570
+ );
10962
11571
  return [
10963
11572
  {
10964
11573
  name: "jsse/markdown/setup",
@@ -10967,10 +11576,26 @@ var markdown = async (options) => {
10967
11576
  markdown: pluginMarkdown
10968
11577
  }
10969
11578
  },
11579
+ // {
11580
+ // files: [GLOB_MARKDOWN],
11581
+ // name: "jsse/markdown/processor",
11582
+ // processor: "markdown/markdown",
11583
+ // },
10970
11584
  {
10971
- files: [GLOB_MARKDOWN],
11585
+ files,
11586
+ ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
10972
11587
  name: "jsse/markdown/processor",
10973
- processor: "markdown/markdown"
11588
+ // `eslint-plugin-markdown` only creates virtual files for code blocks,
11589
+ // but not the markdown file itself. We use `eslint-merge-processors` to
11590
+ // add a pass-through processor for the markdown file itself.
11591
+ processor
11592
+ },
11593
+ {
11594
+ files,
11595
+ languageOptions: {
11596
+ parser: parserPlain
11597
+ },
11598
+ name: "jsse/markdown/parser"
10974
11599
  },
10975
11600
  {
10976
11601
  files: [
@@ -11009,22 +11634,38 @@ var markdown = async (options) => {
11009
11634
  "@typescript-eslint/restrict-plus-operands": "off",
11010
11635
  "@typescript-eslint/restrict-template-expressions": "off",
11011
11636
  "@typescript-eslint/unbound-method": "off",
11637
+ "n/prefer-global/buffer": "off",
11638
+ "n/prefer-global/process": "off",
11012
11639
  "no-alert": "off",
11013
11640
  "no-console": "off",
11014
11641
  "no-undef": "off",
11015
11642
  "no-unused-expressions": "off",
11016
11643
  "no-unused-vars": "off",
11017
- "node/prefer-global/process": "off",
11018
- // Type aware rules
11019
11644
  "object-curly-newline": "off",
11020
11645
  "style/comma-dangle": "off",
11021
11646
  "style/eol-last": "off",
11022
11647
  "unicode-bom": "off",
11023
11648
  "unused-imports/no-unused-imports": "off",
11024
11649
  "unused-imports/no-unused-vars": "off",
11650
+ // Type aware rules
11025
11651
  ...tsRulesOff,
11026
11652
  ...overrides
11027
11653
  }
11654
+ },
11655
+ {
11656
+ files: ["**/README.md", "**/README.md/**"],
11657
+ languageOptions: {
11658
+ parserOptions: {
11659
+ ecmaFeatures: {
11660
+ impliedStrict: true
11661
+ }
11662
+ }
11663
+ },
11664
+ name: "jsse/markdown/rules/readme",
11665
+ rules: {
11666
+ "unicorn/filename-case": "off",
11667
+ "unicorn/no-null": "off"
11668
+ }
11028
11669
  }
11029
11670
  ];
11030
11671
  };
@@ -11853,25 +12494,33 @@ function tailwindSettings(options) {
11853
12494
  return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11854
12495
  }
11855
12496
  var tailwind = async (options) => {
11856
- const { pluginTailwind } = await importPluginTailwind();
11857
- return [
11858
- {
11859
- files: [GLOB_SRC],
11860
- name: "jsse/tailwind/rules",
11861
- plugins: {
11862
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11863
- tailwindcss: pluginTailwind
11864
- },
11865
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11866
- rules: {
11867
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11868
- ...pluginTailwind.configs.recommended.rules
11869
- },
11870
- settings: {
11871
- tailwindcss: tailwindSettings(options)
11872
- }
12497
+ const importResult = await safeImportPluginTailwind();
12498
+ return importResult.match(
12499
+ ({ pluginTailwind }) => {
12500
+ return [
12501
+ {
12502
+ files: [GLOB_SRC],
12503
+ name: "jsse/tailwind/rules",
12504
+ plugins: {
12505
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12506
+ tailwindcss: pluginTailwind
12507
+ },
12508
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12509
+ rules: {
12510
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
12511
+ ...pluginTailwind.configs.recommended.rules
12512
+ },
12513
+ settings: {
12514
+ tailwindcss: tailwindSettings(options)
12515
+ }
12516
+ }
12517
+ ];
12518
+ },
12519
+ (error) => {
12520
+ log.error(error.message);
12521
+ return [];
11873
12522
  }
11874
- ];
12523
+ );
11875
12524
  };
11876
12525
 
11877
12526
  // src/configs/ts/parser.ts
@@ -12270,86 +12919,6 @@ var yml = async (options) => {
12270
12919
  ];
12271
12920
  };
12272
12921
 
12273
- // src/lager.ts
12274
- var levels = {
12275
- trace: 10,
12276
- debug: 20,
12277
- info: 30,
12278
- warn: 40,
12279
- error: 50,
12280
- fatal: 60
12281
- };
12282
- function isLagerLevel(level) {
12283
- return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
12284
- }
12285
- var Lager = class {
12286
- _level = "info";
12287
- id = "lager";
12288
- levelNo = levels[this._level];
12289
- prefix = "";
12290
- constructor(options) {
12291
- const { level, id, prefix } = {
12292
- level: "info",
12293
- id: "lager",
12294
- prefix: "@jsse/eslint-config",
12295
- ...options
12296
- };
12297
- this.id = id;
12298
- this._level = isLagerLevel(level) ? level : "info";
12299
- this.levelNo = levels[this._level];
12300
- this.prefix = prefix;
12301
- this.log = this.log.bind(this);
12302
- this.debug = this.debug.bind(this);
12303
- }
12304
- get level() {
12305
- return this._level;
12306
- }
12307
- set level(level) {
12308
- this._level = level;
12309
- this.levelNo = levels[level];
12310
- }
12311
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12312
- log(...args) {
12313
- console.log(...args);
12314
- }
12315
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12316
- trace(...args) {
12317
- if (this.levelNo > levels.trace) {
12318
- return;
12319
- }
12320
- console.trace(...args);
12321
- }
12322
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12323
- debug(...args) {
12324
- if (this.levelNo > levels.debug) {
12325
- return;
12326
- }
12327
- console.debug(...args);
12328
- }
12329
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12330
- info(...args) {
12331
- if (this.levelNo > levels.info) {
12332
- return;
12333
- }
12334
- console.info("[@jsse/eslint-config]", ...args);
12335
- }
12336
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12337
- warn(...args) {
12338
- if (this.levelNo > levels.warn) {
12339
- return;
12340
- }
12341
- console.warn(...args);
12342
- }
12343
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12344
- error(...args) {
12345
- if (this.levelNo > levels.error) {
12346
- return;
12347
- }
12348
- console.error(...args);
12349
- }
12350
- };
12351
- var log = new Lager();
12352
-
12353
12922
  // src/factory.ts
12354
12923
  var flatConfigProps = [
12355
12924
  "files",
@@ -12361,7 +12930,9 @@ var flatConfigProps = [
12361
12930
  "rules",
12362
12931
  "settings"
12363
12932
  ];
12364
- var DEBUG = !!(process6.env.DEBUG?.toLowerCase() === "true" || process6.env.DEBUG === "1");
12933
+ var DEBUG = ["1", "true", "t", "on", "yes", "y"].includes(
12934
+ process6.env.DEBUG ?? ""
12935
+ );
12365
12936
  function defaultOptions2() {
12366
12937
  return {
12367
12938
  componentExts: [],
@@ -12552,37 +13123,14 @@ async function jsse(options = {}, ...userConfigs) {
12552
13123
  }
12553
13124
  const combinedConfigs = await combineAsync(...configs, ...userConfigs);
12554
13125
  if (off && off.length > 0) {
12555
- log.debug("Turning off rules", off);
12556
- const currentlyActiveRules = /* @__PURE__ */ new Set();
12557
- for (const config of combinedConfigs) {
12558
- for (const rule of Object.keys(config.rules ?? {}))
12559
- currentlyActiveRules.add(rule);
12560
- }
12561
- for (const rule of off) {
12562
- if (!currentlyActiveRules.has(rule)) {
12563
- log.info(
12564
- `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
12565
- );
12566
- }
12567
- }
12568
- for (const config of combinedConfigs) {
12569
- for (const cfgRules of [config.rules, config.plugins]) {
12570
- if (cfgRules) {
12571
- for (const rule of off) {
12572
- if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
12573
- cfgRules[rule] = "off";
12574
- }
12575
- }
12576
- }
12577
- }
12578
- }
13126
+ turnOffRules(combinedConfigs, off);
12579
13127
  }
12580
13128
  if (normalizedOptions.rootId !== "jsse") {
12581
13129
  for (const config of combinedConfigs) {
12582
13130
  if (config.name && config.name.startsWith("jsse/")) {
12583
13131
  config.name = config.name.replace(
12584
13132
  "jsse/",
12585
- `${normalizedOptions.rootId}:`
13133
+ `${normalizedOptions.rootId}/`
12586
13134
  );
12587
13135
  }
12588
13136
  }
@@ -12654,6 +13202,7 @@ export {
12654
13202
  GLOB_LESS,
12655
13203
  GLOB_MARKDOWN,
12656
13204
  GLOB_MARKDOWN_CODE,
13205
+ GLOB_MARKDOWN_IN_MARKDOWN,
12657
13206
  GLOB_SCSS,
12658
13207
  GLOB_SRC,
12659
13208
  GLOB_SRC_EXT,
@@ -12687,6 +13236,7 @@ export {
12687
13236
  jsse,
12688
13237
  jsseReact,
12689
13238
  jssestd,
13239
+ parserPlain,
12690
13240
  parserTs,
12691
13241
  default3 as pluginAntfu,
12692
13242
  default4 as pluginEslintComments,
@@ -12697,5 +13247,7 @@ export {
12697
13247
  default7 as pluginUnicorn,
12698
13248
  default8 as pluginUnusedImports,
12699
13249
  renameRules,
13250
+ safeImportPluginTailwind,
13251
+ turnOffRules,
12700
13252
  uniqueStrings
12701
13253
  };