Skip to content

Commit

Permalink
chore: optimize biome.json ignore files and update lint ci
Browse files Browse the repository at this point in the history
  • Loading branch information
chouchouji committed Dec 8, 2024
1 parent 70026ad commit a468e71
Show file tree
Hide file tree
Showing 10 changed files with 308 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ jobs:
run: pnpm i

- name: Lint
run: pnpm check
run: pnpm lint


6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"]
"recommendations": [
"dbaeumer.vscode-eslint",
"amodio.tsl-problem-matcher",
"ms-vscode.extension-test-runner"
]
}
11 changes: 5 additions & 6 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
"ignoreUnknown": true,
"ignore": ["dist", "package*.json"]
},
"formatter": {
"enabled": true,
Expand All @@ -16,10 +16,9 @@
"indentStyle": "space",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"lineWidth": 80,
"attributePosition": "auto",
"bracketSpacing": true,
"ignore": ["pnpm-lock.yaml", ".vscode", "l10n", "package*.json"]
"bracketSpacing": true
},
"organizeImports": {
"enabled": true
Expand All @@ -29,7 +28,7 @@
"rules": {
"recommended": true
},
"ignore": ["dist"]
"ignore": ["**/*.json"]
},
"javascript": {
"formatter": {
Expand Down
34 changes: 17 additions & 17 deletions l10n/bundle.l10n.zh-cn.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"Please enter new alias": "请输入新的别名",
"Please enter new alias name": "请输入新的别名名称",
"Please enter new alias command": "请输入新的指令名称",
"Please enter new description": "请输入新的备注",
"Duplicate alias": "别名重复",
"Please check the format of the input content": "请检查输入内容的格式",
"Alias is mandatory to execute this action": "别名不能为空",
"Alias name is mandatory to execute this action": "别名名称不能为空",
"Alias command is mandatory to execute this action": "指令名称不能为空",
"No alias": "没有任何别名",
"Alias has been added to the clipboard Successfully": "别名已成功复制到剪贴板",
"Please enter new group": "请输入新的组名",
"Group is mandatory to execute this action": "组不能为空",
"Duplicate group": "组名称重复",
"Please choose a group to add": "请选择一个组添加别名",
"frequency": "运行次数"
}
"Please enter new alias": "请输入新的别名",
"Please enter new alias name": "请输入新的别名名称",
"Please enter new alias command": "请输入新的指令名称",
"Please enter new description": "请输入新的备注",
"Duplicate alias": "别名重复",
"Please check the format of the input content": "请检查输入内容的格式",
"Alias is mandatory to execute this action": "别名不能为空",
"Alias name is mandatory to execute this action": "别名名称不能为空",
"Alias command is mandatory to execute this action": "指令名称不能为空",
"No alias": "没有任何别名",
"Alias has been added to the clipboard Successfully": "别名已成功复制到剪贴板",
"Please enter new group": "请输入新的组名",
"Group is mandatory to execute this action": "组不能为空",
"Duplicate group": "组名称重复",
"Please choose a group to add": "请选择一个组添加别名",
"frequency": "运行次数"
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@
]
},
"scripts": {
"check": "biome check --write",
"check": "biome check --write --verbose",
"lint": "biome lint --verbose",
"clean": "rimraf node_modules dist *.vsix",
"postinstall": "simple-git-hooks",
"package": "rimraf *.vsix && pnpm build && vsce package --no-dependencies",
Expand Down
10 changes: 8 additions & 2 deletions src/aliases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,21 @@ export function getAliases(path: fs.PathOrFileDescriptor) {
return aliases;
}

export function appendAliasToStoreFile(path: fs.PathOrFileDescriptor, content: string) {
export function appendAliasToStoreFile(
path: fs.PathOrFileDescriptor,
content: string,
) {
const data = `
alias ${content}`;
fs.appendFileSync(path, data);

reloadStoreFile(path);
}

export function deleteAliases(path: fs.PathOrFileDescriptor, specificAlias?: Alias) {
export function deleteAliases(
path: fs.PathOrFileDescriptor,
specificAlias?: Alias,
) {
const content = getContentFromPath(path);

if (isEmpty(content)) {
Expand Down
Loading

0 comments on commit a468e71

Please sign in to comment.