@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/index.js CHANGED
@@ -24,285 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  mod
25
25
  ));
26
26
 
27
- // node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js
28
- var require_natural_compare = __commonJS({
29
- "node_modules/.pnpm/natural-compare@1.4.0/node_modules/natural-compare/index.js"(exports, module) {
30
- "use strict";
31
- var naturalCompare = function(a, b) {
32
- var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
33
- function getCode(str, pos, code) {
34
- if (code) {
35
- for (i = pos; code = getCode(str, i), code < 76 && code > 65; )
36
- ++i;
37
- return +str.slice(pos - 1, i);
38
- }
39
- code = alphabet && alphabet.indexOf(str.charAt(pos));
40
- 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;
41
- }
42
- if ((a += "") != (b += ""))
43
- for (; codeB; ) {
44
- codeA = getCode(a, posA++);
45
- codeB = getCode(b, posB++);
46
- if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
47
- codeA = getCode(a, posA, posA);
48
- codeB = getCode(b, posB, posA = i);
49
- posB = i;
50
- }
51
- if (codeA != codeB)
52
- return codeA < codeB ? -1 : 1;
53
- }
54
- return 0;
55
- };
56
- try {
57
- module.exports = naturalCompare;
58
- } catch (e) {
59
- String.naturalCompare = naturalCompare;
60
- }
61
- }
62
- });
63
-
64
- // node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js
65
- var require_sort_keys_fix = __commonJS({
66
- "node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/rules/sort-keys-fix.js"(exports, module) {
67
- "use strict";
68
- var naturalCompare = require_natural_compare();
69
- module.exports = {
70
- meta: {
71
- type: "suggestion",
72
- fixable: "code",
73
- docs: {
74
- description: "require object keys to be sorted",
75
- category: "Stylistic Issues",
76
- recommended: false,
77
- url: "https://github.com/namnm/eslint-plugin-sort-keys"
78
- },
79
- schema: [
80
- {
81
- enum: ["asc", "desc"]
82
- },
83
- {
84
- type: "object",
85
- properties: {
86
- caseSensitive: {
87
- type: "boolean",
88
- default: true
89
- },
90
- natural: {
91
- type: "boolean",
92
- default: false
93
- },
94
- minKeys: {
95
- type: "integer",
96
- minimum: 2,
97
- default: 2
98
- }
99
- },
100
- additionalProperties: false
101
- }
102
- ],
103
- messages: {
104
- sortKeys: "Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'."
105
- }
106
- },
107
- create(ctx) {
108
- const order = ctx.options[0] || "asc";
109
- const options = ctx.options[1];
110
- const insensitive = (options && options.caseSensitive) === false;
111
- const natural = Boolean(options && options.natural);
112
- const isValidOrder = isValidOrders[order + (insensitive ? "I" : "") + (natural ? "N" : "")];
113
- const minKeys = Number(options && options.minKeys) || 2;
114
- let stack = null;
115
- const SpreadElement = (node) => {
116
- if (node.parent.type === "ObjectExpression") {
117
- stack.prevName = null;
118
- }
119
- };
120
- return {
121
- ExperimentalSpreadProperty: SpreadElement,
122
- SpreadElement,
123
- ObjectExpression() {
124
- stack = {
125
- upper: stack,
126
- prevName: null,
127
- prevNode: null
128
- };
129
- },
130
- "ObjectExpression:exit"() {
131
- stack = stack.upper;
132
- },
133
- Property(node) {
134
- if (node.parent.type === "ObjectPattern") {
135
- return;
136
- }
137
- if (node.parent.properties.length < minKeys) {
138
- return;
139
- }
140
- const prevName = stack.prevName;
141
- const prevNode = stack.prevNode;
142
- const thisName = getPropertyName(node);
143
- if (thisName !== null) {
144
- stack.prevName = thisName;
145
- stack.prevNode = node || prevNode;
146
- }
147
- if (prevName === null || thisName === null) {
148
- return;
149
- }
150
- if (!isValidOrder(prevName, thisName)) {
151
- ctx.report({
152
- node,
153
- loc: node.key.loc,
154
- messageId: "sortKeys",
155
- data: {
156
- thisName,
157
- prevName,
158
- order,
159
- insensitive: insensitive ? "insensitive " : "",
160
- natural: natural ? "natural " : ""
161
- },
162
- fix(fixer) {
163
- if (node.parent.__alreadySorted || node.parent.properties.__alreadySorted) {
164
- return [];
165
- }
166
- node.parent.__alreadySorted = true;
167
- node.parent.properties.__alreadySorted = true;
168
- const src = ctx.getSourceCode();
169
- const props = node.parent.properties;
170
- const parts = [];
171
- let part = [];
172
- props.forEach((p) => {
173
- if (!p.key) {
174
- parts.push(part);
175
- part = [];
176
- } else {
177
- part.push(p);
178
- }
179
- });
180
- parts.push(part);
181
- parts.forEach((part2) => {
182
- part2.sort((p1, p2) => {
183
- const n1 = getPropertyName(p1);
184
- const n2 = getPropertyName(p2);
185
- if (insensitive && n1.toLowerCase() === n2.toLowerCase()) {
186
- return 0;
187
- }
188
- return isValidOrder(n1, n2) ? -1 : 1;
189
- });
190
- });
191
- const fixes = [];
192
- let newIndex = 0;
193
- parts.forEach((part2) => {
194
- part2.forEach((p) => {
195
- moveProperty(p, props[newIndex], fixer, src).forEach(
196
- (f) => fixes.push(f)
197
- );
198
- newIndex++;
199
- });
200
- newIndex++;
201
- });
202
- return fixes;
203
- }
204
- });
205
- }
206
- }
207
- };
208
- }
209
- };
210
- var moveProperty = (thisNode, toNode, fixer, src) => {
211
- if (thisNode === toNode) {
212
- return [];
213
- }
214
- const fixes = [];
215
- fixes.push(fixer.replaceText(toNode, src.getText(thisNode)));
216
- const prev = findTokenPrevLine(thisNode, src);
217
- const cond = (c) => !prev || prev.loc.end.line !== c.loc.start.line;
218
- const commentsBefore = src.getCommentsBefore(thisNode).filter(cond);
219
- if (commentsBefore.length) {
220
- const prevComments = src.getCommentsBefore(thisNode).filter((c) => !cond(c));
221
- const b = prevComments.length ? prevComments[prevComments.length - 1].range[1] : prev ? prev.range[1] : commentsBefore[0].range[0];
222
- const e = commentsBefore[commentsBefore.length - 1].range[1];
223
- fixes.push(fixer.replaceTextRange([b, e], ""));
224
- const toPrev = src.getTokenBefore(toNode, { includeComments: true });
225
- const txt = src.text.substring(b, e);
226
- fixes.push(fixer.insertTextAfter(toPrev, txt));
227
- }
228
- const next = findCommaSameLine(thisNode, src) || thisNode;
229
- const commentsAfter = src.getCommentsAfter(next).filter((c) => thisNode.loc.end.line === c.loc.start.line);
230
- if (commentsAfter.length) {
231
- const b = next.range[1];
232
- const e = commentsAfter[commentsAfter.length - 1].range[1];
233
- fixes.push(fixer.replaceTextRange([b, e], ""));
234
- const toNext = findCommaSameLine(toNode, src) || toNode;
235
- const txt = src.text.substring(b, e);
236
- fixes.push(fixer.insertTextAfter(toNext, txt));
237
- }
238
- return fixes;
239
- };
240
- var findTokenPrevLine = (node, src) => {
241
- let t = src.getTokenBefore(node);
242
- while (true) {
243
- if (!t || t.range[0] < node.parent.range[0]) {
244
- return null;
245
- }
246
- if (t.loc.end.line < node.loc.start.line) {
247
- return t;
248
- }
249
- t = src.getTokenBefore(t);
250
- }
251
- };
252
- var findCommaSameLine = (node, src) => {
253
- const t = src.getTokenAfter(node);
254
- return t && t.value === "," && node.loc.end.line === t.loc.start.line ? t : null;
255
- };
256
- var isValidOrders = {
257
- asc: (a, b) => a <= b,
258
- ascI: (a, b) => a.toLowerCase() <= b.toLowerCase(),
259
- ascN: (a, b) => naturalCompare(a, b) <= 0,
260
- ascIN: (a, b) => naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0,
261
- desc: (a, b) => isValidOrders.asc(b, a),
262
- descI: (a, b) => isValidOrders.ascI(b, a),
263
- descN: (a, b) => isValidOrders.ascN(b, a),
264
- descIN: (a, b) => isValidOrders.ascIN(b, a)
265
- };
266
- var getPropertyName = (node) => {
267
- let prop;
268
- switch (node && node.type) {
269
- case "Property":
270
- case "MethodDefinition":
271
- prop = node.key;
272
- break;
273
- case "MemberExpression":
274
- prop = node.property;
275
- break;
276
- }
277
- switch (prop && prop.type) {
278
- case "Literal":
279
- return String(prop.value);
280
- case "TemplateLiteral":
281
- if (prop.expressions.length === 0 && prop.quasis.length === 1) {
282
- return prop.quasis[0].value.cooked;
283
- }
284
- break;
285
- case "Identifier":
286
- if (!node.computed) {
287
- return prop.name;
288
- }
289
- break;
290
- }
291
- return node.key && node.key.name || null;
292
- };
293
- }
294
- });
295
-
296
- // node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js
297
- var require_eslint_plugin_sort_keys = __commonJS({
298
- "node_modules/.pnpm/eslint-plugin-sort-keys@2.3.5/node_modules/eslint-plugin-sort-keys/index.js"(exports, module) {
299
- "use strict";
300
- module.exports.rules = {
301
- "sort-keys-fix": require_sort_keys_fix()
302
- };
303
- }
304
- });
305
-
306
27
  // node_modules/.pnpm/globals@15.0.0/node_modules/globals/globals.json
307
28
  var require_globals = __commonJS({
308
29
  "node_modules/.pnpm/globals@15.0.0/node_modules/globals/globals.json"(exports, module) {
@@ -9777,7 +9498,6 @@ function isInEditor() {
9777
9498
  }
9778
9499
 
9779
9500
  // src/plugins.ts
9780
- var pluginSortKeys = __toESM(require_eslint_plugin_sort_keys(), 1);
9781
9501
  import { default as default2 } from "eslint-plugin-antfu";
9782
9502
  import { default as default3 } from "eslint-plugin-eslint-comments";
9783
9503
  import * as pluginImport from "eslint-plugin-import-x";
@@ -10194,6 +9914,7 @@ var javascript = async (options) => {
10194
9914
  {
10195
9915
  args: "after-used",
10196
9916
  argsIgnorePattern: "^_",
9917
+ ignoreRestSiblings: true,
10197
9918
  vars: "all",
10198
9919
  varsIgnorePattern: "^_"
10199
9920
  }
@@ -10351,7 +10072,7 @@ function typescriptRulesTypeAware() {
10351
10072
  "@typescript-eslint/no-unnecessary-type-assertion": "error",
10352
10073
  "@typescript-eslint/no-useless-template-literals": "error",
10353
10074
  "no-throw-literal": "off",
10354
- "@typescript-eslint/no-throw-literal": "error",
10075
+ "@typescript-eslint/only-throw-error": "error",
10355
10076
  "@typescript-eslint/no-unsafe-argument": "error",
10356
10077
  "@typescript-eslint/no-unsafe-assignment": "error",
10357
10078
  "@typescript-eslint/no-unsafe-call": "error",
@@ -10792,13 +10513,29 @@ var markdown = async (options) => {
10792
10513
  },
10793
10514
  name: "jsse:markdown:rules",
10794
10515
  rules: {
10516
+ "@typescript-eslint/await-thenable": "off",
10795
10517
  "@typescript-eslint/consistent-type-imports": "off",
10518
+ "@typescript-eslint/dot-notation": "off",
10519
+ "@typescript-eslint/no-floating-promises": "off",
10520
+ "@typescript-eslint/no-for-in-array": "off",
10521
+ "@typescript-eslint/no-implied-eval": "off",
10522
+ "@typescript-eslint/no-misused-promises": "off",
10796
10523
  "@typescript-eslint/no-namespace": "off",
10797
10524
  "@typescript-eslint/no-redeclare": "off",
10798
10525
  "@typescript-eslint/no-require-imports": "off",
10526
+ "@typescript-eslint/no-throw-literal": "off",
10527
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
10528
+ "@typescript-eslint/no-unsafe-argument": "off",
10529
+ "@typescript-eslint/no-unsafe-assignment": "off",
10530
+ "@typescript-eslint/no-unsafe-call": "off",
10531
+ "@typescript-eslint/no-unsafe-member-access": "off",
10532
+ "@typescript-eslint/no-unsafe-return": "off",
10799
10533
  "@typescript-eslint/no-unused-vars": "off",
10800
10534
  "@typescript-eslint/no-use-before-define": "off",
10801
10535
  "@typescript-eslint/no-var-requires": "off",
10536
+ "@typescript-eslint/restrict-plus-operands": "off",
10537
+ "@typescript-eslint/restrict-template-expressions": "off",
10538
+ "@typescript-eslint/unbound-method": "off",
10802
10539
  "no-alert": "off",
10803
10540
  "no-console": "off",
10804
10541
  "no-undef": "off",
@@ -10825,7 +10562,6 @@ var n = async () => {
10825
10562
  {
10826
10563
  name: "jsse:n",
10827
10564
  plugins: {
10828
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
10829
10565
  n: default4
10830
10566
  },
10831
10567
  rules: {
@@ -11127,7 +10863,7 @@ function reactRules() {
11127
10863
  return: "parens-new-line"
11128
10864
  }
11129
10865
  ],
11130
- "react/no-access-state-in-setstate": "error",
10866
+ // "react/no-access-state-in-setstate": "error",
11131
10867
  "react/no-array-index-key": "error",
11132
10868
  "react/no-arrow-function-lifecycle": "error",
11133
10869
  "react/no-children-prop": "error",
@@ -11569,7 +11305,7 @@ var tailwind = async (options) => {
11569
11305
  ];
11570
11306
  };
11571
11307
 
11572
- // src/configs/test.ts
11308
+ // src/configs/no-only-tests.ts
11573
11309
  var noOnlyTests = async (options = {}) => {
11574
11310
  const { isInEditor: isInEditor2 = false, overrides = {} } = options;
11575
11311
  const pluginNoOnlyTests = await interopDefault2(
@@ -12189,20 +11925,8 @@ export {
12189
11925
  pluginImport,
12190
11926
  default4 as pluginN,
12191
11927
  default5 as pluginPerfectionist,
12192
- pluginSortKeys,
12193
11928
  default8 as pluginTs,
12194
11929
  default6 as pluginUnicorn,
12195
11930
  default7 as pluginUnusedImports,
12196
11931
  renameRules
12197
11932
  };
12198
- /*! Bundled license information:
12199
-
12200
- natural-compare/index.js:
12201
- (*
12202
- * @version 1.4.0
12203
- * @date 2015-10-26
12204
- * @stability 3 - Stable
12205
- * @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
12206
- * @license MIT License
12207
- *)
12208
- */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jsse/eslint-config",
3
3
  "type": "module",
4
- "version": "0.1.8",
4
+ "version": "0.1.10",
5
5
  "packageManager": "pnpm@8.15.4",
6
6
  "description": "jsse eslint config",
7
7
  "author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
@@ -62,17 +62,17 @@
62
62
  "dependencies": {
63
63
  "@eslint/js": "~8.57.0",
64
64
  "@stylistic/eslint-plugin": "1.7.0",
65
- "@typescript-eslint/eslint-plugin": "^7.5.0",
66
- "@typescript-eslint/parser": "^7.5.0",
65
+ "@typescript-eslint/eslint-plugin": "^7.6.0",
66
+ "@typescript-eslint/parser": "^7.6.0",
67
67
  "eslint-config-flat-gitignore": "^0.1.5",
68
68
  "eslint-define-config": "^2.1.0",
69
69
  "eslint-plugin-antfu": "^2.1.2",
70
70
  "eslint-plugin-eslint-comments": "^3.2.0",
71
71
  "eslint-plugin-import-x": "^0.5.0",
72
- "eslint-plugin-jsdoc": "^48.2.2",
72
+ "eslint-plugin-jsdoc": "^48.2.3",
73
73
  "eslint-plugin-jsonc": "^2.15.0",
74
74
  "eslint-plugin-markdown": "^4.0.1",
75
- "eslint-plugin-n": "^16.6.2",
75
+ "eslint-plugin-n": "^17.2.0",
76
76
  "eslint-plugin-no-only-tests": "^3.1.0",
77
77
  "eslint-plugin-perfectionist": "^2.8.0",
78
78
  "eslint-plugin-react": "~7.34.1",
@@ -82,11 +82,11 @@
82
82
  "eslint-plugin-toml": "^0.11.0",
83
83
  "eslint-plugin-unicorn": "^52.0.0",
84
84
  "eslint-plugin-unused-imports": "^3.1.0",
85
- "eslint-plugin-vitest": "^0.4.1",
85
+ "eslint-plugin-vitest": "0.5.1",
86
86
  "eslint-plugin-yml": "^1.14.0",
87
87
  "jsonc-eslint-parser": "^2.4.0",
88
88
  "toml-eslint-parser": "^0.9.3",
89
- "typescript-eslint": "^7.5.0",
89
+ "typescript-eslint": "^7.6.0",
90
90
  "yaml-eslint-parser": "^1.2.2"
91
91
  },
92
92
  "optionalDependencies": {
@@ -98,13 +98,12 @@
98
98
  "@types/eslint": "^8.56.7",
99
99
  "@types/eslint__js": "~8.42.3",
100
100
  "@types/fs-extra": "^11.0.4",
101
- "@types/node": "^20.12.3",
101
+ "@types/node": "^20.12.7",
102
102
  "bumpp": "^9.4.0",
103
103
  "cac": "^6.7.14",
104
104
  "eslint": "^8.57.0",
105
- "eslint-flat-config-utils": "^0.2.0",
106
- "eslint-plugin-sort-keys": "^2.3.5",
107
- "eslint-typegen": "^0.2.0",
105
+ "eslint-flat-config-utils": "^0.2.1",
106
+ "eslint-typegen": "^0.2.2",
108
107
  "execa": "~8.0.1",
109
108
  "fast-glob": "^3.3.2",
110
109
  "fs-extra": "^11.2.0",
@@ -114,17 +113,15 @@
114
113
  "react": "~18.2.0",
115
114
  "rimraf": "^5.0.5",
116
115
  "tsup": "^8.0.2",
117
- "tsx": "^4.7.1",
118
- "typescript": "~5.4.3",
116
+ "tsx": "^4.7.2",
117
+ "typescript": "~5.4.5",
119
118
  "vitest": "^1.4.0"
120
119
  },
121
120
  "prettier": "@jsse/prettier-config",
122
121
  "scripts": {
123
122
  "build": "pnpm gen && pnpm build-fast --dts && pnpm typecheck && eslint .",
124
123
  "build-fast": "tsup src/index.ts src/cli.ts --format esm,cjs --clean",
125
- "gen": "pnpm gen:types && pnpm gen:typesv2",
126
- "gen:types": "tsx scripts/typegen.ts && prettier -w src/dts/typegen.d.ts",
127
- "gen:typesv2": "tsx scripts/typegen-v2.ts && prettier -w src/generated/",
124
+ "gen": "tsx scripts/gen.ts && prettier -w src",
128
125
  "dev": "tsup src/index.ts --format esm,cjs --watch",
129
126
  "fmt": "prettier -w .",
130
127
  "fmtc": "prettier --check .",