@jsse/eslint-config 0.1.9 → 0.1.10
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/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +4 -297
- package/dist/index.d.cts +2118 -300
- package/dist/index.d.ts +2118 -300
- package/dist/index.js +4 -296
- package/package.json +11 -12
package/dist/cli.cjs
CHANGED
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -30,285 +30,6 @@ 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/natural-compare@1.4.0/node_modules/natural-compare/index.js
|
|
34
|
-
var require_natural_compare = __commonJS({
|
|
35
|
-
"node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js"(exports2, module2) {
|
|
36
|
-
"use strict";
|
|
37
|
-
var naturalCompare = function(a, b) {
|
|
38
|
-
var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
|
|
39
|
-
function getCode(str, pos, code) {
|
|
40
|
-
if (code) {
|
|
41
|
-
for (i = pos; code = getCode(str, i), code < 76 && code > 65; )
|
|
42
|
-
++i;
|
|
43
|
-
return +str.slice(pos - 1, i);
|
|
44
|
-
}
|
|
45
|
-
code = alphabet && alphabet.indexOf(str.charAt(pos));
|
|
46
|
-
return code > -1 ? code + 76 : (code = str.charCodeAt(pos) || 0, code < 45 || code > 127) ? code : code < 46 ? 65 : code < 48 ? code - 1 : code < 58 ? code + 18 : code < 65 ? code - 11 : code < 91 ? code + 11 : code < 97 ? code - 37 : code < 123 ? code + 5 : code - 63;
|
|
47
|
-
}
|
|
48
|
-
if ((a += "") != (b += ""))
|
|
49
|
-
for (; codeB; ) {
|
|
50
|
-
codeA = getCode(a, posA++);
|
|
51
|
-
codeB = getCode(b, posB++);
|
|
52
|
-
if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
|
|
53
|
-
codeA = getCode(a, posA, posA);
|
|
54
|
-
codeB = getCode(b, posB, posA = i);
|
|
55
|
-
posB = i;
|
|
56
|
-
}
|
|
57
|
-
if (codeA != codeB)
|
|
58
|
-
return codeA < codeB ? -1 : 1;
|
|
59
|
-
}
|
|
60
|
-
return 0;
|
|
61
|
-
};
|
|
62
|
-
try {
|
|
63
|
-
module2.exports = naturalCompare;
|
|
64
|
-
} catch (e) {
|
|
65
|
-
String.naturalCompare = naturalCompare;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
// node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js
|
|
71
|
-
var require_sort_keys_fix = __commonJS({
|
|
72
|
-
"node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js"(exports2, module2) {
|
|
73
|
-
"use strict";
|
|
74
|
-
var naturalCompare = require_natural_compare();
|
|
75
|
-
module2.exports = {
|
|
76
|
-
meta: {
|
|
77
|
-
type: "suggestion",
|
|
78
|
-
fixable: "code",
|
|
79
|
-
docs: {
|
|
80
|
-
description: "require object keys to be sorted",
|
|
81
|
-
category: "Stylistic Issues",
|
|
82
|
-
recommended: false,
|
|
83
|
-
url: "https://github.com/namnm/eslint-plugin-sort-keys"
|
|
84
|
-
},
|
|
85
|
-
schema: [
|
|
86
|
-
{
|
|
87
|
-
enum: ["asc", "desc"]
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
type: "object",
|
|
91
|
-
properties: {
|
|
92
|
-
caseSensitive: {
|
|
93
|
-
type: "boolean",
|
|
94
|
-
default: true
|
|
95
|
-
},
|
|
96
|
-
natural: {
|
|
97
|
-
type: "boolean",
|
|
98
|
-
default: false
|
|
99
|
-
},
|
|
100
|
-
minKeys: {
|
|
101
|
-
type: "integer",
|
|
102
|
-
minimum: 2,
|
|
103
|
-
default: 2
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
additionalProperties: false
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
messages: {
|
|
110
|
-
sortKeys: "Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'."
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
create(ctx) {
|
|
114
|
-
const order = ctx.options[0] || "asc";
|
|
115
|
-
const options = ctx.options[1];
|
|
116
|
-
const insensitive = (options && options.caseSensitive) === false;
|
|
117
|
-
const natural = Boolean(options && options.natural);
|
|
118
|
-
const isValidOrder = isValidOrders[order + (insensitive ? "I" : "") + (natural ? "N" : "")];
|
|
119
|
-
const minKeys = Number(options && options.minKeys) || 2;
|
|
120
|
-
let stack = null;
|
|
121
|
-
const SpreadElement = (node) => {
|
|
122
|
-
if (node.parent.type === "ObjectExpression") {
|
|
123
|
-
stack.prevName = null;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
return {
|
|
127
|
-
ExperimentalSpreadProperty: SpreadElement,
|
|
128
|
-
SpreadElement,
|
|
129
|
-
ObjectExpression() {
|
|
130
|
-
stack = {
|
|
131
|
-
upper: stack,
|
|
132
|
-
prevName: null,
|
|
133
|
-
prevNode: null
|
|
134
|
-
};
|
|
135
|
-
},
|
|
136
|
-
"ObjectExpression:exit"() {
|
|
137
|
-
stack = stack.upper;
|
|
138
|
-
},
|
|
139
|
-
Property(node) {
|
|
140
|
-
if (node.parent.type === "ObjectPattern") {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
if (node.parent.properties.length < minKeys) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const prevName = stack.prevName;
|
|
147
|
-
const prevNode = stack.prevNode;
|
|
148
|
-
const thisName = getPropertyName(node);
|
|
149
|
-
if (thisName !== null) {
|
|
150
|
-
stack.prevName = thisName;
|
|
151
|
-
stack.prevNode = node || prevNode;
|
|
152
|
-
}
|
|
153
|
-
if (prevName === null || thisName === null) {
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
if (!isValidOrder(prevName, thisName)) {
|
|
157
|
-
ctx.report({
|
|
158
|
-
node,
|
|
159
|
-
loc: node.key.loc,
|
|
160
|
-
messageId: "sortKeys",
|
|
161
|
-
data: {
|
|
162
|
-
thisName,
|
|
163
|
-
prevName,
|
|
164
|
-
order,
|
|
165
|
-
insensitive: insensitive ? "insensitive " : "",
|
|
166
|
-
natural: natural ? "natural " : ""
|
|
167
|
-
},
|
|
168
|
-
fix(fixer) {
|
|
169
|
-
if (node.parent.__alreadySorted || node.parent.properties.__alreadySorted) {
|
|
170
|
-
return [];
|
|
171
|
-
}
|
|
172
|
-
node.parent.__alreadySorted = true;
|
|
173
|
-
node.parent.properties.__alreadySorted = true;
|
|
174
|
-
const src = ctx.getSourceCode();
|
|
175
|
-
const props = node.parent.properties;
|
|
176
|
-
const parts = [];
|
|
177
|
-
let part = [];
|
|
178
|
-
props.forEach((p) => {
|
|
179
|
-
if (!p.key) {
|
|
180
|
-
parts.push(part);
|
|
181
|
-
part = [];
|
|
182
|
-
} else {
|
|
183
|
-
part.push(p);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
parts.push(part);
|
|
187
|
-
parts.forEach((part2) => {
|
|
188
|
-
part2.sort((p1, p2) => {
|
|
189
|
-
const n1 = getPropertyName(p1);
|
|
190
|
-
const n2 = getPropertyName(p2);
|
|
191
|
-
if (insensitive && n1.toLowerCase() === n2.toLowerCase()) {
|
|
192
|
-
return 0;
|
|
193
|
-
}
|
|
194
|
-
return isValidOrder(n1, n2) ? -1 : 1;
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
const fixes = [];
|
|
198
|
-
let newIndex = 0;
|
|
199
|
-
parts.forEach((part2) => {
|
|
200
|
-
part2.forEach((p) => {
|
|
201
|
-
moveProperty(p, props[newIndex], fixer, src).forEach(
|
|
202
|
-
(f) => fixes.push(f)
|
|
203
|
-
);
|
|
204
|
-
newIndex++;
|
|
205
|
-
});
|
|
206
|
-
newIndex++;
|
|
207
|
-
});
|
|
208
|
-
return fixes;
|
|
209
|
-
}
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
var moveProperty = (thisNode, toNode, fixer, src) => {
|
|
217
|
-
if (thisNode === toNode) {
|
|
218
|
-
return [];
|
|
219
|
-
}
|
|
220
|
-
const fixes = [];
|
|
221
|
-
fixes.push(fixer.replaceText(toNode, src.getText(thisNode)));
|
|
222
|
-
const prev = findTokenPrevLine(thisNode, src);
|
|
223
|
-
const cond = (c) => !prev || prev.loc.end.line !== c.loc.start.line;
|
|
224
|
-
const commentsBefore = src.getCommentsBefore(thisNode).filter(cond);
|
|
225
|
-
if (commentsBefore.length) {
|
|
226
|
-
const prevComments = src.getCommentsBefore(thisNode).filter((c) => !cond(c));
|
|
227
|
-
const b = prevComments.length ? prevComments[prevComments.length - 1].range[1] : prev ? prev.range[1] : commentsBefore[0].range[0];
|
|
228
|
-
const e = commentsBefore[commentsBefore.length - 1].range[1];
|
|
229
|
-
fixes.push(fixer.replaceTextRange([b, e], ""));
|
|
230
|
-
const toPrev = src.getTokenBefore(toNode, { includeComments: true });
|
|
231
|
-
const txt = src.text.substring(b, e);
|
|
232
|
-
fixes.push(fixer.insertTextAfter(toPrev, txt));
|
|
233
|
-
}
|
|
234
|
-
const next = findCommaSameLine(thisNode, src) || thisNode;
|
|
235
|
-
const commentsAfter = src.getCommentsAfter(next).filter((c) => thisNode.loc.end.line === c.loc.start.line);
|
|
236
|
-
if (commentsAfter.length) {
|
|
237
|
-
const b = next.range[1];
|
|
238
|
-
const e = commentsAfter[commentsAfter.length - 1].range[1];
|
|
239
|
-
fixes.push(fixer.replaceTextRange([b, e], ""));
|
|
240
|
-
const toNext = findCommaSameLine(toNode, src) || toNode;
|
|
241
|
-
const txt = src.text.substring(b, e);
|
|
242
|
-
fixes.push(fixer.insertTextAfter(toNext, txt));
|
|
243
|
-
}
|
|
244
|
-
return fixes;
|
|
245
|
-
};
|
|
246
|
-
var findTokenPrevLine = (node, src) => {
|
|
247
|
-
let t = src.getTokenBefore(node);
|
|
248
|
-
while (true) {
|
|
249
|
-
if (!t || t.range[0] < node.parent.range[0]) {
|
|
250
|
-
return null;
|
|
251
|
-
}
|
|
252
|
-
if (t.loc.end.line < node.loc.start.line) {
|
|
253
|
-
return t;
|
|
254
|
-
}
|
|
255
|
-
t = src.getTokenBefore(t);
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
var findCommaSameLine = (node, src) => {
|
|
259
|
-
const t = src.getTokenAfter(node);
|
|
260
|
-
return t && t.value === "," && node.loc.end.line === t.loc.start.line ? t : null;
|
|
261
|
-
};
|
|
262
|
-
var isValidOrders = {
|
|
263
|
-
asc: (a, b) => a <= b,
|
|
264
|
-
ascI: (a, b) => a.toLowerCase() <= b.toLowerCase(),
|
|
265
|
-
ascN: (a, b) => naturalCompare(a, b) <= 0,
|
|
266
|
-
ascIN: (a, b) => naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0,
|
|
267
|
-
desc: (a, b) => isValidOrders.asc(b, a),
|
|
268
|
-
descI: (a, b) => isValidOrders.ascI(b, a),
|
|
269
|
-
descN: (a, b) => isValidOrders.ascN(b, a),
|
|
270
|
-
descIN: (a, b) => isValidOrders.ascIN(b, a)
|
|
271
|
-
};
|
|
272
|
-
var getPropertyName = (node) => {
|
|
273
|
-
let prop;
|
|
274
|
-
switch (node && node.type) {
|
|
275
|
-
case "Property":
|
|
276
|
-
case "MethodDefinition":
|
|
277
|
-
prop = node.key;
|
|
278
|
-
break;
|
|
279
|
-
case "MemberExpression":
|
|
280
|
-
prop = node.property;
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
283
|
-
switch (prop && prop.type) {
|
|
284
|
-
case "Literal":
|
|
285
|
-
return String(prop.value);
|
|
286
|
-
case "TemplateLiteral":
|
|
287
|
-
if (prop.expressions.length === 0 && prop.quasis.length === 1) {
|
|
288
|
-
return prop.quasis[0].value.cooked;
|
|
289
|
-
}
|
|
290
|
-
break;
|
|
291
|
-
case "Identifier":
|
|
292
|
-
if (!node.computed) {
|
|
293
|
-
return prop.name;
|
|
294
|
-
}
|
|
295
|
-
break;
|
|
296
|
-
}
|
|
297
|
-
return node.key && node.key.name || null;
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
// node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js
|
|
303
|
-
var require_eslint_plugin_sort_keys = __commonJS({
|
|
304
|
-
"node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js"(exports2, module2) {
|
|
305
|
-
"use strict";
|
|
306
|
-
module2.exports.rules = {
|
|
307
|
-
"sort-keys-fix": require_sort_keys_fix()
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
|
|
312
33
|
// node_modules/.pnpm/globals@15.0.0/node_modules/globals/globals.json
|
|
313
34
|
var require_globals = __commonJS({
|
|
314
35
|
"node_modules/.pnpm/globals@15.0.0/node_modules/globals/globals.json"(exports2, module2) {
|
|
@@ -2837,7 +2558,6 @@ __export(src_exports, {
|
|
|
2837
2558
|
pluginImport: () => pluginImport,
|
|
2838
2559
|
pluginN: () => import_eslint_plugin_n.default,
|
|
2839
2560
|
pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
|
|
2840
|
-
pluginSortKeys: () => pluginSortKeys,
|
|
2841
2561
|
pluginTs: () => import_eslint_plugin.default,
|
|
2842
2562
|
pluginUnicorn: () => import_eslint_plugin_unicorn.default,
|
|
2843
2563
|
pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
|
|
@@ -9854,7 +9574,6 @@ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
|
9854
9574
|
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
9855
9575
|
var import_eslint_plugin = __toESM(require("@typescript-eslint/eslint-plugin"), 1);
|
|
9856
9576
|
var parserTs = __toESM(require("@typescript-eslint/parser"), 1);
|
|
9857
|
-
var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
|
|
9858
9577
|
async function importPluginReact() {
|
|
9859
9578
|
const pluginReact = await interopDefault2(import("eslint-plugin-react"));
|
|
9860
9579
|
return {
|
|
@@ -10262,6 +9981,7 @@ var javascript = async (options) => {
|
|
|
10262
9981
|
{
|
|
10263
9982
|
args: "after-used",
|
|
10264
9983
|
argsIgnorePattern: "^_",
|
|
9984
|
+
ignoreRestSiblings: true,
|
|
10265
9985
|
vars: "all",
|
|
10266
9986
|
varsIgnorePattern: "^_"
|
|
10267
9987
|
}
|
|
@@ -10419,7 +10139,7 @@ function typescriptRulesTypeAware() {
|
|
|
10419
10139
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
10420
10140
|
"@typescript-eslint/no-useless-template-literals": "error",
|
|
10421
10141
|
"no-throw-literal": "off",
|
|
10422
|
-
"@typescript-eslint/
|
|
10142
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
10423
10143
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
10424
10144
|
"@typescript-eslint/no-unsafe-assignment": "error",
|
|
10425
10145
|
"@typescript-eslint/no-unsafe-call": "error",
|
|
@@ -10909,7 +10629,6 @@ var n = async () => {
|
|
|
10909
10629
|
{
|
|
10910
10630
|
name: "jsse:n",
|
|
10911
10631
|
plugins: {
|
|
10912
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
10913
10632
|
n: import_eslint_plugin_n.default
|
|
10914
10633
|
},
|
|
10915
10634
|
rules: {
|
|
@@ -11211,7 +10930,7 @@ function reactRules() {
|
|
|
11211
10930
|
return: "parens-new-line"
|
|
11212
10931
|
}
|
|
11213
10932
|
],
|
|
11214
|
-
"react/no-access-state-in-setstate": "error",
|
|
10933
|
+
// "react/no-access-state-in-setstate": "error",
|
|
11215
10934
|
"react/no-array-index-key": "error",
|
|
11216
10935
|
"react/no-arrow-function-lifecycle": "error",
|
|
11217
10936
|
"react/no-children-prop": "error",
|
|
@@ -11653,7 +11372,7 @@ var tailwind = async (options) => {
|
|
|
11653
11372
|
];
|
|
11654
11373
|
};
|
|
11655
11374
|
|
|
11656
|
-
// src/configs/
|
|
11375
|
+
// src/configs/no-only-tests.ts
|
|
11657
11376
|
var noOnlyTests = async (options = {}) => {
|
|
11658
11377
|
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
11659
11378
|
const pluginNoOnlyTests = await interopDefault2(
|
|
@@ -12273,20 +11992,8 @@ function jsseReact() {
|
|
|
12273
11992
|
pluginImport,
|
|
12274
11993
|
pluginN,
|
|
12275
11994
|
pluginPerfectionist,
|
|
12276
|
-
pluginSortKeys,
|
|
12277
11995
|
pluginTs,
|
|
12278
11996
|
pluginUnicorn,
|
|
12279
11997
|
pluginUnusedImports,
|
|
12280
11998
|
renameRules
|
|
12281
11999
|
});
|
|
12282
|
-
/*! Bundled license information:
|
|
12283
|
-
|
|
12284
|
-
natural-compare/index.js:
|
|
12285
|
-
(*
|
|
12286
|
-
* @version 1.4.0
|
|
12287
|
-
* @date 2015-10-26
|
|
12288
|
-
* @stability 3 - Stable
|
|
12289
|
-
* @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
|
|
12290
|
-
* @license MIT License
|
|
12291
|
-
*)
|
|
12292
|
-
*/
|