@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.cjs CHANGED
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // node_modules/.pnpm/globals@15.9.0/node_modules/globals/globals.json
33
+ // node_modules/.pnpm/globals@15.11.0/node_modules/globals/globals.json
34
34
  var require_globals = __commonJS({
35
- "node_modules/.pnpm/globals@15.9.0/node_modules/globals/globals.json"(exports2, module2) {
35
+ "node_modules/.pnpm/globals@15.11.0/node_modules/globals/globals.json"(exports2, module2) {
36
36
  module2.exports = {
37
37
  amd: {
38
38
  define: false,
@@ -105,6 +105,7 @@ var require_globals = __commonJS({
105
105
  BackgroundFetchManager: false,
106
106
  BackgroundFetchRecord: false,
107
107
  BackgroundFetchRegistration: false,
108
+ BarcodeDetector: false,
108
109
  BarProp: false,
109
110
  BaseAudioContext: false,
110
111
  BatteryManager: false,
@@ -708,6 +709,8 @@ var require_globals = __commonJS({
708
709
  onresize: true,
709
710
  onscroll: true,
710
711
  onscrollend: true,
712
+ onscrollsnapchange: true,
713
+ onscrollsnapchanging: true,
711
714
  onsearch: true,
712
715
  onsecuritypolicyviolation: true,
713
716
  onseeked: true,
@@ -899,6 +902,7 @@ var require_globals = __commonJS({
899
902
  showDirectoryPicker: false,
900
903
  showOpenFilePicker: false,
901
904
  showSaveFilePicker: false,
905
+ SnapEvent: false,
902
906
  SourceBuffer: false,
903
907
  SourceBufferList: false,
904
908
  speechSynthesis: false,
@@ -1956,6 +1960,38 @@ var require_globals = __commonJS({
1956
1960
  WeakRef: false,
1957
1961
  WeakSet: false
1958
1962
  },
1963
+ es3: {
1964
+ Array: false,
1965
+ Boolean: false,
1966
+ Date: false,
1967
+ decodeURI: false,
1968
+ decodeURIComponent: false,
1969
+ encodeURI: false,
1970
+ encodeURIComponent: false,
1971
+ Error: false,
1972
+ escape: false,
1973
+ eval: false,
1974
+ EvalError: false,
1975
+ Function: false,
1976
+ Infinity: false,
1977
+ isFinite: false,
1978
+ isNaN: false,
1979
+ Math: false,
1980
+ NaN: false,
1981
+ Number: false,
1982
+ Object: false,
1983
+ parseFloat: false,
1984
+ parseInt: false,
1985
+ RangeError: false,
1986
+ ReferenceError: false,
1987
+ RegExp: false,
1988
+ String: false,
1989
+ SyntaxError: false,
1990
+ TypeError: false,
1991
+ undefined: false,
1992
+ unescape: false,
1993
+ URIError: false
1994
+ },
1959
1995
  es5: {
1960
1996
  Array: false,
1961
1997
  Boolean: false,
@@ -2666,6 +2702,7 @@ var require_globals = __commonJS({
2666
2702
  BackgroundFetchManager: false,
2667
2703
  BackgroundFetchRecord: false,
2668
2704
  BackgroundFetchRegistration: false,
2705
+ BarcodeDetector: false,
2669
2706
  Blob: false,
2670
2707
  BroadcastChannel: false,
2671
2708
  btoa: false,
@@ -2969,9 +3006,9 @@ var require_globals = __commonJS({
2969
3006
  }
2970
3007
  });
2971
3008
 
2972
- // node_modules/.pnpm/globals@15.9.0/node_modules/globals/index.js
3009
+ // node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js
2973
3010
  var require_globals2 = __commonJS({
2974
- "node_modules/.pnpm/globals@15.9.0/node_modules/globals/index.js"(exports2, module2) {
3011
+ "node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js"(exports2, module2) {
2975
3012
  "use strict";
2976
3013
  module2.exports = require_globals();
2977
3014
  }
@@ -2994,6 +3031,7 @@ __export(src_exports, {
2994
3031
  GLOB_LESS: () => GLOB_LESS,
2995
3032
  GLOB_MARKDOWN: () => GLOB_MARKDOWN,
2996
3033
  GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
3034
+ GLOB_MARKDOWN_IN_MARKDOWN: () => GLOB_MARKDOWN_IN_MARKDOWN,
2997
3035
  GLOB_SCSS: () => GLOB_SCSS,
2998
3036
  GLOB_SRC: () => GLOB_SRC,
2999
3037
  GLOB_SRC_EXT: () => GLOB_SRC_EXT,
@@ -3027,6 +3065,7 @@ __export(src_exports, {
3027
3065
  jsse: () => jsse,
3028
3066
  jsseReact: () => jsseReact,
3029
3067
  jssestd: () => jssestd,
3068
+ parserPlain: () => parserPlain,
3030
3069
  parserTs: () => parserTs,
3031
3070
  pluginAntfu: () => import_eslint_plugin_antfu.default,
3032
3071
  pluginEslintComments: () => import_eslint_plugin_eslint_comments.default,
@@ -3037,6 +3076,8 @@ __export(src_exports, {
3037
3076
  pluginUnicorn: () => import_eslint_plugin_unicorn.default,
3038
3077
  pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
3039
3078
  renameRules: () => renameRules,
3079
+ safeImportPluginTailwind: () => safeImportPluginTailwind,
3080
+ turnOffRules: () => turnOffRules,
3040
3081
  uniqueStrings: () => uniqueStrings
3041
3082
  });
3042
3083
  module.exports = __toCommonJS(src_exports);
@@ -6164,11 +6205,11 @@ var pp$4 = Parser.prototype;
6164
6205
  pp$4.raise = function(pos, message) {
6165
6206
  var loc = getLineInfo(this.input, pos);
6166
6207
  message += " (" + loc.line + ":" + loc.column + ")";
6167
- var err = new SyntaxError(message);
6168
- err.pos = pos;
6169
- err.loc = loc;
6170
- err.raisedAt = this.pos;
6171
- throw err;
6208
+ var err2 = new SyntaxError(message);
6209
+ err2.pos = pos;
6210
+ err2.loc = loc;
6211
+ err2.raisedAt = this.pos;
6212
+ throw err2;
6172
6213
  };
6173
6214
  pp$4.raiseRecoverable = pp$4.raise;
6174
6215
  pp$4.curPosition = function() {
@@ -8238,11 +8279,11 @@ pp.tryReadTemplateToken = function() {
8238
8279
  this.inTemplateElement = true;
8239
8280
  try {
8240
8281
  this.readTmplToken();
8241
- } catch (err) {
8242
- if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
8282
+ } catch (err2) {
8283
+ if (err2 === INVALID_TEMPLATE_ESCAPE_ERROR) {
8243
8284
  this.readInvalidTemplateToken();
8244
8285
  } else {
8245
- throw err;
8286
+ throw err2;
8246
8287
  }
8247
8288
  }
8248
8289
  this.inTemplateElement = false;
@@ -8481,11 +8522,11 @@ Parser.acorn = {
8481
8522
  nonASCIIwhitespace
8482
8523
  };
8483
8524
 
8484
- // node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
8525
+ // node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
8485
8526
  var import_node_module = require("module");
8486
8527
  var import_node_fs = __toESM(require("fs"), 1);
8487
8528
 
8488
- // node_modules/.pnpm/ufo@1.5.3/node_modules/ufo/dist/index.mjs
8529
+ // node_modules/.pnpm/ufo@1.5.4/node_modules/ufo/dist/index.mjs
8489
8530
  var r = String.fromCharCode;
8490
8531
  var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
8491
8532
  var JOIN_LEADING_SLASH_RE = /^\.?\//;
@@ -8538,7 +8579,7 @@ var isAbsolute = function(p) {
8538
8579
  return _IS_ABSOLUTE_RE.test(p);
8539
8580
  };
8540
8581
 
8541
- // node_modules/.pnpm/mlly@1.7.1/node_modules/mlly/dist/index.mjs
8582
+ // node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
8542
8583
  var import_node_url = require("url");
8543
8584
  var import_node_assert = __toESM(require("assert"), 1);
8544
8585
  var import_node_process = __toESM(require("process"), 1);
@@ -9853,7 +9894,7 @@ function _resolve(id, options = {}) {
9853
9894
  for (const prefix of ["", "/index"]) {
9854
9895
  for (const extension of options.extensions || DEFAULT_EXTENSIONS) {
9855
9896
  resolved = _tryModuleResolve(
9856
- id + prefix + extension,
9897
+ joinURL(id, prefix) + extension,
9857
9898
  url,
9858
9899
  conditionsSet
9859
9900
  );
@@ -9932,6 +9973,7 @@ var GLOB_JSON5 = "**/*.json5";
9932
9973
  var GLOB_JSONC = "**/*.jsonc";
9933
9974
  var GLOB_TOML = "**/*.toml";
9934
9975
  var GLOB_MARKDOWN = "**/*.md";
9976
+ var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
9935
9977
  var GLOB_GRAPHQL = ["**/*.graphql", "**/*.gql"];
9936
9978
  var GLOB_YAML = "**/*.y?(a)ml";
9937
9979
  var GLOB_HTML = "**/*.htm?(l)";
@@ -9989,8 +10031,505 @@ var GLOB_EXCLUDE = [
9989
10031
  "**/yarn.lock"
9990
10032
  ];
9991
10033
 
10034
+ // node_modules/.pnpm/neverthrow@8.0.0/node_modules/neverthrow/dist/index.es.js
10035
+ var defaultErrorConfig = {
10036
+ withStackTrace: false
10037
+ };
10038
+ var createNeverThrowError = (message, result, config = defaultErrorConfig) => {
10039
+ const data2 = result.isOk() ? { type: "Ok", value: result.value } : { type: "Err", value: result.error };
10040
+ const maybeStack = config.withStackTrace ? new Error().stack : void 0;
10041
+ return {
10042
+ data: data2,
10043
+ message,
10044
+ stack: maybeStack
10045
+ };
10046
+ };
10047
+ function __awaiter(thisArg, _arguments, P, generator) {
10048
+ function adopt(value) {
10049
+ return value instanceof P ? value : new P(function(resolve2) {
10050
+ resolve2(value);
10051
+ });
10052
+ }
10053
+ return new (P || (P = Promise))(function(resolve2, reject) {
10054
+ function fulfilled(value) {
10055
+ try {
10056
+ step(generator.next(value));
10057
+ } catch (e) {
10058
+ reject(e);
10059
+ }
10060
+ }
10061
+ function rejected(value) {
10062
+ try {
10063
+ step(generator["throw"](value));
10064
+ } catch (e) {
10065
+ reject(e);
10066
+ }
10067
+ }
10068
+ function step(result) {
10069
+ result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
10070
+ }
10071
+ step((generator = generator.apply(thisArg, [])).next());
10072
+ });
10073
+ }
10074
+ function __values(o) {
10075
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
10076
+ if (m) return m.call(o);
10077
+ if (o && typeof o.length === "number") return {
10078
+ next: function() {
10079
+ if (o && i >= o.length) o = void 0;
10080
+ return { value: o && o[i++], done: !o };
10081
+ }
10082
+ };
10083
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
10084
+ }
10085
+ function __await(v) {
10086
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
10087
+ }
10088
+ function __asyncGenerator(thisArg, _arguments, generator) {
10089
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
10090
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
10091
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
10092
+ return this;
10093
+ }, i;
10094
+ function verb(n2) {
10095
+ if (g[n2]) i[n2] = function(v) {
10096
+ return new Promise(function(a, b) {
10097
+ q.push([n2, v, a, b]) > 1 || resume(n2, v);
10098
+ });
10099
+ };
10100
+ }
10101
+ function resume(n2, v) {
10102
+ try {
10103
+ step(g[n2](v));
10104
+ } catch (e) {
10105
+ settle(q[0][3], e);
10106
+ }
10107
+ }
10108
+ function step(r2) {
10109
+ r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
10110
+ }
10111
+ function fulfill(value) {
10112
+ resume("next", value);
10113
+ }
10114
+ function reject(value) {
10115
+ resume("throw", value);
10116
+ }
10117
+ function settle(f, v) {
10118
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
10119
+ }
10120
+ }
10121
+ function __asyncDelegator(o) {
10122
+ var i, p;
10123
+ return i = {}, verb("next"), verb("throw", function(e) {
10124
+ throw e;
10125
+ }), verb("return"), i[Symbol.iterator] = function() {
10126
+ return this;
10127
+ }, i;
10128
+ function verb(n2, f) {
10129
+ i[n2] = o[n2] ? function(v) {
10130
+ return (p = !p) ? { value: __await(o[n2](v)), done: n2 === "return" } : f ? f(v) : v;
10131
+ } : f;
10132
+ }
10133
+ }
10134
+ function __asyncValues(o) {
10135
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
10136
+ var m = o[Symbol.asyncIterator], i;
10137
+ 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() {
10138
+ return this;
10139
+ }, i);
10140
+ function verb(n2) {
10141
+ i[n2] = o[n2] && function(v) {
10142
+ return new Promise(function(resolve2, reject) {
10143
+ v = o[n2](v), settle(resolve2, reject, v.done, v.value);
10144
+ });
10145
+ };
10146
+ }
10147
+ function settle(resolve2, reject, d, v) {
10148
+ Promise.resolve(v).then(function(v2) {
10149
+ resolve2({ value: v2, done: d });
10150
+ }, reject);
10151
+ }
10152
+ }
10153
+ var ResultAsync = class _ResultAsync {
10154
+ constructor(res) {
10155
+ this._promise = res;
10156
+ }
10157
+ static fromSafePromise(promise) {
10158
+ const newPromise = promise.then((value) => new Ok(value));
10159
+ return new _ResultAsync(newPromise);
10160
+ }
10161
+ static fromPromise(promise, errorFn) {
10162
+ const newPromise = promise.then((value) => new Ok(value)).catch((e) => new Err(errorFn(e)));
10163
+ return new _ResultAsync(newPromise);
10164
+ }
10165
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10166
+ static fromThrowable(fn, errorFn) {
10167
+ return (...args) => {
10168
+ return new _ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
10169
+ try {
10170
+ return new Ok(yield fn(...args));
10171
+ } catch (error) {
10172
+ return new Err(errorFn ? errorFn(error) : error);
10173
+ }
10174
+ }))());
10175
+ };
10176
+ }
10177
+ static combine(asyncResultList) {
10178
+ return combineResultAsyncList(asyncResultList);
10179
+ }
10180
+ static combineWithAllErrors(asyncResultList) {
10181
+ return combineResultAsyncListWithAllErrors(asyncResultList);
10182
+ }
10183
+ map(f) {
10184
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10185
+ if (res.isErr()) {
10186
+ return new Err(res.error);
10187
+ }
10188
+ return new Ok(yield f(res.value));
10189
+ })));
10190
+ }
10191
+ andThrough(f) {
10192
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10193
+ if (res.isErr()) {
10194
+ return new Err(res.error);
10195
+ }
10196
+ const newRes = yield f(res.value);
10197
+ if (newRes.isErr()) {
10198
+ return new Err(newRes.error);
10199
+ }
10200
+ return new Ok(res.value);
10201
+ })));
10202
+ }
10203
+ andTee(f) {
10204
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10205
+ if (res.isErr()) {
10206
+ return new Err(res.error);
10207
+ }
10208
+ try {
10209
+ yield f(res.value);
10210
+ } catch (e) {
10211
+ }
10212
+ return new Ok(res.value);
10213
+ })));
10214
+ }
10215
+ mapErr(f) {
10216
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10217
+ if (res.isOk()) {
10218
+ return new Ok(res.value);
10219
+ }
10220
+ return new Err(yield f(res.error));
10221
+ })));
10222
+ }
10223
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10224
+ andThen(f) {
10225
+ return new _ResultAsync(this._promise.then((res) => {
10226
+ if (res.isErr()) {
10227
+ return new Err(res.error);
10228
+ }
10229
+ const newValue = f(res.value);
10230
+ return newValue instanceof _ResultAsync ? newValue._promise : newValue;
10231
+ }));
10232
+ }
10233
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10234
+ orElse(f) {
10235
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
10236
+ if (res.isErr()) {
10237
+ return f(res.error);
10238
+ }
10239
+ return new Ok(res.value);
10240
+ })));
10241
+ }
10242
+ match(ok2, _err) {
10243
+ return this._promise.then((res) => res.match(ok2, _err));
10244
+ }
10245
+ unwrapOr(t) {
10246
+ return this._promise.then((res) => res.unwrapOr(t));
10247
+ }
10248
+ /**
10249
+ * Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
10250
+ */
10251
+ safeUnwrap() {
10252
+ return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
10253
+ return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
10254
+ });
10255
+ }
10256
+ // Makes ResultAsync implement PromiseLike<Result>
10257
+ then(successCallback, failureCallback) {
10258
+ return this._promise.then(successCallback, failureCallback);
10259
+ }
10260
+ };
10261
+ var errAsync = (err2) => new ResultAsync(Promise.resolve(new Err(err2)));
10262
+ var fromPromise = ResultAsync.fromPromise;
10263
+ var fromSafePromise = ResultAsync.fromSafePromise;
10264
+ var fromAsyncThrowable = ResultAsync.fromThrowable;
10265
+ var combineResultList = (resultList) => {
10266
+ let acc = ok([]);
10267
+ for (const result of resultList) {
10268
+ if (result.isErr()) {
10269
+ acc = err(result.error);
10270
+ break;
10271
+ } else {
10272
+ acc.map((list) => list.push(result.value));
10273
+ }
10274
+ }
10275
+ return acc;
10276
+ };
10277
+ var combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
10278
+ var combineResultListWithAllErrors = (resultList) => {
10279
+ let acc = ok([]);
10280
+ for (const result of resultList) {
10281
+ if (result.isErr() && acc.isErr()) {
10282
+ acc.error.push(result.error);
10283
+ } else if (result.isErr() && acc.isOk()) {
10284
+ acc = err([result.error]);
10285
+ } else if (result.isOk() && acc.isOk()) {
10286
+ acc.value.push(result.value);
10287
+ }
10288
+ }
10289
+ return acc;
10290
+ };
10291
+ var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
10292
+ var Result;
10293
+ (function(Result2) {
10294
+ function fromThrowable2(fn, errorFn) {
10295
+ return (...args) => {
10296
+ try {
10297
+ const result = fn(...args);
10298
+ return ok(result);
10299
+ } catch (e) {
10300
+ return err(errorFn ? errorFn(e) : e);
10301
+ }
10302
+ };
10303
+ }
10304
+ Result2.fromThrowable = fromThrowable2;
10305
+ function combine2(resultList) {
10306
+ return combineResultList(resultList);
10307
+ }
10308
+ Result2.combine = combine2;
10309
+ function combineWithAllErrors(resultList) {
10310
+ return combineResultListWithAllErrors(resultList);
10311
+ }
10312
+ Result2.combineWithAllErrors = combineWithAllErrors;
10313
+ })(Result || (Result = {}));
10314
+ var ok = (value) => new Ok(value);
10315
+ function err(err2) {
10316
+ return new Err(err2);
10317
+ }
10318
+ var Ok = class {
10319
+ constructor(value) {
10320
+ this.value = value;
10321
+ }
10322
+ isOk() {
10323
+ return true;
10324
+ }
10325
+ isErr() {
10326
+ return !this.isOk();
10327
+ }
10328
+ map(f) {
10329
+ return ok(f(this.value));
10330
+ }
10331
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10332
+ mapErr(_f) {
10333
+ return ok(this.value);
10334
+ }
10335
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10336
+ andThen(f) {
10337
+ return f(this.value);
10338
+ }
10339
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10340
+ andThrough(f) {
10341
+ return f(this.value).map((_value) => this.value);
10342
+ }
10343
+ andTee(f) {
10344
+ try {
10345
+ f(this.value);
10346
+ } catch (e) {
10347
+ }
10348
+ return ok(this.value);
10349
+ }
10350
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10351
+ orElse(_f) {
10352
+ return ok(this.value);
10353
+ }
10354
+ asyncAndThen(f) {
10355
+ return f(this.value);
10356
+ }
10357
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10358
+ asyncAndThrough(f) {
10359
+ return f(this.value).map(() => this.value);
10360
+ }
10361
+ asyncMap(f) {
10362
+ return ResultAsync.fromSafePromise(f(this.value));
10363
+ }
10364
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10365
+ unwrapOr(_v) {
10366
+ return this.value;
10367
+ }
10368
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10369
+ match(ok2, _err) {
10370
+ return ok2(this.value);
10371
+ }
10372
+ safeUnwrap() {
10373
+ const value = this.value;
10374
+ return function* () {
10375
+ return value;
10376
+ }();
10377
+ }
10378
+ _unsafeUnwrap(_) {
10379
+ return this.value;
10380
+ }
10381
+ _unsafeUnwrapErr(config) {
10382
+ throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config);
10383
+ }
10384
+ };
10385
+ var Err = class {
10386
+ constructor(error) {
10387
+ this.error = error;
10388
+ }
10389
+ isOk() {
10390
+ return false;
10391
+ }
10392
+ isErr() {
10393
+ return !this.isOk();
10394
+ }
10395
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10396
+ map(_f) {
10397
+ return err(this.error);
10398
+ }
10399
+ mapErr(f) {
10400
+ return err(f(this.error));
10401
+ }
10402
+ andThrough(_f) {
10403
+ return err(this.error);
10404
+ }
10405
+ andTee(_f) {
10406
+ return err(this.error);
10407
+ }
10408
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10409
+ andThen(_f) {
10410
+ return err(this.error);
10411
+ }
10412
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
10413
+ orElse(f) {
10414
+ return f(this.error);
10415
+ }
10416
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10417
+ asyncAndThen(_f) {
10418
+ return errAsync(this.error);
10419
+ }
10420
+ asyncAndThrough(_f) {
10421
+ return errAsync(this.error);
10422
+ }
10423
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10424
+ asyncMap(_f) {
10425
+ return errAsync(this.error);
10426
+ }
10427
+ unwrapOr(v) {
10428
+ return v;
10429
+ }
10430
+ match(_ok, err2) {
10431
+ return err2(this.error);
10432
+ }
10433
+ safeUnwrap() {
10434
+ const error = this.error;
10435
+ return function* () {
10436
+ yield err(error);
10437
+ throw new Error("Do not use this generator out of `safeTry`");
10438
+ }();
10439
+ }
10440
+ _unsafeUnwrap(config) {
10441
+ throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config);
10442
+ }
10443
+ _unsafeUnwrapErr(_) {
10444
+ return this.error;
10445
+ }
10446
+ };
10447
+ var fromThrowable = Result.fromThrowable;
10448
+
9992
10449
  // src/utils.ts
9993
10450
  var import_node_process3 = __toESM(require("process"), 1);
10451
+
10452
+ // src/lager.ts
10453
+ var levels = {
10454
+ trace: 10,
10455
+ debug: 20,
10456
+ info: 30,
10457
+ warn: 40,
10458
+ error: 50,
10459
+ fatal: 60
10460
+ };
10461
+ function isLagerLevel(level) {
10462
+ return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
10463
+ }
10464
+ var Lager = class {
10465
+ _level = "info";
10466
+ id = "lager";
10467
+ levelNo = levels[this._level];
10468
+ prefix = "";
10469
+ constructor(options) {
10470
+ const { level, id, prefix } = {
10471
+ level: "info",
10472
+ id: "lager",
10473
+ prefix: "@jsse/eslint-config",
10474
+ ...options
10475
+ };
10476
+ this.id = id;
10477
+ this._level = isLagerLevel(level) ? level : "info";
10478
+ this.levelNo = levels[this._level];
10479
+ this.prefix = prefix;
10480
+ this.log = this.log.bind(this);
10481
+ this.debug = this.debug.bind(this);
10482
+ }
10483
+ get level() {
10484
+ return this._level;
10485
+ }
10486
+ set level(level) {
10487
+ this._level = level;
10488
+ this.levelNo = levels[level];
10489
+ }
10490
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10491
+ log(...args) {
10492
+ console.log(...args);
10493
+ }
10494
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10495
+ trace(...args) {
10496
+ if (this.levelNo > levels.trace) {
10497
+ return;
10498
+ }
10499
+ console.trace(...args);
10500
+ }
10501
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10502
+ debug(...args) {
10503
+ if (this.levelNo > levels.debug) {
10504
+ return;
10505
+ }
10506
+ console.debug(...args);
10507
+ }
10508
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10509
+ info(...args) {
10510
+ if (this.levelNo > levels.info) {
10511
+ return;
10512
+ }
10513
+ console.info("[@jsse/eslint-config]", ...args);
10514
+ }
10515
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10516
+ warn(...args) {
10517
+ if (this.levelNo > levels.warn) {
10518
+ return;
10519
+ }
10520
+ console.warn(...args);
10521
+ }
10522
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10523
+ error(...args) {
10524
+ if (this.levelNo > levels.error) {
10525
+ return;
10526
+ }
10527
+ console.error(...args);
10528
+ }
10529
+ };
10530
+ var log = new Lager();
10531
+
10532
+ // src/utils.ts
9994
10533
  async function combine(...configs) {
9995
10534
  const resolved = await Promise.all(configs);
9996
10535
  return resolved.flat();
@@ -10037,6 +10576,57 @@ function uniqueStrings(...strings) {
10037
10576
  }
10038
10577
  return [...set];
10039
10578
  }
10579
+ var parserPlain = {
10580
+ meta: {
10581
+ name: "parser-plain"
10582
+ },
10583
+ parseForESLint: (code) => ({
10584
+ ast: {
10585
+ body: [],
10586
+ comments: [],
10587
+ loc: { end: code.length, start: 0 },
10588
+ range: [0, code.length],
10589
+ tokens: [],
10590
+ type: "Program"
10591
+ },
10592
+ scopeManager: void 0,
10593
+ services: { isPlain: true },
10594
+ visitorKeys: {
10595
+ Program: []
10596
+ }
10597
+ })
10598
+ };
10599
+ function turnOffRules(configs, off) {
10600
+ if (off && off.length > 0) {
10601
+ for (const rule of off) {
10602
+ log.debug(`turning-off: ${rule}`);
10603
+ }
10604
+ const currentlyActiveRules = /* @__PURE__ */ new Set();
10605
+ for (const config of configs) {
10606
+ for (const rule of Object.keys(config.rules ?? {}))
10607
+ currentlyActiveRules.add(rule);
10608
+ }
10609
+ for (const rule of off) {
10610
+ if (!currentlyActiveRules.has(rule)) {
10611
+ log.info(
10612
+ `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
10613
+ );
10614
+ }
10615
+ }
10616
+ for (const config of configs) {
10617
+ for (const cfgRules of [config.rules, config.plugins]) {
10618
+ if (cfgRules) {
10619
+ for (const rule of off) {
10620
+ if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
10621
+ cfgRules[rule] = "off";
10622
+ }
10623
+ }
10624
+ }
10625
+ }
10626
+ }
10627
+ }
10628
+ return configs;
10629
+ }
10040
10630
 
10041
10631
  // src/plugins.ts
10042
10632
  var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
@@ -10056,6 +10646,7 @@ async function importPluginReact() {
10056
10646
  }
10057
10647
  async function importPluginReactHooks() {
10058
10648
  const pluginReactHooks = await interopDefault2(
10649
+ // @ts-expect-error - bad types
10059
10650
  import("eslint-plugin-react-hooks")
10060
10651
  );
10061
10652
  return {
@@ -10064,6 +10655,7 @@ async function importPluginReactHooks() {
10064
10655
  }
10065
10656
  async function importPluginReactRefresh() {
10066
10657
  const pluginReactRefresh = await interopDefault2(
10658
+ // @ts-expect-error - bad types
10067
10659
  import("eslint-plugin-react-refresh")
10068
10660
  );
10069
10661
  return {
@@ -10074,7 +10666,9 @@ async function importReactPlugins() {
10074
10666
  const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
10075
10667
  [
10076
10668
  interopDefault2(import("eslint-plugin-react")),
10669
+ // @ts-expect-error - bad types
10077
10670
  interopDefault2(import("eslint-plugin-react-hooks")),
10671
+ // @ts-expect-error - bad types
10078
10672
  interopDefault2(import("eslint-plugin-react-refresh"))
10079
10673
  ]
10080
10674
  );
@@ -10107,7 +10701,7 @@ async function importYmlLibs() {
10107
10701
  return { parserYaml, pluginYaml };
10108
10702
  }
10109
10703
  async function importPluginMarkdown() {
10110
- const pluginMarkdown = await interopDefault2(import("eslint-plugin-markdown"));
10704
+ const pluginMarkdown = await interopDefault2(import("@eslint/markdown"));
10111
10705
  return {
10112
10706
  pluginMarkdown
10113
10707
  };
@@ -10132,10 +10726,23 @@ async function importPluginStylistic() {
10132
10726
  }
10133
10727
  async function importPluginTailwind() {
10134
10728
  const pluginTailwind = await interopDefault2(
10729
+ // @ts-expect-error - bad types
10135
10730
  import("eslint-plugin-tailwindcss")
10136
10731
  );
10137
10732
  return { pluginTailwind };
10138
10733
  }
10734
+ async function safeImportPluginTailwind() {
10735
+ try {
10736
+ const plugin = await importPluginTailwind();
10737
+ return ok(plugin);
10738
+ } catch (e) {
10739
+ return err(
10740
+ new Error(
10741
+ `Failed to import \`eslint-plugin-tailwindcss\`. You might need to install it. ${e}`
10742
+ )
10743
+ );
10744
+ }
10745
+ }
10139
10746
 
10140
10747
  // src/configs/antfu.ts
10141
10748
  var antfu = async () => {
@@ -10598,6 +11205,9 @@ var jsonc = async (options) => {
10598
11205
  ];
10599
11206
  };
10600
11207
 
11208
+ // src/configs/markdown.ts
11209
+ var import_eslint_merge_processors = require("eslint-merge-processors");
11210
+
10601
11211
  // src/configs/ts/typescript-rules.ts
10602
11212
  function typescriptRulesTypeAware() {
10603
11213
  return {
@@ -11019,6 +11629,7 @@ function typescriptRules(props) {
11019
11629
  // src/configs/markdown.ts
11020
11630
  var markdown = async (options) => {
11021
11631
  const { componentExts = [], overrides = {} } = options ?? {};
11632
+ const files = [GLOB_MARKDOWN];
11022
11633
  const { pluginMarkdown } = await importPluginMarkdown();
11023
11634
  const tsRulesOff = Object.fromEntries(
11024
11635
  // @ts-expect-error - undefined
@@ -11027,6 +11638,13 @@ var markdown = async (options) => {
11027
11638
  "off"
11028
11639
  ])
11029
11640
  );
11641
+ const processor = (0, import_eslint_merge_processors.mergeProcessors)(
11642
+ [
11643
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
11644
+ pluginMarkdown.processors.markdown,
11645
+ import_eslint_merge_processors.processorPassThrough
11646
+ ].filter((processor2) => processor2 !== void 0)
11647
+ );
11030
11648
  return [
11031
11649
  {
11032
11650
  name: "jsse/markdown/setup",
@@ -11035,10 +11653,26 @@ var markdown = async (options) => {
11035
11653
  markdown: pluginMarkdown
11036
11654
  }
11037
11655
  },
11656
+ // {
11657
+ // files: [GLOB_MARKDOWN],
11658
+ // name: "jsse/markdown/processor",
11659
+ // processor: "markdown/markdown",
11660
+ // },
11038
11661
  {
11039
- files: [GLOB_MARKDOWN],
11662
+ files,
11663
+ ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
11040
11664
  name: "jsse/markdown/processor",
11041
- processor: "markdown/markdown"
11665
+ // `eslint-plugin-markdown` only creates virtual files for code blocks,
11666
+ // but not the markdown file itself. We use `eslint-merge-processors` to
11667
+ // add a pass-through processor for the markdown file itself.
11668
+ processor
11669
+ },
11670
+ {
11671
+ files,
11672
+ languageOptions: {
11673
+ parser: parserPlain
11674
+ },
11675
+ name: "jsse/markdown/parser"
11042
11676
  },
11043
11677
  {
11044
11678
  files: [
@@ -11077,22 +11711,38 @@ var markdown = async (options) => {
11077
11711
  "@typescript-eslint/restrict-plus-operands": "off",
11078
11712
  "@typescript-eslint/restrict-template-expressions": "off",
11079
11713
  "@typescript-eslint/unbound-method": "off",
11714
+ "n/prefer-global/buffer": "off",
11715
+ "n/prefer-global/process": "off",
11080
11716
  "no-alert": "off",
11081
11717
  "no-console": "off",
11082
11718
  "no-undef": "off",
11083
11719
  "no-unused-expressions": "off",
11084
11720
  "no-unused-vars": "off",
11085
- "node/prefer-global/process": "off",
11086
- // Type aware rules
11087
11721
  "object-curly-newline": "off",
11088
11722
  "style/comma-dangle": "off",
11089
11723
  "style/eol-last": "off",
11090
11724
  "unicode-bom": "off",
11091
11725
  "unused-imports/no-unused-imports": "off",
11092
11726
  "unused-imports/no-unused-vars": "off",
11727
+ // Type aware rules
11093
11728
  ...tsRulesOff,
11094
11729
  ...overrides
11095
11730
  }
11731
+ },
11732
+ {
11733
+ files: ["**/README.md", "**/README.md/**"],
11734
+ languageOptions: {
11735
+ parserOptions: {
11736
+ ecmaFeatures: {
11737
+ impliedStrict: true
11738
+ }
11739
+ }
11740
+ },
11741
+ name: "jsse/markdown/rules/readme",
11742
+ rules: {
11743
+ "unicorn/filename-case": "off",
11744
+ "unicorn/no-null": "off"
11745
+ }
11096
11746
  }
11097
11747
  ];
11098
11748
  };
@@ -11588,6 +12238,7 @@ var react = async (options) => {
11588
12238
  rules: {
11589
12239
  ...reactRecomendedRules(),
11590
12240
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
12241
+ // @ts-expect-error index access
11591
12242
  ...pluginReact.configs["jsx-runtime"].rules,
11592
12243
  ...reactRules()
11593
12244
  },
@@ -11610,6 +12261,14 @@ var react = async (options) => {
11610
12261
  version: "detect"
11611
12262
  }
11612
12263
  }
12264
+ },
12265
+ {
12266
+ files: [GLOB_JSX, GLOB_TSX],
12267
+ name: "jsse/react/disables",
12268
+ rules: {
12269
+ "unicorn/no-null": "off"
12270
+ // null is bueno in react
12271
+ }
11613
12272
  }
11614
12273
  ];
11615
12274
  if (reactRefresh) {
@@ -11912,25 +12571,33 @@ function tailwindSettings(options) {
11912
12571
  return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
11913
12572
  }
11914
12573
  var tailwind = async (options) => {
11915
- const { pluginTailwind } = await importPluginTailwind();
11916
- return [
11917
- {
11918
- files: [GLOB_SRC],
11919
- name: "jsse/tailwind/rules",
11920
- plugins: {
11921
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11922
- tailwindcss: pluginTailwind
11923
- },
11924
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
11925
- rules: {
11926
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11927
- ...pluginTailwind.configs.recommended.rules
11928
- },
11929
- settings: {
11930
- tailwindcss: tailwindSettings(options)
11931
- }
12574
+ const importResult = await safeImportPluginTailwind();
12575
+ return importResult.match(
12576
+ ({ pluginTailwind }) => {
12577
+ return [
12578
+ {
12579
+ files: [GLOB_SRC],
12580
+ name: "jsse/tailwind/rules",
12581
+ plugins: {
12582
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12583
+ tailwindcss: pluginTailwind
12584
+ },
12585
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12586
+ rules: {
12587
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
12588
+ ...pluginTailwind.configs.recommended.rules
12589
+ },
12590
+ settings: {
12591
+ tailwindcss: tailwindSettings(options)
12592
+ }
12593
+ }
12594
+ ];
12595
+ },
12596
+ (error) => {
12597
+ log.error(error.message);
12598
+ return [];
11932
12599
  }
11933
- ];
12600
+ );
11934
12601
  };
11935
12602
 
11936
12603
  // src/configs/ts/parser.ts
@@ -12329,86 +12996,6 @@ var yml = async (options) => {
12329
12996
  ];
12330
12997
  };
12331
12998
 
12332
- // src/lager.ts
12333
- var levels = {
12334
- trace: 10,
12335
- debug: 20,
12336
- info: 30,
12337
- warn: 40,
12338
- error: 50,
12339
- fatal: 60
12340
- };
12341
- function isLagerLevel(level) {
12342
- return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
12343
- }
12344
- var Lager = class {
12345
- _level = "info";
12346
- id = "lager";
12347
- levelNo = levels[this._level];
12348
- prefix = "";
12349
- constructor(options) {
12350
- const { level, id, prefix } = {
12351
- level: "info",
12352
- id: "lager",
12353
- prefix: "@jsse/eslint-config",
12354
- ...options
12355
- };
12356
- this.id = id;
12357
- this._level = isLagerLevel(level) ? level : "info";
12358
- this.levelNo = levels[this._level];
12359
- this.prefix = prefix;
12360
- this.log = this.log.bind(this);
12361
- this.debug = this.debug.bind(this);
12362
- }
12363
- get level() {
12364
- return this._level;
12365
- }
12366
- set level(level) {
12367
- this._level = level;
12368
- this.levelNo = levels[level];
12369
- }
12370
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12371
- log(...args) {
12372
- console.log(...args);
12373
- }
12374
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12375
- trace(...args) {
12376
- if (this.levelNo > levels.trace) {
12377
- return;
12378
- }
12379
- console.trace(...args);
12380
- }
12381
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12382
- debug(...args) {
12383
- if (this.levelNo > levels.debug) {
12384
- return;
12385
- }
12386
- console.debug(...args);
12387
- }
12388
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12389
- info(...args) {
12390
- if (this.levelNo > levels.info) {
12391
- return;
12392
- }
12393
- console.info("[@jsse/eslint-config]", ...args);
12394
- }
12395
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12396
- warn(...args) {
12397
- if (this.levelNo > levels.warn) {
12398
- return;
12399
- }
12400
- console.warn(...args);
12401
- }
12402
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12403
- error(...args) {
12404
- if (this.levelNo > levels.error) {
12405
- return;
12406
- }
12407
- console.error(...args);
12408
- }
12409
- };
12410
- var log = new Lager();
12411
-
12412
12999
  // src/factory.ts
12413
13000
  var flatConfigProps = [
12414
13001
  "files",
@@ -12420,7 +13007,9 @@ var flatConfigProps = [
12420
13007
  "rules",
12421
13008
  "settings"
12422
13009
  ];
12423
- var DEBUG = !!(import_node_process6.default.env.DEBUG?.toLowerCase() === "true" || import_node_process6.default.env.DEBUG === "1");
13010
+ var DEBUG = ["1", "true", "t", "on", "yes", "y"].includes(
13011
+ import_node_process6.default.env.DEBUG ?? ""
13012
+ );
12424
13013
  function defaultOptions2() {
12425
13014
  return {
12426
13015
  componentExts: [],
@@ -12611,37 +13200,14 @@ async function jsse(options = {}, ...userConfigs) {
12611
13200
  }
12612
13201
  const combinedConfigs = await combineAsync(...configs, ...userConfigs);
12613
13202
  if (off && off.length > 0) {
12614
- log.debug("Turning off rules", off);
12615
- const currentlyActiveRules = /* @__PURE__ */ new Set();
12616
- for (const config of combinedConfigs) {
12617
- for (const rule of Object.keys(config.rules ?? {}))
12618
- currentlyActiveRules.add(rule);
12619
- }
12620
- for (const rule of off) {
12621
- if (!currentlyActiveRules.has(rule)) {
12622
- log.info(
12623
- `Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
12624
- );
12625
- }
12626
- }
12627
- for (const config of combinedConfigs) {
12628
- for (const cfgRules of [config.rules, config.plugins]) {
12629
- if (cfgRules) {
12630
- for (const rule of off) {
12631
- if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
12632
- cfgRules[rule] = "off";
12633
- }
12634
- }
12635
- }
12636
- }
12637
- }
13203
+ turnOffRules(combinedConfigs, off);
12638
13204
  }
12639
13205
  if (normalizedOptions.rootId !== "jsse") {
12640
13206
  for (const config of combinedConfigs) {
12641
13207
  if (config.name && config.name.startsWith("jsse/")) {
12642
13208
  config.name = config.name.replace(
12643
13209
  "jsse/",
12644
- `${normalizedOptions.rootId}:`
13210
+ `${normalizedOptions.rootId}/`
12645
13211
  );
12646
13212
  }
12647
13213
  }
@@ -12714,6 +13280,7 @@ function jsseReact() {
12714
13280
  GLOB_LESS,
12715
13281
  GLOB_MARKDOWN,
12716
13282
  GLOB_MARKDOWN_CODE,
13283
+ GLOB_MARKDOWN_IN_MARKDOWN,
12717
13284
  GLOB_SCSS,
12718
13285
  GLOB_SRC,
12719
13286
  GLOB_SRC_EXT,
@@ -12746,6 +13313,7 @@ function jsseReact() {
12746
13313
  jsse,
12747
13314
  jsseReact,
12748
13315
  jssestd,
13316
+ parserPlain,
12749
13317
  parserTs,
12750
13318
  pluginAntfu,
12751
13319
  pluginEslintComments,
@@ -12756,5 +13324,7 @@ function jsseReact() {
12756
13324
  pluginUnicorn,
12757
13325
  pluginUnusedImports,
12758
13326
  renameRules,
13327
+ safeImportPluginTailwind,
13328
+ turnOffRules,
12759
13329
  uniqueStrings
12760
13330
  });