@hyoretsu/configs 1.0.0
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/biome/base.json +125 -0
- package/biome/mongo.json +12 -0
- package/biome/nest.json +12 -0
- package/biome/react.json +12 -0
- package/eslint/index.js +89 -0
- package/package.json +59 -0
- package/ts/base.json +25 -0
- package/ts/frontend.json +6 -0
package/biome/base.json
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
|
|
3
|
+
"assist": {
|
|
4
|
+
"actions": {
|
|
5
|
+
"source": {
|
|
6
|
+
"organizeImports": "on",
|
|
7
|
+
"useSortedAttributes": "on",
|
|
8
|
+
"useSortedKeys": "on",
|
|
9
|
+
"useSortedProperties": "on"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"includes": ["**", "!**/package.json"]
|
|
13
|
+
},
|
|
14
|
+
"files": {
|
|
15
|
+
"ignoreUnknown": true,
|
|
16
|
+
"includes": [
|
|
17
|
+
"**",
|
|
18
|
+
"!**/.next",
|
|
19
|
+
"!**/build",
|
|
20
|
+
"!**/client",
|
|
21
|
+
"!**/dist",
|
|
22
|
+
"!**/node_modules",
|
|
23
|
+
"!**/bun.lock",
|
|
24
|
+
"!**/tmp",
|
|
25
|
+
"!**/temp"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"formatter": {
|
|
29
|
+
"formatWithErrors": false,
|
|
30
|
+
"lineWidth": 110,
|
|
31
|
+
"useEditorconfig": true
|
|
32
|
+
},
|
|
33
|
+
"javascript": {
|
|
34
|
+
"formatter": {
|
|
35
|
+
"arrowParentheses": "asNeeded",
|
|
36
|
+
"lineEnding": "lf",
|
|
37
|
+
"quoteStyle": "double",
|
|
38
|
+
"semicolons": "always",
|
|
39
|
+
"trailingCommas": "all"
|
|
40
|
+
},
|
|
41
|
+
"parser": {
|
|
42
|
+
"unsafeParameterDecoratorsEnabled": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"linter": {
|
|
46
|
+
"rules": {
|
|
47
|
+
"a11y": {
|
|
48
|
+
"noSvgWithoutTitle": "warn",
|
|
49
|
+
"useAltText": "warn",
|
|
50
|
+
"useButtonType": "warn",
|
|
51
|
+
"useHtmlLang": "warn",
|
|
52
|
+
"useKeyWithClickEvents": "off"
|
|
53
|
+
},
|
|
54
|
+
"complexity": {
|
|
55
|
+
"noBannedTypes": "warn",
|
|
56
|
+
"noForEach": "off"
|
|
57
|
+
},
|
|
58
|
+
"correctness": {
|
|
59
|
+
"noUnusedImports": {
|
|
60
|
+
"fix": "safe",
|
|
61
|
+
"level": "error"
|
|
62
|
+
},
|
|
63
|
+
"noUnusedPrivateClassMembers": "warn",
|
|
64
|
+
"noUnusedVariables": {
|
|
65
|
+
"level": "warn",
|
|
66
|
+
"options": {
|
|
67
|
+
"ignoreRestSiblings": true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"useHookAtTopLevel": "off"
|
|
71
|
+
},
|
|
72
|
+
"nursery": {
|
|
73
|
+
"useSortedClasses": {
|
|
74
|
+
"fix": "safe",
|
|
75
|
+
"level": "warn",
|
|
76
|
+
"options": {
|
|
77
|
+
"attributes": ["classList"],
|
|
78
|
+
"functions": ["cn", "clsx", "cva", "tw"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"security": {
|
|
83
|
+
"noDangerouslySetInnerHtml": "warn"
|
|
84
|
+
},
|
|
85
|
+
"style": {
|
|
86
|
+
"noDoneCallback": "error",
|
|
87
|
+
"noInferrableTypes": "error",
|
|
88
|
+
"noNonNullAssertion": "off",
|
|
89
|
+
"noParameterAssign": "warn",
|
|
90
|
+
"noUnusedTemplateLiteral": "error",
|
|
91
|
+
"noUselessElse": "error",
|
|
92
|
+
"useAsConstAssertion": "error",
|
|
93
|
+
"useConsistentArrayType": "error",
|
|
94
|
+
"useConsistentObjectDefinitions": {
|
|
95
|
+
"level": "error",
|
|
96
|
+
"options": {
|
|
97
|
+
"syntax": "shorthand"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"useConsistentTypeDefinitions": {
|
|
101
|
+
"fix": "safe",
|
|
102
|
+
"level": "warn"
|
|
103
|
+
},
|
|
104
|
+
"useConst": "warn",
|
|
105
|
+
"useNodejsImportProtocol": {
|
|
106
|
+
"fix": "safe",
|
|
107
|
+
"level": "warn"
|
|
108
|
+
},
|
|
109
|
+
"useNumberNamespace": "error",
|
|
110
|
+
"useSelfClosingElements": "error",
|
|
111
|
+
"useSingleVarDeclarator": "off",
|
|
112
|
+
"useTemplate": "warn"
|
|
113
|
+
},
|
|
114
|
+
"suspicious": {
|
|
115
|
+
"noArrayIndexKey": "warn",
|
|
116
|
+
"noExplicitAny": "off",
|
|
117
|
+
"noMisplacedAssertion": "error",
|
|
118
|
+
"noSkippedTests": "error",
|
|
119
|
+
"noThenProperty": "info",
|
|
120
|
+
"useIterableCallbackReturn": "info"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"root": false
|
|
125
|
+
}
|
package/biome/mongo.json
ADDED
package/biome/nest.json
ADDED
package/biome/react.json
ADDED
package/eslint/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import eslint from "@eslint/js";
|
|
2
|
+
import biome from "eslint-config-biome";
|
|
3
|
+
import pluginJest from "eslint-plugin-jest";
|
|
4
|
+
import { defineConfig } from "eslint/config";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
|
|
7
|
+
export default defineConfig([
|
|
8
|
+
{ ignores: ["**/build/**", "**/dist/**", "**/node_modules/**"] },
|
|
9
|
+
eslint.configs.recommended,
|
|
10
|
+
// TS files
|
|
11
|
+
{
|
|
12
|
+
extends: [tseslint.configs.strict, tseslint.configs.stylistic],
|
|
13
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parser: tseslint.parser,
|
|
16
|
+
},
|
|
17
|
+
plugins: {
|
|
18
|
+
"@typescript-eslint": tseslint.plugin,
|
|
19
|
+
},
|
|
20
|
+
rules: {
|
|
21
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
22
|
+
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
23
|
+
"@typescript-eslint/no-duplicate-enum-values": "off",
|
|
24
|
+
"@typescript-eslint/no-empty-function": "warn",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
// JS files
|
|
28
|
+
{
|
|
29
|
+
extends: [tseslint.configs.disableTypeChecked],
|
|
30
|
+
files: ["**/*.js", "**/*.jsx"],
|
|
31
|
+
},
|
|
32
|
+
// Test files
|
|
33
|
+
{
|
|
34
|
+
extends: [pluginJest.configs["flat/all"]],
|
|
35
|
+
files: [
|
|
36
|
+
"**/*.spec.js",
|
|
37
|
+
"**/*.spec.ts",
|
|
38
|
+
"**/*.test.js",
|
|
39
|
+
"**/*.test.ts",
|
|
40
|
+
"**/*.spec.jsx",
|
|
41
|
+
"**/*.spec.tsx",
|
|
42
|
+
"**/*.test.jsx",
|
|
43
|
+
"**/*.test.tsx",
|
|
44
|
+
],
|
|
45
|
+
languageOptions: {
|
|
46
|
+
globals: pluginJest.environments.globals.globals,
|
|
47
|
+
// parserOptions: {
|
|
48
|
+
// projectService: true,
|
|
49
|
+
// tsconfigRootDir: import.meta.dirname,
|
|
50
|
+
// },
|
|
51
|
+
},
|
|
52
|
+
plugins: {
|
|
53
|
+
jest: pluginJest,
|
|
54
|
+
},
|
|
55
|
+
rules: {
|
|
56
|
+
"jest/no-commented-out-tests": "off",
|
|
57
|
+
"jest/no-deprecated-functions": "off",
|
|
58
|
+
//? Not sure if these should be turned off, but it was flagging most if not all existing tests and they will eventually be replaced by Bun anyway
|
|
59
|
+
"jest/require-hook": "off",
|
|
60
|
+
"jest/unbound-method": "off",
|
|
61
|
+
},
|
|
62
|
+
settings: {
|
|
63
|
+
jest: {
|
|
64
|
+
globalPackage: "bun:test",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
extends: [biome],
|
|
70
|
+
rules: {
|
|
71
|
+
"@typescript-eslint/array-type": "off",
|
|
72
|
+
"@typescript-eslint/consistent-indexed-object-style": "off",
|
|
73
|
+
"@typescript-eslint/consistent-type-definitions": "off",
|
|
74
|
+
"@typescript-eslint/no-dynamic-delete": "off",
|
|
75
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
76
|
+
"@typescript-eslint/no-namespace": "off",
|
|
77
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
78
|
+
"@typescript-eslint/require-await": "off",
|
|
79
|
+
"jest/max-nested-describe": "off",
|
|
80
|
+
"jest/no-disabled-tests": "off",
|
|
81
|
+
"jest/no-done-callback": "off",
|
|
82
|
+
"jest/no-duplicate-hooks": "off",
|
|
83
|
+
"jest/no-export": "off",
|
|
84
|
+
"jest/no-focused-tests": "off",
|
|
85
|
+
"jest/no-standalone-expect": "off",
|
|
86
|
+
"sort-imports": "off",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
]);
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hyoretsu/configs",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./biome": "./base.json",
|
|
8
|
+
"./biome-mongo": "./biome/mongo.json",
|
|
9
|
+
"./biome-nest": "./biome/nest.json",
|
|
10
|
+
"./biome-react": "./biome/react.json",
|
|
11
|
+
"./eslint": "./eslint/index.js",
|
|
12
|
+
"./ts": "./ts/base.json",
|
|
13
|
+
"./ts-frontend": "./ts/frontend.json"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/hyoretsu/npm-packages/tree/main/packages/configs",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/hyoretsu/npm-packages/issues",
|
|
18
|
+
"email": "hyoretsu@gmail.com"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/hyoretsu/npm-packages.git"
|
|
23
|
+
},
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "Aran Leite",
|
|
26
|
+
"email": "hyoretsu@gmail.com",
|
|
27
|
+
"url": "https://www.linkedin.com/in/aranleite"
|
|
28
|
+
},
|
|
29
|
+
"lint-staged": {
|
|
30
|
+
"**/*.(json|js|jsx|ts|tsx)": [
|
|
31
|
+
"biome check --write"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@biomejs/biome": "latest"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@biomejs/biome": "^2.3.0",
|
|
39
|
+
"eslint": "",
|
|
40
|
+
"typescript": "^5.0.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependenciesMeta": {
|
|
43
|
+
"@biomejs/biome": {
|
|
44
|
+
"optional": true
|
|
45
|
+
},
|
|
46
|
+
"eslint": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"typescript": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@eslint/js": "^9.39.1",
|
|
55
|
+
"eslint-config-biome": "^2.1.3",
|
|
56
|
+
"eslint-plugin-jest": "^29.2.1",
|
|
57
|
+
"typescript-eslint": "^8.48.1"
|
|
58
|
+
}
|
|
59
|
+
}
|
package/ts/base.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"allowJs": true,
|
|
4
|
+
"composite": true,
|
|
5
|
+
"downlevelIteration": true,
|
|
6
|
+
"exactOptionalPropertyTypes": true,
|
|
7
|
+
"incremental": true,
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"lib": ["ESNext"],
|
|
10
|
+
"module": "Preserve",
|
|
11
|
+
"moduleDetection": "force",
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"noImplicitOverride": true,
|
|
15
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
16
|
+
"noUncheckedIndexedAccess": true,
|
|
17
|
+
"removeComments": true,
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
"rewriteRelativeImportExtensions": true,
|
|
20
|
+
"skipLibCheck": true,
|
|
21
|
+
"strict": true,
|
|
22
|
+
"target": "ESNext",
|
|
23
|
+
"verbatimModuleSyntax": true
|
|
24
|
+
}
|
|
25
|
+
}
|