@10stars/config 15.0.0 → 15.0.2
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/oxlint.config.browser.json +0 -1
- package/oxlint.config.node.json +0 -1
- package/package.json +2 -1
- package/src/index.ts +8 -2
- package/src/link-packages.ts +0 -2
- package/src/vscode-config.ts +1 -0
package/oxlint.config.node.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@10stars/config",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"bin": {
|
|
6
6
|
"config": "./src/index.ts"
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"husky": "^9.0.0",
|
|
23
23
|
"oxfmt": "0.21.0",
|
|
24
24
|
"oxlint": "1.36.0",
|
|
25
|
+
"oxlint-tsgolint": "0.10.0",
|
|
25
26
|
"type-fest": "^5.0.0",
|
|
26
27
|
"typescript": "~5.9.3"
|
|
27
28
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { execSync } from "node:child_process"
|
|
2
|
+
import fs from "node:fs/promises"
|
|
2
3
|
import path from "node:path"
|
|
3
4
|
|
|
4
5
|
import { checkIsMonorepo, linkPackages } from "./link-packages"
|
|
@@ -34,7 +35,12 @@ const actions = {
|
|
|
34
35
|
action: async () => {
|
|
35
36
|
if (process.env.CI) return
|
|
36
37
|
exec(`husky`) // husky is intended only for local development (not in CI)
|
|
37
|
-
setupVSCode(cwd) // create/update .vscode directory with standardized extensions.json and settings.json
|
|
38
|
+
await setupVSCode(cwd) // create/update .vscode directory with standardized extensions.json and settings.json
|
|
39
|
+
|
|
40
|
+
const oxfmtSrc = path.join(new URL("../.oxfmtrc.json", import.meta.url).pathname, ``)
|
|
41
|
+
const oxfmtDest = path.join(cwd, `.oxfmtrc.json`)
|
|
42
|
+
await fs.cp(oxfmtSrc, oxfmtDest, { force: true })
|
|
43
|
+
|
|
38
44
|
const config = await getConfig()
|
|
39
45
|
if (config?.linkPackages) await linkPackages(cwd, config.linkPackages)
|
|
40
46
|
},
|
|
@@ -53,7 +59,7 @@ const actions = {
|
|
|
53
59
|
},
|
|
54
60
|
lint: {
|
|
55
61
|
info: `Lint code (once)`,
|
|
56
|
-
action: async () => exec(`oxfmt && oxlint --fix ${await getOxlintCommonCmd()}`),
|
|
62
|
+
action: async () => exec(`oxfmt && oxlint --fix --type-aware ${await getOxlintCommonCmd()}`),
|
|
57
63
|
},
|
|
58
64
|
precommit: {
|
|
59
65
|
info: `Run pre-commit hooks`,
|
package/src/link-packages.ts
CHANGED
|
@@ -24,8 +24,6 @@ export const checkIsMonorepo = async (pathPkg: string) => {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export const linkPackages = async (cwd: string, packagesToLink: string[]) => {
|
|
27
|
-
console.info(`Linking local packages`)
|
|
28
|
-
|
|
29
27
|
const linkPackage = async (pathPkg: string) => {
|
|
30
28
|
const pkgJson: TF.PackageJson = await import(path.join(pathPkg, `package.json`)).catch(
|
|
31
29
|
() => null,
|
package/src/vscode-config.ts
CHANGED
|
@@ -22,6 +22,7 @@ const settingsJson = {
|
|
|
22
22
|
"extensions.ignoreRecommendations": false,
|
|
23
23
|
"editor.tabSize": 2,
|
|
24
24
|
"editor.formatOnSave": true,
|
|
25
|
+
"editor.linkedEditing": true,
|
|
25
26
|
"editor.suggest.snippetsPreventQuickSuggestions": false,
|
|
26
27
|
"editor.defaultFormatter": "oxc.oxc-vscode",
|
|
27
28
|
"editor.codeActionsOnSave": {
|