@solvro/config 1.9.0 → 1.10.1
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 +15 -133
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +249 -214
- package/dist/cli/index.js.map +1 -0
- package/dist/commitlint/index.d.ts +5 -0
- package/dist/commitlint/index.js +35 -0
- package/dist/commitlint/index.js.map +1 -0
- package/dist/prettier/index.d.ts +18 -0
- package/dist/prettier/index.js +1 -0
- package/dist/prettier/index.js.map +1 -0
- package/package.json +9 -4
- package/dist/eslint/index.cjs +0 -985
- package/dist/eslint/index.cjs.map +0 -1
- package/dist/eslint/index.d.cts +0 -6
package/dist/eslint/index.cjs
DELETED
@@ -1,985 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __create = Object.create;
|
3
|
-
var __defProp = Object.defineProperty;
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
-
var __export = (target, all) => {
|
9
|
-
for (var name in all)
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
-
};
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
-
for (let key of __getOwnPropNames(from))
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
-
}
|
18
|
-
return to;
|
19
|
-
};
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
-
mod
|
27
|
-
));
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
|
30
|
-
// src/eslint/index.ts
|
31
|
-
var eslint_exports = {};
|
32
|
-
__export(eslint_exports, {
|
33
|
-
solvro: () => solvro
|
34
|
-
});
|
35
|
-
module.exports = __toCommonJS(eslint_exports);
|
36
|
-
var import_find_up_simple = require("find-up-simple");
|
37
|
-
var import_local_pkg2 = require("local-pkg");
|
38
|
-
var import_node_path = __toESM(require("path"), 1);
|
39
|
-
var import_typescript_eslint4 = __toESM(require("typescript-eslint"), 1);
|
40
|
-
var import_eslint_config = require("@adonisjs/eslint-config");
|
41
|
-
|
42
|
-
// src/eslint/configs/a11y.ts
|
43
|
-
var import_eslint_plugin_jsx_a11y = __toESM(require("eslint-plugin-jsx-a11y"), 1);
|
44
|
-
var import_globals = __toESM(require("globals"), 1);
|
45
|
-
function a11y() {
|
46
|
-
return [
|
47
|
-
{
|
48
|
-
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
50
|
-
...import_eslint_plugin_jsx_a11y.default.flatConfigs.recommended,
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
52
|
-
languageOptions: {
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
54
|
-
...import_eslint_plugin_jsx_a11y.default.flatConfigs.recommended.languageOptions,
|
55
|
-
globals: {
|
56
|
-
...import_globals.default.serviceworker,
|
57
|
-
...import_globals.default.browser
|
58
|
-
}
|
59
|
-
},
|
60
|
-
settings: {
|
61
|
-
"jsx-a11y": {
|
62
|
-
components: {
|
63
|
-
Input: "input",
|
64
|
-
Button: "button",
|
65
|
-
Link: "a",
|
66
|
-
Label: "label",
|
67
|
-
Select: "select",
|
68
|
-
Textarea: "textarea"
|
69
|
-
},
|
70
|
-
attributes: {
|
71
|
-
for: ["htmlFor", "for"]
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
}
|
76
|
-
];
|
77
|
-
}
|
78
|
-
|
79
|
-
// src/eslint/plugins.ts
|
80
|
-
var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
81
|
-
var import_eslint_plugin_antfu = __toESM(require("eslint-plugin-antfu"), 1);
|
82
|
-
var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
|
83
|
-
var import_eslint_plugin_n = __toESM(require("eslint-plugin-n"), 1);
|
84
|
-
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
85
|
-
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
86
|
-
|
87
|
-
// src/eslint/configs/comments.ts
|
88
|
-
function comments() {
|
89
|
-
return [
|
90
|
-
{
|
91
|
-
name: "solvro/eslint-comments/rules",
|
92
|
-
plugins: {
|
93
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
94
|
-
"eslint-comments": import_eslint_plugin_eslint_comments.default
|
95
|
-
},
|
96
|
-
rules: {
|
97
|
-
"eslint-comments/no-aggregating-enable": "error",
|
98
|
-
"eslint-comments/no-duplicate-disable": "error",
|
99
|
-
"eslint-comments/no-unlimited-disable": "error",
|
100
|
-
"eslint-comments/no-unused-enable": "error"
|
101
|
-
}
|
102
|
-
}
|
103
|
-
];
|
104
|
-
}
|
105
|
-
|
106
|
-
// src/eslint/configs/disables.ts
|
107
|
-
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
108
|
-
|
109
|
-
// src/eslint/globs.ts
|
110
|
-
var GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
111
|
-
var GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
112
|
-
var GLOB_EXCLUDE = [
|
113
|
-
"**/node_modules",
|
114
|
-
"**/dist",
|
115
|
-
"**/package-lock.json",
|
116
|
-
"**/yarn.lock",
|
117
|
-
"**/pnpm-lock.yaml",
|
118
|
-
"**/bun.lockb",
|
119
|
-
"**/build",
|
120
|
-
"**/output",
|
121
|
-
"**/coverage",
|
122
|
-
"**/temp",
|
123
|
-
"**/.temp",
|
124
|
-
"**/tmp",
|
125
|
-
"**/.tmp",
|
126
|
-
"**/.history",
|
127
|
-
"**/.vitepress/cache",
|
128
|
-
"**/.nuxt",
|
129
|
-
"**/.next",
|
130
|
-
"**/.svelte-kit",
|
131
|
-
"**/.vercel",
|
132
|
-
"**/.changeset",
|
133
|
-
"**/.idea",
|
134
|
-
"**/.cache",
|
135
|
-
"**/.output",
|
136
|
-
"**/.vite-inspect",
|
137
|
-
"**/.yarn",
|
138
|
-
"**/vite.config.*.timestamp-*",
|
139
|
-
"**/CHANGELOG*.md",
|
140
|
-
"**/*.min.*",
|
141
|
-
"**/LICENSE*",
|
142
|
-
"**/__snapshots__",
|
143
|
-
"**/auto-import?(s).d.ts",
|
144
|
-
"**/components.d.ts"
|
145
|
-
];
|
146
|
-
|
147
|
-
// src/eslint/configs/disables.ts
|
148
|
-
function disables() {
|
149
|
-
return [
|
150
|
-
{
|
151
|
-
files: [`**/scripts/${GLOB_SRC}`],
|
152
|
-
name: "solvro/disables/scripts",
|
153
|
-
rules: {
|
154
|
-
"antfu/no-top-level-await": "off",
|
155
|
-
"no-console": "off",
|
156
|
-
"@typescript-eslint/explicit-function-return-type": "off"
|
157
|
-
}
|
158
|
-
},
|
159
|
-
{
|
160
|
-
rules: {
|
161
|
-
"prettier/prettier": "off"
|
162
|
-
}
|
163
|
-
},
|
164
|
-
{
|
165
|
-
files: [`**/cli/${GLOB_SRC}`, `**/cli.${GLOB_SRC_EXT}`],
|
166
|
-
name: "solvro/disables/cli",
|
167
|
-
rules: {
|
168
|
-
"antfu/no-top-level-await": "off",
|
169
|
-
"no-console": "off"
|
170
|
-
}
|
171
|
-
},
|
172
|
-
{
|
173
|
-
files: ["**/bin/**/*", `**/bin.${GLOB_SRC_EXT}`],
|
174
|
-
name: "solvro/disables/bin",
|
175
|
-
rules: {
|
176
|
-
"antfu/no-import-dist": "off",
|
177
|
-
"antfu/no-import-node-modules-by-path": "off"
|
178
|
-
}
|
179
|
-
},
|
180
|
-
{
|
181
|
-
files: ["**/*.d.?([cm])ts"],
|
182
|
-
name: "solvro/disables/dts",
|
183
|
-
rules: {
|
184
|
-
"eslint-comments/no-unlimited-disable": "off",
|
185
|
-
"import-x/no-duplicates": "off",
|
186
|
-
"no-restricted-syntax": "off",
|
187
|
-
"unused-imports/no-unused-vars": "off"
|
188
|
-
}
|
189
|
-
},
|
190
|
-
{
|
191
|
-
files: ["**/*.js", "**/*.cjs"],
|
192
|
-
name: "solvro/disables/cjs",
|
193
|
-
rules: {
|
194
|
-
"@typescript-eslint/no-require-imports": "off"
|
195
|
-
}
|
196
|
-
},
|
197
|
-
{
|
198
|
-
files: [`**/*.config.${GLOB_SRC_EXT}`, `**/*.config.*.${GLOB_SRC_EXT}`],
|
199
|
-
name: "solvro/disables/config-files",
|
200
|
-
rules: {
|
201
|
-
"antfu/no-top-level-await": "off",
|
202
|
-
"no-console": "off",
|
203
|
-
"@typescript-eslint/explicit-function-return-type": "off"
|
204
|
-
}
|
205
|
-
},
|
206
|
-
{
|
207
|
-
files: ["**/*.js"],
|
208
|
-
extends: [import_typescript_eslint.default.configs.disableTypeChecked]
|
209
|
-
}
|
210
|
-
];
|
211
|
-
}
|
212
|
-
|
213
|
-
// src/eslint/configs/formatters.ts
|
214
|
-
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
215
|
-
function formatters() {
|
216
|
-
return [
|
217
|
-
{
|
218
|
-
name: "solvro/prettier",
|
219
|
-
rules: {
|
220
|
-
...import_eslint_config_prettier.default.rules,
|
221
|
-
curly: "error"
|
222
|
-
}
|
223
|
-
}
|
224
|
-
];
|
225
|
-
}
|
226
|
-
|
227
|
-
// src/eslint/configs/ignores.ts
|
228
|
-
function ignores() {
|
229
|
-
return [
|
230
|
-
{
|
231
|
-
ignores: [...GLOB_EXCLUDE],
|
232
|
-
name: "solvro/ignores"
|
233
|
-
}
|
234
|
-
];
|
235
|
-
}
|
236
|
-
|
237
|
-
// src/eslint/configs/imports.ts
|
238
|
-
function imports(options = { forbidDefaultExport: false }) {
|
239
|
-
const config = [
|
240
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
241
|
-
import_eslint_plugin_import.default.flatConfigs.typescript,
|
242
|
-
{
|
243
|
-
name: "solvro/imports/rules",
|
244
|
-
plugins: {
|
245
|
-
antfu: import_eslint_plugin_antfu.default,
|
246
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
247
|
-
import: import_eslint_plugin_import.default
|
248
|
-
},
|
249
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
250
|
-
rules: {
|
251
|
-
"antfu/import-dedupe": "error",
|
252
|
-
"antfu/no-import-dist": "error",
|
253
|
-
"antfu/no-import-node-modules-by-path": "error",
|
254
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
255
|
-
...import_eslint_plugin_import.default.flatConfigs.recommended.rules,
|
256
|
-
"import/no-dynamic-require": "warn",
|
257
|
-
"import/no-unresolved": "off",
|
258
|
-
"import/consistent-type-specifier-style": "warn",
|
259
|
-
"@typescript-eslint/no-restricted-imports": [
|
260
|
-
"error",
|
261
|
-
{
|
262
|
-
paths: [
|
263
|
-
{
|
264
|
-
name: "axios",
|
265
|
-
message: "Please use fetch instead"
|
266
|
-
}
|
267
|
-
]
|
268
|
-
}
|
269
|
-
]
|
270
|
-
}
|
271
|
-
}
|
272
|
-
];
|
273
|
-
if (options.forbidDefaultExport) {
|
274
|
-
config.push(
|
275
|
-
{
|
276
|
-
"import/no-default-export": "error"
|
277
|
-
},
|
278
|
-
{
|
279
|
-
files: [
|
280
|
-
"tsup.config.*",
|
281
|
-
"eslint.config.*",
|
282
|
-
".commitlintrc.*",
|
283
|
-
"knip.*",
|
284
|
-
"next.config.*",
|
285
|
-
"commitlint.config.*",
|
286
|
-
".releaserc.*"
|
287
|
-
],
|
288
|
-
rules: {
|
289
|
-
"import/no-default-export": "off"
|
290
|
-
}
|
291
|
-
}
|
292
|
-
);
|
293
|
-
}
|
294
|
-
return config;
|
295
|
-
}
|
296
|
-
|
297
|
-
// src/eslint/configs/javascript.ts
|
298
|
-
var import_js = __toESM(require("@eslint/js"), 1);
|
299
|
-
var import_globals2 = __toESM(require("globals"), 1);
|
300
|
-
function javascript() {
|
301
|
-
return [
|
302
|
-
{
|
303
|
-
languageOptions: {
|
304
|
-
ecmaVersion: 2022,
|
305
|
-
globals: {
|
306
|
-
...import_globals2.default.browser,
|
307
|
-
...import_globals2.default.es2021,
|
308
|
-
...import_globals2.default.node,
|
309
|
-
document: "readonly",
|
310
|
-
navigator: "readonly",
|
311
|
-
window: "readonly"
|
312
|
-
},
|
313
|
-
parserOptions: {
|
314
|
-
ecmaFeatures: {
|
315
|
-
jsx: true
|
316
|
-
},
|
317
|
-
ecmaVersion: 2022,
|
318
|
-
sourceType: "module"
|
319
|
-
},
|
320
|
-
sourceType: "module"
|
321
|
-
},
|
322
|
-
linterOptions: {
|
323
|
-
reportUnusedDisableDirectives: true
|
324
|
-
},
|
325
|
-
name: "solvro/javascript/setup"
|
326
|
-
},
|
327
|
-
{
|
328
|
-
name: "solvro/javascript/rules",
|
329
|
-
plugins: {
|
330
|
-
antfu: import_eslint_plugin_antfu.default,
|
331
|
-
"unused-imports": import_eslint_plugin_unused_imports.default
|
332
|
-
},
|
333
|
-
rules: {
|
334
|
-
...import_js.default.configs.recommended.rules,
|
335
|
-
"accessor-pairs": [
|
336
|
-
"error",
|
337
|
-
{ enforceForClassMembers: true, setWithoutGet: true }
|
338
|
-
],
|
339
|
-
curly: "error",
|
340
|
-
"array-callback-return": "error",
|
341
|
-
"block-scoped-var": "error",
|
342
|
-
"constructor-super": "error",
|
343
|
-
"default-case-last": "error",
|
344
|
-
"dot-notation": ["error", { allowKeywords: true }],
|
345
|
-
eqeqeq: ["error", "smart"],
|
346
|
-
"new-cap": [
|
347
|
-
"error",
|
348
|
-
{ capIsNew: false, newIsCap: true, properties: true }
|
349
|
-
],
|
350
|
-
"no-alert": "error",
|
351
|
-
"no-array-constructor": "error",
|
352
|
-
"no-async-promise-executor": "error",
|
353
|
-
"no-caller": "error",
|
354
|
-
"no-case-declarations": "error",
|
355
|
-
"no-class-assign": "error",
|
356
|
-
"no-compare-neg-zero": "error",
|
357
|
-
"no-cond-assign": ["error", "always"],
|
358
|
-
"no-console": ["error", { allow: ["warn", "error"] }],
|
359
|
-
"no-const-assign": "error",
|
360
|
-
"no-control-regex": "error",
|
361
|
-
"no-debugger": "error",
|
362
|
-
"no-delete-var": "error",
|
363
|
-
"no-dupe-args": "error",
|
364
|
-
"no-dupe-class-members": "error",
|
365
|
-
"no-dupe-keys": "error",
|
366
|
-
"no-duplicate-case": "error",
|
367
|
-
"no-empty": ["error", { allowEmptyCatch: true }],
|
368
|
-
"no-empty-character-class": "error",
|
369
|
-
"no-empty-pattern": "error",
|
370
|
-
"no-eval": "error",
|
371
|
-
"no-ex-assign": "error",
|
372
|
-
"no-extend-native": "error",
|
373
|
-
"no-extra-bind": "error",
|
374
|
-
"no-extra-boolean-cast": "error",
|
375
|
-
"no-fallthrough": "error",
|
376
|
-
"no-func-assign": "error",
|
377
|
-
"no-global-assign": "error",
|
378
|
-
"no-implied-eval": "error",
|
379
|
-
"no-import-assign": "error",
|
380
|
-
"no-invalid-regexp": "error",
|
381
|
-
"no-irregular-whitespace": "error",
|
382
|
-
"no-iterator": "error",
|
383
|
-
"no-labels": ["error", { allowLoop: false, allowSwitch: false }],
|
384
|
-
"no-lone-blocks": "error",
|
385
|
-
"no-loss-of-precision": "error",
|
386
|
-
"no-misleading-character-class": "error",
|
387
|
-
"no-multi-str": "error",
|
388
|
-
"no-new": "error",
|
389
|
-
"no-new-func": "error",
|
390
|
-
"no-new-native-nonconstructor": "error",
|
391
|
-
"no-new-wrappers": "error",
|
392
|
-
"no-obj-calls": "error",
|
393
|
-
"no-octal": "error",
|
394
|
-
"no-octal-escape": "error",
|
395
|
-
"no-proto": "error",
|
396
|
-
"no-prototype-builtins": "error",
|
397
|
-
"no-redeclare": ["error", { builtinGlobals: false }],
|
398
|
-
"no-regex-spaces": "error",
|
399
|
-
"no-restricted-globals": [
|
400
|
-
"error",
|
401
|
-
{ message: "Use `globalThis` instead.", name: "global" },
|
402
|
-
{ message: "Use `globalThis` instead.", name: "self" }
|
403
|
-
],
|
404
|
-
"no-restricted-properties": [
|
405
|
-
"error",
|
406
|
-
{
|
407
|
-
message: "Use `Object.getPrototypeOf` or `Object.setPrototypeOf` instead.",
|
408
|
-
property: "__proto__"
|
409
|
-
},
|
410
|
-
{
|
411
|
-
message: "Use `Object.defineProperty` instead.",
|
412
|
-
property: "__defineGetter__"
|
413
|
-
},
|
414
|
-
{
|
415
|
-
message: "Use `Object.defineProperty` instead.",
|
416
|
-
property: "__defineSetter__"
|
417
|
-
},
|
418
|
-
{
|
419
|
-
message: "Use `Object.getOwnPropertyDescriptor` instead.",
|
420
|
-
property: "__lookupGetter__"
|
421
|
-
},
|
422
|
-
{
|
423
|
-
message: "Use `Object.getOwnPropertyDescriptor` instead.",
|
424
|
-
property: "__lookupSetter__"
|
425
|
-
}
|
426
|
-
],
|
427
|
-
"no-restricted-syntax": [
|
428
|
-
"error",
|
429
|
-
"TSEnumDeclaration[const=true]",
|
430
|
-
"TSExportAssignment"
|
431
|
-
],
|
432
|
-
"no-self-assign": ["error", { props: true }],
|
433
|
-
"no-self-compare": "error",
|
434
|
-
"no-sequences": "error",
|
435
|
-
"no-shadow-restricted-names": "error",
|
436
|
-
"no-sparse-arrays": "error",
|
437
|
-
"no-template-curly-in-string": "error",
|
438
|
-
"no-this-before-super": "error",
|
439
|
-
"no-throw-literal": "error",
|
440
|
-
"no-undef-init": "error",
|
441
|
-
"no-unexpected-multiline": "error",
|
442
|
-
"no-unmodified-loop-condition": "error",
|
443
|
-
"no-unneeded-ternary": ["error", { defaultAssignment: false }],
|
444
|
-
"no-unreachable": "error",
|
445
|
-
"no-unreachable-loop": "error",
|
446
|
-
"no-unsafe-finally": "error",
|
447
|
-
"no-unsafe-negation": "error",
|
448
|
-
"no-unused-expressions": [
|
449
|
-
"error",
|
450
|
-
{
|
451
|
-
allowShortCircuit: true,
|
452
|
-
allowTaggedTemplates: true,
|
453
|
-
allowTernary: true
|
454
|
-
}
|
455
|
-
],
|
456
|
-
"no-useless-backreference": "error",
|
457
|
-
"no-useless-call": "error",
|
458
|
-
"no-useless-catch": "error",
|
459
|
-
"no-useless-computed-key": "error",
|
460
|
-
"no-useless-constructor": "error",
|
461
|
-
"no-useless-rename": "error",
|
462
|
-
"no-useless-return": "error",
|
463
|
-
"no-var": "error",
|
464
|
-
"no-with": "error",
|
465
|
-
"object-shorthand": [
|
466
|
-
"error",
|
467
|
-
"always",
|
468
|
-
{
|
469
|
-
avoidQuotes: true,
|
470
|
-
ignoreConstructors: false
|
471
|
-
}
|
472
|
-
],
|
473
|
-
"one-var": ["error", { initialized: "never" }],
|
474
|
-
"prefer-arrow-callback": [
|
475
|
-
"error",
|
476
|
-
{
|
477
|
-
allowNamedFunctions: false,
|
478
|
-
allowUnboundThis: true
|
479
|
-
}
|
480
|
-
],
|
481
|
-
"prefer-const": [
|
482
|
-
"error",
|
483
|
-
{
|
484
|
-
destructuring: "all",
|
485
|
-
ignoreReadBeforeAssign: true
|
486
|
-
}
|
487
|
-
],
|
488
|
-
"prefer-exponentiation-operator": "error",
|
489
|
-
"prefer-promise-reject-errors": "error",
|
490
|
-
"prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
|
491
|
-
"prefer-rest-params": "error",
|
492
|
-
"prefer-spread": "error",
|
493
|
-
"prefer-template": "error",
|
494
|
-
"symbol-description": "error",
|
495
|
-
"unicode-bom": ["error", "never"],
|
496
|
-
"unused-imports/no-unused-imports": "error",
|
497
|
-
"unused-imports/no-unused-vars": [
|
498
|
-
"error",
|
499
|
-
{
|
500
|
-
args: "after-used",
|
501
|
-
argsIgnorePattern: "^_",
|
502
|
-
ignoreRestSiblings: true,
|
503
|
-
vars: "all",
|
504
|
-
varsIgnorePattern: "^_"
|
505
|
-
}
|
506
|
-
],
|
507
|
-
"use-isnan": [
|
508
|
-
"error",
|
509
|
-
{ enforceForIndexOf: true, enforceForSwitchCase: true }
|
510
|
-
],
|
511
|
-
"valid-typeof": ["error", { requireStringLiterals: true }],
|
512
|
-
"vars-on-top": "error",
|
513
|
-
yoda: ["error", "never"]
|
514
|
-
}
|
515
|
-
}
|
516
|
-
];
|
517
|
-
}
|
518
|
-
|
519
|
-
// src/eslint/configs/jsdoc.ts
|
520
|
-
var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
|
521
|
-
function jsdoc() {
|
522
|
-
return [
|
523
|
-
{
|
524
|
-
name: "solvro/jsdoc/rules",
|
525
|
-
plugins: {
|
526
|
-
jsdoc: import_eslint_plugin_jsdoc.default
|
527
|
-
},
|
528
|
-
rules: {
|
529
|
-
"jsdoc/check-access": "warn",
|
530
|
-
"jsdoc/check-param-names": "warn",
|
531
|
-
"jsdoc/check-property-names": "warn",
|
532
|
-
"jsdoc/check-types": "warn",
|
533
|
-
"jsdoc/empty-tags": "warn",
|
534
|
-
"jsdoc/implements-on-classes": "warn",
|
535
|
-
"jsdoc/no-defaults": "warn",
|
536
|
-
"jsdoc/no-multi-asterisks": "warn",
|
537
|
-
"jsdoc/require-param-name": "warn",
|
538
|
-
"jsdoc/require-property": "warn",
|
539
|
-
"jsdoc/require-property-description": "warn",
|
540
|
-
"jsdoc/require-property-name": "warn",
|
541
|
-
"jsdoc/require-returns-check": "warn",
|
542
|
-
"jsdoc/require-returns-description": "warn",
|
543
|
-
"jsdoc/require-yields-check": "warn"
|
544
|
-
}
|
545
|
-
}
|
546
|
-
];
|
547
|
-
}
|
548
|
-
|
549
|
-
// src/eslint/configs/node.ts
|
550
|
-
function node() {
|
551
|
-
return [
|
552
|
-
{
|
553
|
-
name: "solvro/node/rules",
|
554
|
-
plugins: {
|
555
|
-
node: import_eslint_plugin_n.default
|
556
|
-
},
|
557
|
-
rules: {
|
558
|
-
"node/handle-callback-err": ["error", "^(err|error)$"],
|
559
|
-
"node/no-deprecated-api": "error",
|
560
|
-
"node/no-exports-assign": "error",
|
561
|
-
"node/no-new-require": "error",
|
562
|
-
"node/no-path-concat": "error",
|
563
|
-
"node/prefer-global/buffer": ["error"],
|
564
|
-
"node/prefer-global/process": ["error"],
|
565
|
-
"node/process-exit-as-throw": "error"
|
566
|
-
}
|
567
|
-
}
|
568
|
-
];
|
569
|
-
}
|
570
|
-
|
571
|
-
// src/eslint/configs/react.ts
|
572
|
-
var import_eslint_plugin_next = __toESM(require("@next/eslint-plugin-next"), 1);
|
573
|
-
var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
|
574
|
-
var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
|
575
|
-
var import_local_pkg = require("local-pkg");
|
576
|
-
var nextJsPackages = ["next"];
|
577
|
-
var forbiddenLibraries = [
|
578
|
-
"@headlessui/react",
|
579
|
-
"@mui/material",
|
580
|
-
"@chakra-ui/react",
|
581
|
-
"@chakra-ui/core",
|
582
|
-
"@nextui-org/react",
|
583
|
-
"react-bootstrap",
|
584
|
-
"antd"
|
585
|
-
];
|
586
|
-
function react() {
|
587
|
-
const isUsingNext = nextJsPackages.some((index) => (0, import_local_pkg.isPackageExists)(index));
|
588
|
-
const nextjsConfig2 = [];
|
589
|
-
if (isUsingNext) {
|
590
|
-
nextjsConfig2.push(
|
591
|
-
{
|
592
|
-
name: "solvro/next/setup",
|
593
|
-
plugins: {
|
594
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
595
|
-
"@next/next": import_eslint_plugin_next.default
|
596
|
-
},
|
597
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
598
|
-
rules: import_eslint_plugin_next.default.configs.recommended.rules
|
599
|
-
},
|
600
|
-
{
|
601
|
-
files: [
|
602
|
-
"**/app/**/{page,loading,layout}.{js,jsx,ts,tsx}",
|
603
|
-
"**/pages/**/*.{js,jsx,ts,tsx}"
|
604
|
-
],
|
605
|
-
name: "solvro/next/pages",
|
606
|
-
rules: {
|
607
|
-
"import/no-default-export": "off"
|
608
|
-
}
|
609
|
-
}
|
610
|
-
);
|
611
|
-
}
|
612
|
-
return [
|
613
|
-
{
|
614
|
-
name: "solvro/react/setup",
|
615
|
-
plugins: {
|
616
|
-
// @ts-expect-error ???
|
617
|
-
react: import_eslint_plugin_react.default,
|
618
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
619
|
-
"react-hooks": import_eslint_plugin_react_hooks.default
|
620
|
-
}
|
621
|
-
},
|
622
|
-
...nextjsConfig2,
|
623
|
-
{
|
624
|
-
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
625
|
-
languageOptions: {
|
626
|
-
parserOptions: {
|
627
|
-
ecmaFeatures: {
|
628
|
-
jsx: true
|
629
|
-
}
|
630
|
-
},
|
631
|
-
sourceType: "module"
|
632
|
-
},
|
633
|
-
settings: {
|
634
|
-
react: {
|
635
|
-
version: "detect"
|
636
|
-
}
|
637
|
-
},
|
638
|
-
name: "solvro/react/rules",
|
639
|
-
rules: {
|
640
|
-
...import_eslint_plugin_react.default.configs.flat?.recommended.rules,
|
641
|
-
...import_eslint_plugin_react.default.configs.flat?.["jsx-runtime"].rules,
|
642
|
-
"react/no-danger": "warn",
|
643
|
-
"react/jsx-no-leaked-render": "warn",
|
644
|
-
// recommended rules react-hooks
|
645
|
-
"react-hooks/exhaustive-deps": "warn",
|
646
|
-
"react-hooks/rules-of-hooks": "error",
|
647
|
-
"react/jsx-no-useless-fragment": "error",
|
648
|
-
"react/function-component-definition": [
|
649
|
-
"error",
|
650
|
-
{
|
651
|
-
unnamedComponents: "arrow-function",
|
652
|
-
namedComponents: "function-declaration"
|
653
|
-
}
|
654
|
-
],
|
655
|
-
"react/hook-use-state": [
|
656
|
-
"error",
|
657
|
-
{
|
658
|
-
allowDestructuredState: true
|
659
|
-
}
|
660
|
-
],
|
661
|
-
"react/no-array-index-key": "warn",
|
662
|
-
"@typescript-eslint/no-restricted-imports": [
|
663
|
-
"error",
|
664
|
-
{
|
665
|
-
paths: forbiddenLibraries.map((library) => ({
|
666
|
-
name: library,
|
667
|
-
message: `Please use ui.shadcn.com components instead.`
|
668
|
-
}))
|
669
|
-
}
|
670
|
-
]
|
671
|
-
}
|
672
|
-
},
|
673
|
-
{
|
674
|
-
name: "solvro/react/disables",
|
675
|
-
files: ["**/components/ui/*.{jsx,tsx}"],
|
676
|
-
rules: {
|
677
|
-
"react/prop-types": "off",
|
678
|
-
"no-shadow": "off",
|
679
|
-
"@typescript-eslint/no-shadow": "off",
|
680
|
-
"@typescript-eslint/restrict-template-expressions": "off",
|
681
|
-
"unicorn/no-document-cookie": "off",
|
682
|
-
"@typescript-eslint/no-redeclare": "off",
|
683
|
-
"@typescript-eslint/no-deprecated": "off"
|
684
|
-
}
|
685
|
-
}
|
686
|
-
];
|
687
|
-
}
|
688
|
-
|
689
|
-
// src/eslint/configs/typescript-relaxed.ts
|
690
|
-
var import_typescript_eslint2 = __toESM(require("typescript-eslint"), 1);
|
691
|
-
function typescriptRelaxed() {
|
692
|
-
return [
|
693
|
-
...import_typescript_eslint2.default.configs.recommendedTypeChecked,
|
694
|
-
...import_typescript_eslint2.default.configs.stylisticTypeChecked,
|
695
|
-
{
|
696
|
-
name: "solvro/typescript-relaxed/rules",
|
697
|
-
rules: {
|
698
|
-
"@typescript-eslint/no-unsafe-return": "off",
|
699
|
-
"@typescript-eslint/require-await": "off",
|
700
|
-
"@typescript-eslint/no-misused-promises": [
|
701
|
-
"error",
|
702
|
-
{
|
703
|
-
checksVoidReturn: false
|
704
|
-
}
|
705
|
-
],
|
706
|
-
"unused-imports/no-unused-vars": "off",
|
707
|
-
"@typescript-eslint/no-unused-vars": [
|
708
|
-
"error",
|
709
|
-
{
|
710
|
-
args: "all",
|
711
|
-
argsIgnorePattern: "^_",
|
712
|
-
destructuredArrayIgnorePattern: "^_",
|
713
|
-
varsIgnorePattern: "^_",
|
714
|
-
ignoreRestSiblings: true
|
715
|
-
}
|
716
|
-
],
|
717
|
-
"@typescript-eslint/no-empty-object-type": "off",
|
718
|
-
"@typescript-eslint/no-unnecessary-condition": "warn",
|
719
|
-
"@typescript-eslint/no-non-null-assertion": "error",
|
720
|
-
"@typescript-eslint/no-unnecessary-template-expression": "error",
|
721
|
-
"@typescript-eslint/strict-boolean-expressions": [
|
722
|
-
"error",
|
723
|
-
{
|
724
|
-
allowNullableObject: false
|
725
|
-
}
|
726
|
-
]
|
727
|
-
}
|
728
|
-
}
|
729
|
-
];
|
730
|
-
}
|
731
|
-
|
732
|
-
// src/eslint/configs/typescript-strict.ts
|
733
|
-
var import_typescript_eslint3 = __toESM(require("typescript-eslint"), 1);
|
734
|
-
function typescriptStrict() {
|
735
|
-
return [
|
736
|
-
...import_typescript_eslint3.default.configs.strictTypeChecked,
|
737
|
-
...import_typescript_eslint3.default.configs.stylisticTypeChecked,
|
738
|
-
{
|
739
|
-
name: "solvro/typescript-strict/setup",
|
740
|
-
plugins: {
|
741
|
-
antfu: import_eslint_plugin_antfu.default
|
742
|
-
}
|
743
|
-
},
|
744
|
-
{
|
745
|
-
files: ["**/*.{ts,tsx}"],
|
746
|
-
name: "solvro/typescript-strict/rules",
|
747
|
-
rules: {
|
748
|
-
"@typescript-eslint/ban-ts-comment": [
|
749
|
-
"error",
|
750
|
-
{ "ts-expect-error": "allow-with-description" }
|
751
|
-
],
|
752
|
-
"@typescript-eslint/consistent-type-definitions": [
|
753
|
-
"error",
|
754
|
-
"interface"
|
755
|
-
],
|
756
|
-
"@typescript-eslint/consistent-type-imports": [
|
757
|
-
"error",
|
758
|
-
{
|
759
|
-
disallowTypeAnnotations: false,
|
760
|
-
prefer: "type-imports"
|
761
|
-
}
|
762
|
-
],
|
763
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
764
|
-
// https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
|
765
|
-
"@typescript-eslint/no-dupe-class-members": "error",
|
766
|
-
"@typescript-eslint/no-empty-object-type": [
|
767
|
-
"error",
|
768
|
-
{ allowInterfaces: "always" }
|
769
|
-
],
|
770
|
-
"@typescript-eslint/no-import-type-side-effects": "error",
|
771
|
-
"@typescript-eslint/no-redeclare": ["error", { builtinGlobals: false }],
|
772
|
-
"@typescript-eslint/no-require-imports": "error",
|
773
|
-
"@typescript-eslint/no-unused-expressions": [
|
774
|
-
"error",
|
775
|
-
{
|
776
|
-
allowShortCircuit: true,
|
777
|
-
allowTaggedTemplates: true,
|
778
|
-
allowTernary: true
|
779
|
-
}
|
780
|
-
],
|
781
|
-
"@typescript-eslint/no-use-before-define": [
|
782
|
-
"error",
|
783
|
-
{ classes: false, functions: false, variables: true }
|
784
|
-
],
|
785
|
-
"@typescript-eslint/no-wrapper-object-types": "error",
|
786
|
-
// prevent unnecessary use of void operator
|
787
|
-
"@typescript-eslint/no-meaningless-void-operator": "error",
|
788
|
-
// "using non-null assertions cancels the benefits of the strict
|
789
|
-
// null-checking mode."
|
790
|
-
// warn when one of the types in union / intersection overrides others
|
791
|
-
"@typescript-eslint/no-redundant-type-constituents": "warn",
|
792
|
-
// prevent variables shadowing
|
793
|
-
"no-shadow": "error",
|
794
|
-
"@typescript-eslint/no-shadow": "error",
|
795
|
-
// prevent assignment of this, signals a wrong usage of it
|
796
|
-
"@typescript-eslint/no-this-alias": "error",
|
797
|
-
// prevent throwing non-error
|
798
|
-
"no-throw-literal": "off",
|
799
|
-
// prevent unnecessary explicitly adding a default type argument
|
800
|
-
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
801
|
-
// prevent unnecessary assertions that won't change the outcome
|
802
|
-
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
803
|
-
// prevent extending default types
|
804
|
-
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
805
|
-
// force typing out function arguments
|
806
|
-
"@typescript-eslint/no-unsafe-argument": "error",
|
807
|
-
// prevent usage of any via reassigning
|
808
|
-
"@typescript-eslint/no-unsafe-assignment": "error",
|
809
|
-
// prevent usage of any via calling it
|
810
|
-
"@typescript-eslint/no-unsafe-call": "error",
|
811
|
-
// prevent usage of any via using it's members
|
812
|
-
"@typescript-eslint/no-unsafe-member-access": "error",
|
813
|
-
// prevent reverting any from functions
|
814
|
-
"@typescript-eslint/no-unsafe-return": "error",
|
815
|
-
// prevent unused expressions
|
816
|
-
"no-unused-expressions": "off",
|
817
|
-
// var<'string'> = 'string' -> var = 'string' as const
|
818
|
-
"@typescript-eslint/prefer-as-const": "error",
|
819
|
-
// force initializing enums
|
820
|
-
"@typescript-eslint/prefer-enum-initializers": "error",
|
821
|
-
// prefer for x of obj to for let i = 0...
|
822
|
-
"@typescript-eslint/prefer-for-of": "error",
|
823
|
-
// prefer includes() to indexOf()
|
824
|
-
"@typescript-eslint/prefer-includes": "error",
|
825
|
-
// use literals for enum initialization
|
826
|
-
"@typescript-eslint/prefer-literal-enum-member": "error",
|
827
|
-
// prefer safe cascade of a value when dealing with undefined or null
|
828
|
-
"@typescript-eslint/prefer-nullish-coalescing": "error",
|
829
|
-
// prefer optional chaining (a?.b)
|
830
|
-
"@typescript-eslint/prefer-optional-chain": "error",
|
831
|
-
// prefer using type parameter for Array.reduce
|
832
|
-
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
833
|
-
// prefer RegExp#exec when no /g flag in regex
|
834
|
-
"@typescript-eslint/prefer-regexp-exec": "error",
|
835
|
-
// enforce `this` as a type when stating type for a method
|
836
|
-
"@typescript-eslint/prefer-return-this-type": "error",
|
837
|
-
// enforce startsWith to indexOf === 0
|
838
|
-
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
839
|
-
// prevents default behavior of .sort() - which is confusing
|
840
|
-
"@typescript-eslint/require-array-sort-compare": "error",
|
841
|
-
// no async functions without awaits in body
|
842
|
-
"require-await": "off",
|
843
|
-
"@typescript-eslint/require-await": "error",
|
844
|
-
// prevent number + string
|
845
|
-
"@typescript-eslint/restrict-plus-operands": "error",
|
846
|
-
// only allow string in templates
|
847
|
-
"@typescript-eslint/restrict-template-expressions": "error",
|
848
|
-
// prevent returning await
|
849
|
-
"no-return-await": "off",
|
850
|
-
"@typescript-eslint/return-await": "error",
|
851
|
-
// only booleans in ifs and whiles
|
852
|
-
"@typescript-eslint/strict-boolean-expressions": "error",
|
853
|
-
// check if all paths are followed in code
|
854
|
-
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
855
|
-
"dot-notation": "off",
|
856
|
-
"no-implied-eval": "off",
|
857
|
-
"@typescript-eslint/await-thenable": "error",
|
858
|
-
"@typescript-eslint/dot-notation": ["error", { allowKeywords: true }],
|
859
|
-
"@typescript-eslint/no-floating-promises": "error",
|
860
|
-
"@typescript-eslint/no-for-in-array": "error",
|
861
|
-
"@typescript-eslint/no-implied-eval": "error",
|
862
|
-
"@typescript-eslint/no-misused-promises": "error",
|
863
|
-
"@typescript-eslint/promise-function-async": "error",
|
864
|
-
"@typescript-eslint/unbound-method": "error",
|
865
|
-
"no-restricted-imports": "off"
|
866
|
-
}
|
867
|
-
}
|
868
|
-
];
|
869
|
-
}
|
870
|
-
|
871
|
-
// src/eslint/configs/unicorn.ts
|
872
|
-
function unicorn() {
|
873
|
-
return [
|
874
|
-
{
|
875
|
-
name: "solvro/unicorn/rules",
|
876
|
-
plugins: {
|
877
|
-
unicorn: import_eslint_plugin_unicorn.default
|
878
|
-
},
|
879
|
-
rules: {
|
880
|
-
...import_eslint_plugin_unicorn.default.configs["flat/recommended"].rules,
|
881
|
-
"unicorn/no-array-reduce": "off",
|
882
|
-
"unicorn/no-null": "off",
|
883
|
-
"unicorn/no-useless-switch-case": "off",
|
884
|
-
"unicorn/prefer-global-this": "off",
|
885
|
-
"unicorn/prevent-abbreviations": [
|
886
|
-
"error",
|
887
|
-
{
|
888
|
-
replacements: {
|
889
|
-
env: false,
|
890
|
-
envs: false,
|
891
|
-
props: false,
|
892
|
-
prop: false,
|
893
|
-
ref: false
|
894
|
-
}
|
895
|
-
}
|
896
|
-
]
|
897
|
-
}
|
898
|
-
}
|
899
|
-
];
|
900
|
-
}
|
901
|
-
|
902
|
-
// src/eslint/index.ts
|
903
|
-
var builtinAdonisConfig = (0, import_eslint_config.configApp)();
|
904
|
-
var adonisConfig = [
|
905
|
-
...builtinAdonisConfig,
|
906
|
-
...node(),
|
907
|
-
...imports(),
|
908
|
-
{
|
909
|
-
rules: {
|
910
|
-
"@typescript-eslint/naming-convention": [
|
911
|
-
"error",
|
912
|
-
{
|
913
|
-
selector: ["enum", "enumMember", "class", "interface", "typeLike"],
|
914
|
-
format: ["PascalCase"]
|
915
|
-
},
|
916
|
-
{
|
917
|
-
selector: ["classProperty", "classMethod", "method", "variableLike"],
|
918
|
-
format: ["camelCase"]
|
919
|
-
},
|
920
|
-
{
|
921
|
-
selector: "variable",
|
922
|
-
format: ["camelCase", "UPPER_CASE", "PascalCase"],
|
923
|
-
leadingUnderscore: "allow",
|
924
|
-
trailingUnderscore: "allow"
|
925
|
-
}
|
926
|
-
]
|
927
|
-
}
|
928
|
-
}
|
929
|
-
];
|
930
|
-
var nextjsConfig = [
|
931
|
-
...a11y(),
|
932
|
-
...unicorn(),
|
933
|
-
...typescriptStrict(),
|
934
|
-
...react(),
|
935
|
-
...imports({ forbidDefaultExport: true })
|
936
|
-
];
|
937
|
-
var configs = [
|
938
|
-
...javascript(),
|
939
|
-
...jsdoc(),
|
940
|
-
...comments(),
|
941
|
-
...typescriptRelaxed()
|
942
|
-
];
|
943
|
-
var defaultOverrides = [...ignores(), ...formatters(), ...disables()];
|
944
|
-
var solvro = (...overrides) => {
|
945
|
-
const isAdonis = (0, import_local_pkg2.isPackageExists)("@adonisjs/core");
|
946
|
-
const isNext = (0, import_local_pkg2.isPackageExists)("next");
|
947
|
-
if (isNext && isAdonis) {
|
948
|
-
throw new Error(
|
949
|
-
"You can't use both Adonis and Next.js in the same project"
|
950
|
-
);
|
951
|
-
}
|
952
|
-
const newConfig = [];
|
953
|
-
if (isAdonis) {
|
954
|
-
newConfig.push(...adonisConfig);
|
955
|
-
}
|
956
|
-
if (isNext) {
|
957
|
-
newConfig.push(...nextjsConfig);
|
958
|
-
}
|
959
|
-
const tsConfigPath = (0, import_find_up_simple.findUpSync)("tsconfig.json", {
|
960
|
-
cwd: process.cwd()
|
961
|
-
});
|
962
|
-
if (tsConfigPath == null) {
|
963
|
-
throw new Error("No tsconfig.json found");
|
964
|
-
}
|
965
|
-
const rootDirectory = import_node_path.default.dirname(tsConfigPath);
|
966
|
-
configs.push({
|
967
|
-
languageOptions: {
|
968
|
-
parserOptions: {
|
969
|
-
projectService: true,
|
970
|
-
tsconfigRootDir: rootDirectory
|
971
|
-
}
|
972
|
-
}
|
973
|
-
});
|
974
|
-
return import_typescript_eslint4.default.config(
|
975
|
-
...configs,
|
976
|
-
...newConfig,
|
977
|
-
...defaultOverrides,
|
978
|
-
...overrides
|
979
|
-
);
|
980
|
-
};
|
981
|
-
// Annotate the CommonJS export names for ESM import in node:
|
982
|
-
0 && (module.exports = {
|
983
|
-
solvro
|
984
|
-
});
|
985
|
-
//# sourceMappingURL=index.cjs.map
|