@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/README.md +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +701 -145
- package/dist/index.d.cts +190 -6
- package/dist/index.d.ts +190 -6
- package/dist/index.js +697 -145
- package/package.json +12 -10
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.
|
|
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.
|
|
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,
|
|
@@ -1960,6 +1960,38 @@ var require_globals = __commonJS({
|
|
|
1960
1960
|
WeakRef: false,
|
|
1961
1961
|
WeakSet: false
|
|
1962
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
|
+
},
|
|
1963
1995
|
es5: {
|
|
1964
1996
|
Array: false,
|
|
1965
1997
|
Boolean: false,
|
|
@@ -2974,9 +3006,9 @@ var require_globals = __commonJS({
|
|
|
2974
3006
|
}
|
|
2975
3007
|
});
|
|
2976
3008
|
|
|
2977
|
-
// node_modules/.pnpm/globals@15.
|
|
3009
|
+
// node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js
|
|
2978
3010
|
var require_globals2 = __commonJS({
|
|
2979
|
-
"node_modules/.pnpm/globals@15.
|
|
3011
|
+
"node_modules/.pnpm/globals@15.11.0/node_modules/globals/index.js"(exports2, module2) {
|
|
2980
3012
|
"use strict";
|
|
2981
3013
|
module2.exports = require_globals();
|
|
2982
3014
|
}
|
|
@@ -2999,6 +3031,7 @@ __export(src_exports, {
|
|
|
2999
3031
|
GLOB_LESS: () => GLOB_LESS,
|
|
3000
3032
|
GLOB_MARKDOWN: () => GLOB_MARKDOWN,
|
|
3001
3033
|
GLOB_MARKDOWN_CODE: () => GLOB_MARKDOWN_CODE,
|
|
3034
|
+
GLOB_MARKDOWN_IN_MARKDOWN: () => GLOB_MARKDOWN_IN_MARKDOWN,
|
|
3002
3035
|
GLOB_SCSS: () => GLOB_SCSS,
|
|
3003
3036
|
GLOB_SRC: () => GLOB_SRC,
|
|
3004
3037
|
GLOB_SRC_EXT: () => GLOB_SRC_EXT,
|
|
@@ -3032,6 +3065,7 @@ __export(src_exports, {
|
|
|
3032
3065
|
jsse: () => jsse,
|
|
3033
3066
|
jsseReact: () => jsseReact,
|
|
3034
3067
|
jssestd: () => jssestd,
|
|
3068
|
+
parserPlain: () => parserPlain,
|
|
3035
3069
|
parserTs: () => parserTs,
|
|
3036
3070
|
pluginAntfu: () => import_eslint_plugin_antfu.default,
|
|
3037
3071
|
pluginEslintComments: () => import_eslint_plugin_eslint_comments.default,
|
|
@@ -3042,6 +3076,8 @@ __export(src_exports, {
|
|
|
3042
3076
|
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
3043
3077
|
pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
|
|
3044
3078
|
renameRules: () => renameRules,
|
|
3079
|
+
safeImportPluginTailwind: () => safeImportPluginTailwind,
|
|
3080
|
+
turnOffRules: () => turnOffRules,
|
|
3045
3081
|
uniqueStrings: () => uniqueStrings
|
|
3046
3082
|
});
|
|
3047
3083
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -6169,11 +6205,11 @@ var pp$4 = Parser.prototype;
|
|
|
6169
6205
|
pp$4.raise = function(pos, message) {
|
|
6170
6206
|
var loc = getLineInfo(this.input, pos);
|
|
6171
6207
|
message += " (" + loc.line + ":" + loc.column + ")";
|
|
6172
|
-
var
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
throw
|
|
6208
|
+
var err2 = new SyntaxError(message);
|
|
6209
|
+
err2.pos = pos;
|
|
6210
|
+
err2.loc = loc;
|
|
6211
|
+
err2.raisedAt = this.pos;
|
|
6212
|
+
throw err2;
|
|
6177
6213
|
};
|
|
6178
6214
|
pp$4.raiseRecoverable = pp$4.raise;
|
|
6179
6215
|
pp$4.curPosition = function() {
|
|
@@ -8243,11 +8279,11 @@ pp.tryReadTemplateToken = function() {
|
|
|
8243
8279
|
this.inTemplateElement = true;
|
|
8244
8280
|
try {
|
|
8245
8281
|
this.readTmplToken();
|
|
8246
|
-
} catch (
|
|
8247
|
-
if (
|
|
8282
|
+
} catch (err2) {
|
|
8283
|
+
if (err2 === INVALID_TEMPLATE_ESCAPE_ERROR) {
|
|
8248
8284
|
this.readInvalidTemplateToken();
|
|
8249
8285
|
} else {
|
|
8250
|
-
throw
|
|
8286
|
+
throw err2;
|
|
8251
8287
|
}
|
|
8252
8288
|
}
|
|
8253
8289
|
this.inTemplateElement = false;
|
|
@@ -8486,11 +8522,11 @@ Parser.acorn = {
|
|
|
8486
8522
|
nonASCIIwhitespace
|
|
8487
8523
|
};
|
|
8488
8524
|
|
|
8489
|
-
// node_modules/.pnpm/mlly@1.7.
|
|
8525
|
+
// node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
|
|
8490
8526
|
var import_node_module = require("module");
|
|
8491
8527
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
8492
8528
|
|
|
8493
|
-
// node_modules/.pnpm/ufo@1.5.
|
|
8529
|
+
// node_modules/.pnpm/ufo@1.5.4/node_modules/ufo/dist/index.mjs
|
|
8494
8530
|
var r = String.fromCharCode;
|
|
8495
8531
|
var TRAILING_SLASH_RE = /\/$|\/\?|\/#/;
|
|
8496
8532
|
var JOIN_LEADING_SLASH_RE = /^\.?\//;
|
|
@@ -8543,7 +8579,7 @@ var isAbsolute = function(p) {
|
|
|
8543
8579
|
return _IS_ABSOLUTE_RE.test(p);
|
|
8544
8580
|
};
|
|
8545
8581
|
|
|
8546
|
-
// node_modules/.pnpm/mlly@1.7.
|
|
8582
|
+
// node_modules/.pnpm/mlly@1.7.2/node_modules/mlly/dist/index.mjs
|
|
8547
8583
|
var import_node_url = require("url");
|
|
8548
8584
|
var import_node_assert = __toESM(require("assert"), 1);
|
|
8549
8585
|
var import_node_process = __toESM(require("process"), 1);
|
|
@@ -9858,7 +9894,7 @@ function _resolve(id, options = {}) {
|
|
|
9858
9894
|
for (const prefix of ["", "/index"]) {
|
|
9859
9895
|
for (const extension of options.extensions || DEFAULT_EXTENSIONS) {
|
|
9860
9896
|
resolved = _tryModuleResolve(
|
|
9861
|
-
id
|
|
9897
|
+
joinURL(id, prefix) + extension,
|
|
9862
9898
|
url,
|
|
9863
9899
|
conditionsSet
|
|
9864
9900
|
);
|
|
@@ -9937,6 +9973,7 @@ var GLOB_JSON5 = "**/*.json5";
|
|
|
9937
9973
|
var GLOB_JSONC = "**/*.jsonc";
|
|
9938
9974
|
var GLOB_TOML = "**/*.toml";
|
|
9939
9975
|
var GLOB_MARKDOWN = "**/*.md";
|
|
9976
|
+
var GLOB_MARKDOWN_IN_MARKDOWN = "**/*.md/*.md";
|
|
9940
9977
|
var GLOB_GRAPHQL = ["**/*.graphql", "**/*.gql"];
|
|
9941
9978
|
var GLOB_YAML = "**/*.y?(a)ml";
|
|
9942
9979
|
var GLOB_HTML = "**/*.htm?(l)";
|
|
@@ -9994,8 +10031,505 @@ var GLOB_EXCLUDE = [
|
|
|
9994
10031
|
"**/yarn.lock"
|
|
9995
10032
|
];
|
|
9996
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
|
+
|
|
9997
10449
|
// src/utils.ts
|
|
9998
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
|
|
9999
10533
|
async function combine(...configs) {
|
|
10000
10534
|
const resolved = await Promise.all(configs);
|
|
10001
10535
|
return resolved.flat();
|
|
@@ -10042,6 +10576,57 @@ function uniqueStrings(...strings) {
|
|
|
10042
10576
|
}
|
|
10043
10577
|
return [...set];
|
|
10044
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
|
+
}
|
|
10045
10630
|
|
|
10046
10631
|
// src/plugins.ts
|
|
10047
10632
|
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
@@ -10061,6 +10646,7 @@ async function importPluginReact() {
|
|
|
10061
10646
|
}
|
|
10062
10647
|
async function importPluginReactHooks() {
|
|
10063
10648
|
const pluginReactHooks = await interopDefault2(
|
|
10649
|
+
// @ts-expect-error - bad types
|
|
10064
10650
|
import("eslint-plugin-react-hooks")
|
|
10065
10651
|
);
|
|
10066
10652
|
return {
|
|
@@ -10069,6 +10655,7 @@ async function importPluginReactHooks() {
|
|
|
10069
10655
|
}
|
|
10070
10656
|
async function importPluginReactRefresh() {
|
|
10071
10657
|
const pluginReactRefresh = await interopDefault2(
|
|
10658
|
+
// @ts-expect-error - bad types
|
|
10072
10659
|
import("eslint-plugin-react-refresh")
|
|
10073
10660
|
);
|
|
10074
10661
|
return {
|
|
@@ -10079,7 +10666,9 @@ async function importReactPlugins() {
|
|
|
10079
10666
|
const [pluginReact, pluginReactHooks, pluginReactRefresh] = await Promise.all(
|
|
10080
10667
|
[
|
|
10081
10668
|
interopDefault2(import("eslint-plugin-react")),
|
|
10669
|
+
// @ts-expect-error - bad types
|
|
10082
10670
|
interopDefault2(import("eslint-plugin-react-hooks")),
|
|
10671
|
+
// @ts-expect-error - bad types
|
|
10083
10672
|
interopDefault2(import("eslint-plugin-react-refresh"))
|
|
10084
10673
|
]
|
|
10085
10674
|
);
|
|
@@ -10112,7 +10701,7 @@ async function importYmlLibs() {
|
|
|
10112
10701
|
return { parserYaml, pluginYaml };
|
|
10113
10702
|
}
|
|
10114
10703
|
async function importPluginMarkdown() {
|
|
10115
|
-
const pluginMarkdown = await interopDefault2(import("eslint
|
|
10704
|
+
const pluginMarkdown = await interopDefault2(import("@eslint/markdown"));
|
|
10116
10705
|
return {
|
|
10117
10706
|
pluginMarkdown
|
|
10118
10707
|
};
|
|
@@ -10137,10 +10726,23 @@ async function importPluginStylistic() {
|
|
|
10137
10726
|
}
|
|
10138
10727
|
async function importPluginTailwind() {
|
|
10139
10728
|
const pluginTailwind = await interopDefault2(
|
|
10729
|
+
// @ts-expect-error - bad types
|
|
10140
10730
|
import("eslint-plugin-tailwindcss")
|
|
10141
10731
|
);
|
|
10142
10732
|
return { pluginTailwind };
|
|
10143
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
|
+
}
|
|
10144
10746
|
|
|
10145
10747
|
// src/configs/antfu.ts
|
|
10146
10748
|
var antfu = async () => {
|
|
@@ -10603,6 +11205,9 @@ var jsonc = async (options) => {
|
|
|
10603
11205
|
];
|
|
10604
11206
|
};
|
|
10605
11207
|
|
|
11208
|
+
// src/configs/markdown.ts
|
|
11209
|
+
var import_eslint_merge_processors = require("eslint-merge-processors");
|
|
11210
|
+
|
|
10606
11211
|
// src/configs/ts/typescript-rules.ts
|
|
10607
11212
|
function typescriptRulesTypeAware() {
|
|
10608
11213
|
return {
|
|
@@ -11024,6 +11629,7 @@ function typescriptRules(props) {
|
|
|
11024
11629
|
// src/configs/markdown.ts
|
|
11025
11630
|
var markdown = async (options) => {
|
|
11026
11631
|
const { componentExts = [], overrides = {} } = options ?? {};
|
|
11632
|
+
const files = [GLOB_MARKDOWN];
|
|
11027
11633
|
const { pluginMarkdown } = await importPluginMarkdown();
|
|
11028
11634
|
const tsRulesOff = Object.fromEntries(
|
|
11029
11635
|
// @ts-expect-error - undefined
|
|
@@ -11032,6 +11638,13 @@ var markdown = async (options) => {
|
|
|
11032
11638
|
"off"
|
|
11033
11639
|
])
|
|
11034
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
|
+
);
|
|
11035
11648
|
return [
|
|
11036
11649
|
{
|
|
11037
11650
|
name: "jsse/markdown/setup",
|
|
@@ -11040,10 +11653,26 @@ var markdown = async (options) => {
|
|
|
11040
11653
|
markdown: pluginMarkdown
|
|
11041
11654
|
}
|
|
11042
11655
|
},
|
|
11656
|
+
// {
|
|
11657
|
+
// files: [GLOB_MARKDOWN],
|
|
11658
|
+
// name: "jsse/markdown/processor",
|
|
11659
|
+
// processor: "markdown/markdown",
|
|
11660
|
+
// },
|
|
11043
11661
|
{
|
|
11044
|
-
files
|
|
11662
|
+
files,
|
|
11663
|
+
ignores: [GLOB_MARKDOWN_IN_MARKDOWN],
|
|
11045
11664
|
name: "jsse/markdown/processor",
|
|
11046
|
-
|
|
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"
|
|
11047
11676
|
},
|
|
11048
11677
|
{
|
|
11049
11678
|
files: [
|
|
@@ -11082,22 +11711,38 @@ var markdown = async (options) => {
|
|
|
11082
11711
|
"@typescript-eslint/restrict-plus-operands": "off",
|
|
11083
11712
|
"@typescript-eslint/restrict-template-expressions": "off",
|
|
11084
11713
|
"@typescript-eslint/unbound-method": "off",
|
|
11714
|
+
"n/prefer-global/buffer": "off",
|
|
11715
|
+
"n/prefer-global/process": "off",
|
|
11085
11716
|
"no-alert": "off",
|
|
11086
11717
|
"no-console": "off",
|
|
11087
11718
|
"no-undef": "off",
|
|
11088
11719
|
"no-unused-expressions": "off",
|
|
11089
11720
|
"no-unused-vars": "off",
|
|
11090
|
-
"node/prefer-global/process": "off",
|
|
11091
|
-
// Type aware rules
|
|
11092
11721
|
"object-curly-newline": "off",
|
|
11093
11722
|
"style/comma-dangle": "off",
|
|
11094
11723
|
"style/eol-last": "off",
|
|
11095
11724
|
"unicode-bom": "off",
|
|
11096
11725
|
"unused-imports/no-unused-imports": "off",
|
|
11097
11726
|
"unused-imports/no-unused-vars": "off",
|
|
11727
|
+
// Type aware rules
|
|
11098
11728
|
...tsRulesOff,
|
|
11099
11729
|
...overrides
|
|
11100
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
|
+
}
|
|
11101
11746
|
}
|
|
11102
11747
|
];
|
|
11103
11748
|
};
|
|
@@ -11926,25 +12571,33 @@ function tailwindSettings(options) {
|
|
|
11926
12571
|
return { ...TAILWIND_ESLINT_SETTINGS_DEFAULT, ...options };
|
|
11927
12572
|
}
|
|
11928
12573
|
var tailwind = async (options) => {
|
|
11929
|
-
const
|
|
11930
|
-
return
|
|
11931
|
-
{
|
|
11932
|
-
|
|
11933
|
-
|
|
11934
|
-
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
11944
|
-
|
|
11945
|
-
|
|
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 [];
|
|
11946
12599
|
}
|
|
11947
|
-
|
|
12600
|
+
);
|
|
11948
12601
|
};
|
|
11949
12602
|
|
|
11950
12603
|
// src/configs/ts/parser.ts
|
|
@@ -12343,86 +12996,6 @@ var yml = async (options) => {
|
|
|
12343
12996
|
];
|
|
12344
12997
|
};
|
|
12345
12998
|
|
|
12346
|
-
// src/lager.ts
|
|
12347
|
-
var levels = {
|
|
12348
|
-
trace: 10,
|
|
12349
|
-
debug: 20,
|
|
12350
|
-
info: 30,
|
|
12351
|
-
warn: 40,
|
|
12352
|
-
error: 50,
|
|
12353
|
-
fatal: 60
|
|
12354
|
-
};
|
|
12355
|
-
function isLagerLevel(level) {
|
|
12356
|
-
return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
|
|
12357
|
-
}
|
|
12358
|
-
var Lager = class {
|
|
12359
|
-
_level = "info";
|
|
12360
|
-
id = "lager";
|
|
12361
|
-
levelNo = levels[this._level];
|
|
12362
|
-
prefix = "";
|
|
12363
|
-
constructor(options) {
|
|
12364
|
-
const { level, id, prefix } = {
|
|
12365
|
-
level: "info",
|
|
12366
|
-
id: "lager",
|
|
12367
|
-
prefix: "@jsse/eslint-config",
|
|
12368
|
-
...options
|
|
12369
|
-
};
|
|
12370
|
-
this.id = id;
|
|
12371
|
-
this._level = isLagerLevel(level) ? level : "info";
|
|
12372
|
-
this.levelNo = levels[this._level];
|
|
12373
|
-
this.prefix = prefix;
|
|
12374
|
-
this.log = this.log.bind(this);
|
|
12375
|
-
this.debug = this.debug.bind(this);
|
|
12376
|
-
}
|
|
12377
|
-
get level() {
|
|
12378
|
-
return this._level;
|
|
12379
|
-
}
|
|
12380
|
-
set level(level) {
|
|
12381
|
-
this._level = level;
|
|
12382
|
-
this.levelNo = levels[level];
|
|
12383
|
-
}
|
|
12384
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12385
|
-
log(...args) {
|
|
12386
|
-
console.log(...args);
|
|
12387
|
-
}
|
|
12388
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12389
|
-
trace(...args) {
|
|
12390
|
-
if (this.levelNo > levels.trace) {
|
|
12391
|
-
return;
|
|
12392
|
-
}
|
|
12393
|
-
console.trace(...args);
|
|
12394
|
-
}
|
|
12395
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12396
|
-
debug(...args) {
|
|
12397
|
-
if (this.levelNo > levels.debug) {
|
|
12398
|
-
return;
|
|
12399
|
-
}
|
|
12400
|
-
console.debug(...args);
|
|
12401
|
-
}
|
|
12402
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12403
|
-
info(...args) {
|
|
12404
|
-
if (this.levelNo > levels.info) {
|
|
12405
|
-
return;
|
|
12406
|
-
}
|
|
12407
|
-
console.info("[@jsse/eslint-config]", ...args);
|
|
12408
|
-
}
|
|
12409
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12410
|
-
warn(...args) {
|
|
12411
|
-
if (this.levelNo > levels.warn) {
|
|
12412
|
-
return;
|
|
12413
|
-
}
|
|
12414
|
-
console.warn(...args);
|
|
12415
|
-
}
|
|
12416
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12417
|
-
error(...args) {
|
|
12418
|
-
if (this.levelNo > levels.error) {
|
|
12419
|
-
return;
|
|
12420
|
-
}
|
|
12421
|
-
console.error(...args);
|
|
12422
|
-
}
|
|
12423
|
-
};
|
|
12424
|
-
var log = new Lager();
|
|
12425
|
-
|
|
12426
12999
|
// src/factory.ts
|
|
12427
13000
|
var flatConfigProps = [
|
|
12428
13001
|
"files",
|
|
@@ -12434,7 +13007,9 @@ var flatConfigProps = [
|
|
|
12434
13007
|
"rules",
|
|
12435
13008
|
"settings"
|
|
12436
13009
|
];
|
|
12437
|
-
var DEBUG =
|
|
13010
|
+
var DEBUG = ["1", "true", "t", "on", "yes", "y"].includes(
|
|
13011
|
+
import_node_process6.default.env.DEBUG ?? ""
|
|
13012
|
+
);
|
|
12438
13013
|
function defaultOptions2() {
|
|
12439
13014
|
return {
|
|
12440
13015
|
componentExts: [],
|
|
@@ -12625,37 +13200,14 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12625
13200
|
}
|
|
12626
13201
|
const combinedConfigs = await combineAsync(...configs, ...userConfigs);
|
|
12627
13202
|
if (off && off.length > 0) {
|
|
12628
|
-
|
|
12629
|
-
const currentlyActiveRules = /* @__PURE__ */ new Set();
|
|
12630
|
-
for (const config of combinedConfigs) {
|
|
12631
|
-
for (const rule of Object.keys(config.rules ?? {}))
|
|
12632
|
-
currentlyActiveRules.add(rule);
|
|
12633
|
-
}
|
|
12634
|
-
for (const rule of off) {
|
|
12635
|
-
if (!currentlyActiveRules.has(rule)) {
|
|
12636
|
-
log.info(
|
|
12637
|
-
`Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
|
|
12638
|
-
);
|
|
12639
|
-
}
|
|
12640
|
-
}
|
|
12641
|
-
for (const config of combinedConfigs) {
|
|
12642
|
-
for (const cfgRules of [config.rules, config.plugins]) {
|
|
12643
|
-
if (cfgRules) {
|
|
12644
|
-
for (const rule of off) {
|
|
12645
|
-
if (cfgRules[rule] !== void 0 && cfgRules[rule] !== "off" && cfgRules[rule] !== 0) {
|
|
12646
|
-
cfgRules[rule] = "off";
|
|
12647
|
-
}
|
|
12648
|
-
}
|
|
12649
|
-
}
|
|
12650
|
-
}
|
|
12651
|
-
}
|
|
13203
|
+
turnOffRules(combinedConfigs, off);
|
|
12652
13204
|
}
|
|
12653
13205
|
if (normalizedOptions.rootId !== "jsse") {
|
|
12654
13206
|
for (const config of combinedConfigs) {
|
|
12655
13207
|
if (config.name && config.name.startsWith("jsse/")) {
|
|
12656
13208
|
config.name = config.name.replace(
|
|
12657
13209
|
"jsse/",
|
|
12658
|
-
`${normalizedOptions.rootId}
|
|
13210
|
+
`${normalizedOptions.rootId}/`
|
|
12659
13211
|
);
|
|
12660
13212
|
}
|
|
12661
13213
|
}
|
|
@@ -12728,6 +13280,7 @@ function jsseReact() {
|
|
|
12728
13280
|
GLOB_LESS,
|
|
12729
13281
|
GLOB_MARKDOWN,
|
|
12730
13282
|
GLOB_MARKDOWN_CODE,
|
|
13283
|
+
GLOB_MARKDOWN_IN_MARKDOWN,
|
|
12731
13284
|
GLOB_SCSS,
|
|
12732
13285
|
GLOB_SRC,
|
|
12733
13286
|
GLOB_SRC_EXT,
|
|
@@ -12760,6 +13313,7 @@ function jsseReact() {
|
|
|
12760
13313
|
jsse,
|
|
12761
13314
|
jsseReact,
|
|
12762
13315
|
jssestd,
|
|
13316
|
+
parserPlain,
|
|
12763
13317
|
parserTs,
|
|
12764
13318
|
pluginAntfu,
|
|
12765
13319
|
pluginEslintComments,
|
|
@@ -12770,5 +13324,7 @@ function jsseReact() {
|
|
|
12770
13324
|
pluginUnicorn,
|
|
12771
13325
|
pluginUnusedImports,
|
|
12772
13326
|
renameRules,
|
|
13327
|
+
safeImportPluginTailwind,
|
|
13328
|
+
turnOffRules,
|
|
12773
13329
|
uniqueStrings
|
|
12774
13330
|
});
|