@jsse/eslint-config 0.1.8 → 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 CHANGED
@@ -617,7 +617,7 @@ var CAC = class extends import_events.EventEmitter {
617
617
  var cac = (name = "") => new CAC(name);
618
618
 
619
619
  // package.json
620
- var version = "0.1.8";
620
+ var version = "0.1.10";
621
621
 
622
622
  // src/cli.ts
623
623
  var cli = cac("jsselint");
package/dist/cli.js CHANGED
@@ -593,7 +593,7 @@ var CAC = class extends EventEmitter {
593
593
  var cac = (name = "") => new CAC(name);
594
594
 
595
595
  // package.json
596
- var version = "0.1.8";
596
+ var version = "0.1.10";
597
597
 
598
598
  // src/cli.ts
599
599
  var cli = cac("jsselint");
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/no-throw-literal": "error",
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",
@@ -10860,13 +10580,29 @@ var markdown = async (options) => {
10860
10580
  },
10861
10581
  name: "jsse:markdown:rules",
10862
10582
  rules: {
10583
+ "@typescript-eslint/await-thenable": "off",
10863
10584
  "@typescript-eslint/consistent-type-imports": "off",
10585
+ "@typescript-eslint/dot-notation": "off",
10586
+ "@typescript-eslint/no-floating-promises": "off",
10587
+ "@typescript-eslint/no-for-in-array": "off",
10588
+ "@typescript-eslint/no-implied-eval": "off",
10589
+ "@typescript-eslint/no-misused-promises": "off",
10864
10590
  "@typescript-eslint/no-namespace": "off",
10865
10591
  "@typescript-eslint/no-redeclare": "off",
10866
10592
  "@typescript-eslint/no-require-imports": "off",
10593
+ "@typescript-eslint/no-throw-literal": "off",
10594
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
10595
+ "@typescript-eslint/no-unsafe-argument": "off",
10596
+ "@typescript-eslint/no-unsafe-assignment": "off",
10597
+ "@typescript-eslint/no-unsafe-call": "off",
10598
+ "@typescript-eslint/no-unsafe-member-access": "off",
10599
+ "@typescript-eslint/no-unsafe-return": "off",
10867
10600
  "@typescript-eslint/no-unused-vars": "off",
10868
10601
  "@typescript-eslint/no-use-before-define": "off",
10869
10602
  "@typescript-eslint/no-var-requires": "off",
10603
+ "@typescript-eslint/restrict-plus-operands": "off",
10604
+ "@typescript-eslint/restrict-template-expressions": "off",
10605
+ "@typescript-eslint/unbound-method": "off",
10870
10606
  "no-alert": "off",
10871
10607
  "no-console": "off",
10872
10608
  "no-undef": "off",
@@ -10893,7 +10629,6 @@ var n = async () => {
10893
10629
  {
10894
10630
  name: "jsse:n",
10895
10631
  plugins: {
10896
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10897
10632
  n: import_eslint_plugin_n.default
10898
10633
  },
10899
10634
  rules: {
@@ -11195,7 +10930,7 @@ function reactRules() {
11195
10930
  return: "parens-new-line"
11196
10931
  }
11197
10932
  ],
11198
- "react/no-access-state-in-setstate": "error",
10933
+ // "react/no-access-state-in-setstate": "error",
11199
10934
  "react/no-array-index-key": "error",
11200
10935
  "react/no-arrow-function-lifecycle": "error",
11201
10936
  "react/no-children-prop": "error",
@@ -11637,7 +11372,7 @@ var tailwind = async (options) => {
11637
11372
  ];
11638
11373
  };
11639
11374
 
11640
- // src/configs/test.ts
11375
+ // src/configs/no-only-tests.ts
11641
11376
  var noOnlyTests = async (options = {}) => {
11642
11377
  const { isInEditor: isInEditor2 = false, overrides = {} } = options;
11643
11378
  const pluginNoOnlyTests = await interopDefault2(
@@ -12257,20 +11992,8 @@ function jsseReact() {
12257
11992
  pluginImport,
12258
11993
  pluginN,
12259
11994
  pluginPerfectionist,
12260
- pluginSortKeys,
12261
11995
  pluginTs,
12262
11996
  pluginUnicorn,
12263
11997
  pluginUnusedImports,
12264
11998
  renameRules
12265
11999
  });
12266
- /*! Bundled license information:
12267
-
12268
- natural-compare/index.js:
12269
- (*
12270
- * @version 1.4.0
12271
- * @date 2015-10-26
12272
- * @stability 3 - Stable
12273
- * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
12274
- * @license MIT License
12275
- *)
12276
- */