@jsse/eslint-config 0.2.18 → 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.9.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.9.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,
@@ -99,6 +99,7 @@ var require_globals = __commonJS({
99
99
  BackgroundFetchManager: false,
100
100
  BackgroundFetchRecord: false,
101
101
  BackgroundFetchRegistration: false,
102
+ BarcodeDetector: false,
102
103
  BarProp: false,
103
104
  BaseAudioContext: false,
104
105
  BatteryManager: false,
@@ -702,6 +703,8 @@ var require_globals = __commonJS({
702
703
  onresize: true,
703
704
  onscroll: true,
704
705
  onscrollend: true,
706
+ onscrollsnapchange: true,
707
+ onscrollsnapchanging: true,
705
708
  onsearch: true,
706
709
  onsecuritypolicyviolation: true,
707
710
  onseeked: true,
@@ -893,6 +896,7 @@ var require_globals = __commonJS({
893
896
  showDirectoryPicker: false,
894
897
  showOpenFilePicker: false,
895
898
  showSaveFilePicker: false,
899
+ SnapEvent: false,
896
900
  SourceBuffer: false,
897
901
  SourceBufferList: false,
898
902
  speechSynthesis: false,
@@ -1950,6 +1954,38 @@ var require_globals = __commonJS({
1950
1954
  WeakRef: false,
1951
1955
  WeakSet: false
1952
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
+ },
1953
1989
  es5: {
1954
1990
  Array: false,
1955
1991
  Boolean: false,
@@ -2660,6 +2696,7 @@ var require_globals = __commonJS({
2660
2696
  BackgroundFetchManager: false,
2661
2697
  BackgroundFetchRecord: false,
2662
2698
  BackgroundFetchRegistration: false,
2699
+ BarcodeDetector: false,
2663
2700
  Blob: false,
2664
2701
  BroadcastChannel: false,
2665
2702
  btoa: false,
@@ -2963,9 +3000,9 @@ var require_globals = __commonJS({
2963
3000
  }
2964
3001
  });
2965
3002
 
2966
- // node_modules/.pnpm/globals@15.9.0/node_modules/globals/index.js
3003
+ // node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js
2967
3004
  var require_globals2 = __commonJS({
2968
- "node_modules/.pnpm/globals@15.9.0/node_modules/globals/index.js"(exports, module) {
3005
+ "node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js"(exports, module) {
2969
3006
  "use strict";
2970
3007
  module.exports = require_globals();
2971
3008
  }
@@ -6092,11 +6129,11 @@ var pp$4 = Parser.prototype;
6092
6129
  pp$4.raise = function(pos, message) {
6093
6130
  var loc = getLineInfo(this.input, pos);
6094
6131
  message += " (" + loc.line + ":" + loc.column + ")";
6095
- var err = new SyntaxError(message);
6096
- err.pos = pos;
6097
- err.loc = loc;
6098
- err.raisedAt = this.pos;
6099
- throw err;
6132
+ var err2 = new SyntaxError(message);
6133
+ err2.pos = pos;
6134
+ err2.loc = loc;
6135
+ err2.raisedAt = this.pos;
6136
+ throw err2;
6100
6137
  };
6101
6138
  pp$4.raiseRecoverable = pp$4.raise;
6102
6139
  pp$4.curPosition = function() {
@@ -8166,11 +8203,11 @@ pp.tryReadTemplateToken = function() {
8166
8203
  this.inTemplateElement = true;
8167
8204
  try {
8168
8205
  this.readTmplToken();
8169
- } catch (err) {
8170
- if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
8206
+ } catch (err2) {
8207
+ if (err2 === INVALID_TEMPLATE_ESCAPE_ERROR) {
8171
8208
  this.readInvalidTemplateToken();
8172
8209
  } else {
8173
- throw err;
8210
+ throw err2;
8174
8211
  }
8175
8212
  }
8176
8213
  this.inTemplateElement = false;
@@ -8409,11 +8446,11 @@ Parser.acorn = {
8409
8446
  nonASCIIwhitespace
8410
8447
  };
8411
8448
 
8412
- // 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
8413
8450
  import { builtinModules, createRequire } from "node:module";
8414
8451
  import fs, { realpathSync, statSync, promises } from "node:fs";
8415
8452
 
8416
- // 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
8417
8454
  var r = String.fromCharCode;
8418
8455
  var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
8419
8456
  var JOIN_LEADING_SLASH_RE = /^\.?\//;
@@ -8466,7 +8503,7 @@ var isAbsolute = function(p) {
8466
8503
  return _IS_ABSOLUTE_RE.test(p);
8467
8504
  };
8468
8505
 
8469
- // 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
8470
8507
  import { fileURLToPath as fileURLToPath$1, URL as URL$1, pathToFileURL as pathToFileURL$1 } from "node:url";
8471
8508
  import assert from "node:assert";
8472
8509
  import process$1 from "node:process";
@@ -9781,7 +9818,7 @@ function _resolve(id, options = {}) {
9781
9818
  for (const prefix of ["", "/index"]) {
9782
9819
  for (const extension of options.extensions || DEFAULT_EXTENSIONS) {
9783
9820
  resolved = _tryModuleResolve(
9784
- id + prefix + extension,
9821
+ joinURL(id, prefix) + extension,
9785
9822
  url,
9786
9823
  conditionsSet
9787
9824
  );
@@ -9859,6 +9896,7 @@ var GLOB_JSON5 = "**/*.json5";
9859
9896
  var GLOB_JSONC = "**/*.jsonc";
9860
9897
  var GLOB_TOML = "**/*.toml";
9861
9898
  var GLOB_MARKDOWN = "**/*.md";
9899
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
9862
9900
  var GLOB_GRAPHQL = ["**/*.graphql", "**/*.gql"];
9863
9901
  var GLOB_YAML = "**/*.y?(a)ml";
9864
9902
  var GLOB_HTML = "**/*.htm?(l)";
@@ -9916,8 +9954,505 @@ var GLOB_EXCLUDE = [
9916
9954
  "**/yarn.lock"
9917
9955
  ];
9918
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
+
9919
10372
  // src/utils.ts
9920
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
9921
10456
  async function combine(...configs) {
9922
10457
  const resolved = await Promise.all(configs);
9923
10458
  return resolved.flat();
@@ -9964,6 +10499,57 @@ function uniqueStrings(...strings) {
9964
10499
  }
9965
10500
  return [...set];
9966
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
+ }
9967
10553
 
9968
10554
  // src/plugins.ts
9969
10555
  import { default as default2 } from "@typescript-eslint/eslint-plugin";
@@ -9983,6 +10569,7 @@ async function importPluginReact() {
9983
10569
  }
9984
10570
  async function importPluginReactHooks() {
9985
10571
  const pluginReactHooks = await interopDefault2(
10572
+ // @ts-expect-error - bad types
9986
10573
  import("eslint-plugin-react-hooks")
9987
10574
  );
9988
10575
  return {
@@ -9991,6 +10578,7 @@ async function importPluginReactHooks() {
9991
10578
  }
9992
10579
  async function importPluginReactRefresh() {
9993
10580
  const pluginReactRefresh = await interopDefault2(
10581
+ // @ts-expect-error - bad types
9994
10582
  import("eslint-plugin-react-refresh")
9995
10583
  );
9996
10584
  return {
@@ -10001,7 +10589,9 @@ async function importReactPlugins() {
10001
10589
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
10002
10590
  [
10003
10591
  interopDefault2(import("eslint-plugin-react")),
10592
+ // @ts-expect-error - bad types
10004
10593
  interopDefault2(import("eslint-plugin-react-hooks")),
10594
+ // @ts-expect-error - bad types
10005
10595
  interopDefault2(import("eslint-plugin-react-refresh"))
10006
10596
  ]
10007
10597
  );
@@ -10034,7 +10624,7 @@ async function importYmlLibs() {
10034
10624
  return { parserYaml, pluginYaml };
10035
10625
  }
10036
10626
  async function importPluginMarkdown() {
10037
- const pluginMarkdown = await interopDefault2(import("eslint-plugin-markdown"));
10627
+ const pluginMarkdown = await interopDefault2(import("@eslint/markdown"));
10038
10628
  return {
10039
10629
  pluginMarkdown
10040
10630
  };
@@ -10059,10 +10649,23 @@ async function importPluginStylistic() {
10059
10649
  }
10060
10650
  async function importPluginTailwind() {
10061
10651
  const pluginTailwind = await interopDefault2(
10652
+ // @ts-expect-error - bad types
10062
10653
  import("eslint-plugin-tailwindcss")
10063
10654
  );
10064
10655
  return { pluginTailwind };
10065
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
+ }
10066
10669
 
10067
10670
  // src/configs/antfu.ts
10068
10671
  var antfu = async () => {
@@ -10525,6 +11128,9 @@ var jsonc = async (options) => {
10525
11128
  ];
10526
11129
  };
10527
11130
 
11131
+ // src/configs/markdown.ts
11132
+ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
11133
+
10528
11134
  // src/configs/ts/typescript-rules.ts
10529
11135
  function typescriptRulesTypeAware() {
10530
11136
  return {
@@ -10946,6 +11552,7 @@ function typescriptRules(props) {
10946
11552
  // src/configs/markdown.ts
10947
11553
  var markdown = async (options) => {
10948
11554
  const { componentExts = [], overrides = {} } = options ?? {};
11555
+ const files = [GLOB_MARKDOWN];
10949
11556
  const { pluginMarkdown } = await importPluginMarkdown();
10950
11557
  const tsRulesOff = Object.fromEntries(
10951
11558
  // @ts-expect-error - undefined
@@ -10954,6 +11561,13 @@ var markdown = async (options) => {
10954
11561
  "off"
10955
11562
  ])
10956
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
+ );
10957
11571
  return [
10958
11572
  {
10959
11573
  name: "jsse/markdown/setup",
@@ -10962,10 +11576,26 @@ var markdown = async (options) => {
10962
11576
  markdown: pluginMarkdown
10963
11577
  }
10964
11578
  },
11579
+ // {
11580
+ // files: [GLOB_MARKDOWN],
11581
+ // name: "jsse/markdown/processor",
11582
+ // processor: "markdown/markdown",
11583
+ // },
10965
11584
  {
10966
- files: [GLOB_MARKDOWN],
11585
+ files,
11586
+ ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
10967
11587
  name: "jsse/markdown/processor",
10968
- 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"
10969
11599
  },
10970
11600
  {
10971
11601
  files: [
@@ -11004,22 +11634,38 @@ var markdown = async (options) => {
11004
11634
  "@typescript-eslint/restrict-plus-operands": "off",
11005
11635
  "@typescript-eslint/restrict-template-expressions": "off",
11006
11636
  "@typescript-eslint/unbound-method": "off",
11637
+ "n/prefer-global/buffer": "off",
11638
+ "n/prefer-global/process": "off",
11007
11639
  "no-alert": "off",
11008
11640
  "no-console": "off",
11009
11641
  "no-undef": "off",
11010
11642
  "no-unused-expressions": "off",
11011
11643
  "no-unused-vars": "off",
11012
- "node/prefer-global/process": "off",
11013
- // Type aware rules
11014
11644
  "object-curly-newline": "off",
11015
11645
  "style/comma-dangle": "off",
11016
11646
  "style/eol-last": "off",
11017
11647
  "unicode-bom": "off",
11018
11648
  "unused-imports/no-unused-imports": "off",
11019
11649
  "unused-imports/no-unused-vars": "off",
11650
+ // Type aware rules
11020
11651
  ...tsRulesOff,
11021
11652
  ...overrides
11022
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
+ }
11023
11669
  }
11024
11670
  ];
11025
11671
  };
@@ -11515,6 +12161,7 @@ var react = async (options) => {
11515
12161
  rules: {
11516
12162
  ...reactRecomendedRules(),
11517
12163
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
12164
+ // @ts-expect-error index access
11518
12165
  ...pluginReact.configs["jsx-runtime"].rules,
11519
12166
  ...reactRules()
11520
12167
  },
@@ -11537,6 +12184,14 @@ var react = async (options) => {
11537
12184
  version: "detect"
11538
12185
  }
11539
12186
  }
12187
+ },
12188
+ {
12189
+ files: [GLOB_JSX, GLOB_TSX],
12190
+ name: "jsse/react/disables",
12191
+ rules: {
12192
+ "unicorn/no-null": "off"
12193
+ // null is bueno in react
12194
+ }
11540
12195
  }
11541
12196
  ];
11542
12197
  if (reactRefresh) {
@@ -11839,25 +12494,33 @@ function tailwindSettings(options) {
11839
12494
  return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11840
12495
  }
11841
12496
  var tailwind = async (options) => {
11842
- const { pluginTailwind } = await importPluginTailwind();
11843
- return [
11844
- {
11845
- files: [GLOB_SRC],
11846
- name: "jsse/tailwind/rules",
11847
- plugins: {
11848
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11849
- tailwindcss: pluginTailwind
11850
- },
11851
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11852
- rules: {
11853
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11854
- ...pluginTailwind.configs.recommended.rules
11855
- },
11856
- settings: {
11857
- tailwindcss: tailwindSettings(options)
11858
- }
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 [];
11859
12522
  }
11860
- ];
12523
+ );
11861
12524
  };
11862
12525
 
11863
12526
  // src/configs/ts/parser.ts
@@ -12256,86 +12919,6 @@ var yml = async (options) => {
12256
12919
  ];
12257
12920
  };
12258
12921
 
12259
- // src/lager.ts
12260
- var levels = {
12261
- trace: 10,
12262
- debug: 20,
12263
- info: 30,
12264
- warn: 40,
12265
- error: 50,
12266
- fatal: 60
12267
- };
12268
- function isLagerLevel(level) {
12269
- return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
12270
- }
12271
- var Lager = class {
12272
- _level = "info";
12273
- id = "lager";
12274
- levelNo = levels[this._level];
12275
- prefix = "";
12276
- constructor(options) {
12277
- const { level, id, prefix } = {
12278
- level: "info",
12279
- id: "lager",
12280
- prefix: "@jsse/eslint-config",
12281
- ...options
12282
- };
12283
- this.id = id;
12284
- this._level = isLagerLevel(level) ? level : "info";
12285
- this.levelNo = levels[this._level];
12286
- this.prefix = prefix;
12287
- this.log = this.log.bind(this);
12288
- this.debug = this.debug.bind(this);
12289
- }
12290
- get level() {
12291
- return this._level;
12292
- }
12293
- set level(level) {
12294
- this._level = level;
12295
- this.levelNo = levels[level];
12296
- }
12297
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12298
- log(...args) {
12299
- console.log(...args);
12300
- }
12301
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12302
- trace(...args) {
12303
- if (this.levelNo > levels.trace) {
12304
- return;
12305
- }
12306
- console.trace(...args);
12307
- }
12308
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12309
- debug(...args) {
12310
- if (this.levelNo > levels.debug) {
12311
- return;
12312
- }
12313
- console.debug(...args);
12314
- }
12315
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12316
- info(...args) {
12317
- if (this.levelNo > levels.info) {
12318
- return;
12319
- }
12320
- console.info("[@jsse/eslint-config]", ...args);
12321
- }
12322
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12323
- warn(...args) {
12324
- if (this.levelNo > levels.warn) {
12325
- return;
12326
- }
12327
- console.warn(...args);
12328
- }
12329
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12330
- error(...args) {
12331
- if (this.levelNo > levels.error) {
12332
- return;
12333
- }
12334
- console.error(...args);
12335
- }
12336
- };
12337
- var log = new Lager();
12338
-
12339
12922
  // src/factory.ts
12340
12923
  var flatConfigProps = [
12341
12924
  "files",
@@ -12347,7 +12930,9 @@ var flatConfigProps = [
12347
12930
  "rules",
12348
12931
  "settings"
12349
12932
  ];
12350
- 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
+ );
12351
12936
  function defaultOptions2() {
12352
12937
  return {
12353
12938
  componentExts: [],
@@ -12538,37 +13123,14 @@ async function jsse(options = {}, ...userConfigs) {
12538
13123
  }
12539
13124
  const combinedConfigs = await combineAsync(...configs, ...userConfigs);
12540
13125
  if (off && off.length > 0) {
12541
- log.debug("Turning off rules", off);
12542
- const currentlyActiveRules = /* @__PURE__ */ new Set();
12543
- for (const config of combinedConfigs) {
12544
- for (const rule of Object.keys(config.rules ?? {}))
12545
- currentlyActiveRules.add(rule);
12546
- }
12547
- for (const rule of off) {
12548
- if (!currentlyActiveRules.has(rule)) {
12549
- log.info(
12550
- `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
12551
- );
12552
- }
12553
- }
12554
- for (const config of combinedConfigs) {
12555
- for (const cfgRules of [config.rules, config.plugins]) {
12556
- if (cfgRules) {
12557
- for (const rule of off) {
12558
- if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
12559
- cfgRules[rule] = "off";
12560
- }
12561
- }
12562
- }
12563
- }
12564
- }
13126
+ turnOffRules(combinedConfigs, off);
12565
13127
  }
12566
13128
  if (normalizedOptions.rootId !== "jsse") {
12567
13129
  for (const config of combinedConfigs) {
12568
13130
  if (config.name && config.name.startsWith("jsse/")) {
12569
13131
  config.name = config.name.replace(
12570
13132
  "jsse/",
12571
- `${normalizedOptions.rootId}:`
13133
+ `${normalizedOptions.rootId}/`
12572
13134
  );
12573
13135
  }
12574
13136
  }
@@ -12640,6 +13202,7 @@ export {
12640
13202
  GLOB_LESS,
12641
13203
  GLOB_MARKDOWN,
12642
13204
  GLOB_MARKDOWN_CODE,
13205
+ GLOB_MARKDOWN_IN_MARKDOWN,
12643
13206
  GLOB_SCSS,
12644
13207
  GLOB_SRC,
12645
13208
  GLOB_SRC_EXT,
@@ -12673,6 +13236,7 @@ export {
12673
13236
  jsse,
12674
13237
  jsseReact,
12675
13238
  jssestd,
13239
+ parserPlain,
12676
13240
  parserTs,
12677
13241
  default3 as pluginAntfu,
12678
13242
  default4 as pluginEslintComments,
@@ -12683,5 +13247,7 @@ export {
12683
13247
  default7 as pluginUnicorn,
12684
13248
  default8 as pluginUnusedImports,
12685
13249
  renameRules,
13250
+ safeImportPluginTailwind,
13251
+ turnOffRules,
12686
13252
  uniqueStrings
12687
13253
  };