Skip to content

Commit

Permalink
workflow(ci): optimize biome lint (#31)
Browse files Browse the repository at this point in the history
* workflow(ci): format code

* workflow(ci): format code

* workflow(ci): format code

* workflow(ci): format code

* workflow(ci): format code
  • Loading branch information
zhoushaw authored Aug 4, 2024
1 parent b9747b3 commit e1ae31a
Show file tree
Hide file tree
Showing 111 changed files with 4,149 additions and 4,799 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ jobs:
- name: Check Dependency Version
run: pnpm run check-dependency-version

- name: Check for changed files
run: |
git fetch origin
git branch -a
git diff --name-only main
- name: Debug Biome lint
run: |
npx biome lint --changed --since main --diagnostic-level=warn --no-errors-on-unmatched --verbose
- name: Biome lint
run: npx biome check . --diagnostic-level=warn --no-errors-on-unmatched

28 changes: 14 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html"
],
"editor.formatOnSaveMode": "modifications"
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit"
},
"editor.defaultFormatter": "biomejs.biome",
"editor.formatOnSave": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html"
],
"editor.formatOnSaveMode": "modifications"
}
2 changes: 1 addition & 1 deletion apps/site/docs/en/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"link": "/visualization/",
"activeMatch": "/visualization/"
}
]
]
2 changes: 1 addition & 1 deletion apps/site/docs/en/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"collapsible": false,
"collapsed": false
}
]
]
6 changes: 1 addition & 5 deletions apps/site/docs/en/docs/getting-started/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
[
"introduction",
"quick-start",
"demo.md"
]
["introduction", "quick-start", "demo.md"]
5 changes: 1 addition & 4 deletions apps/site/docs/en/docs/more/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
[
"prompting-tips",
"faq"
]
["prompting-tips", "faq"]
4 changes: 1 addition & 3 deletions apps/site/docs/en/docs/usage/_meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
"API.md"
]
["API.md"]
2 changes: 1 addition & 1 deletion apps/site/docs/zh/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"link": "/visualization/",
"activeMatch": "/visualization/"
}
]
]
2 changes: 1 addition & 1 deletion apps/site/docs/zh/docs/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
"collapsible": false,
"collapsed": false
}
]
]
6 changes: 1 addition & 5 deletions apps/site/docs/zh/docs/getting-started/_meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
[
"introduction",
"quick-start",
"demo"
]
["introduction", "quick-start", "demo"]
5 changes: 1 addition & 4 deletions apps/site/docs/zh/docs/more/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
[
"prompting-tips",
"faq"
]
["prompting-tips", "faq"]
4 changes: 1 addition & 3 deletions apps/site/docs/zh/docs/usage/_meta.json
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[
"API.md"
]
["API.md"]
2 changes: 1 addition & 1 deletion apps/site/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"en": "Getting Started",
"zh": "开始"
}
}
}
2 changes: 1 addition & 1 deletion apps/site/route.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
"regexDomain": false
}
]
}
}
10 changes: 8 additions & 2 deletions apps/site/rspress.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as path from 'path';
import * as path from 'node:path';
import { defineConfig } from 'rspress/config';

export default defineConfig({
Expand All @@ -12,7 +12,13 @@ export default defineConfig({
},
themeConfig: {
darkMode: false,
socialLinks: [{ icon: 'github', mode: 'link', content: 'https://github.com/web-infra-dev/midscene' }],
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/web-infra-dev/midscene',
},
],
locales: [
{
lang: 'en',
Expand Down
6 changes: 5 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
".nx",
"**/dist",
"**/doc_build",
"*-dump.json"
"*-dump.json",
"script_get_all_texts.tmp.js",
"**/playwright-report/**",
"packages/visualizer/**"
]
},
"javascript": {
Expand All @@ -21,6 +24,7 @@
"rules": {
"recommended": true,
"style": {},
"complexity": { "noForEach": "off" },
"suspicious": { "noExplicitAny": "off" }
}
},
Expand Down
26 changes: 7 additions & 19 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,25 @@
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"targetDefaults": {
"dev": {
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"build": {
"dependsOn": [
"^build"
],
"dependsOn": ["^build"],
"cache": true
},
"build:watch": {
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"test": {
"dependsOn": [
"^build"
],
"dependsOn": ["^build"],
"cache": false
},
"e2e": {
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
},
"e2e:ui": {
"dependsOn": [
"^build"
]
"dependsOn": ["^build"]
}
},
"defaultBase": "main"
}
}
22 changes: 5 additions & 17 deletions packages/midscene/demo_data/demo.actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@
"top": 200,
"left": 200
},
"center": [
250,
250
]
"center": [250, 250]
}
},
"log": {
Expand All @@ -52,10 +49,7 @@
"top": 200,
"left": 200
},
"center": [
250,
250
]
"center": [250, 250]
}
]
},
Expand All @@ -72,10 +66,7 @@
"top": 200,
"left": 200
},
"center": [
250,
250
]
"center": [250, 250]
}
],
"data": null,
Expand Down Expand Up @@ -136,10 +127,7 @@
"top": 200,
"left": 200
},
"center": [
250,
250
]
"center": [250, 250]
}
]
},
Expand All @@ -157,4 +145,4 @@
}
}
]
}
}
5,226 changes: 2,334 additions & 2,892 deletions packages/midscene/demo_data/demo.insight.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/midscene/demo_data/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as insightDemo from './demo.insight.json';
import * as actionDemo from './demo.actions.json';
import * as insightDemo from './demo.insight.json';

export const insight = insightDemo.default;
export const action = actionDemo.default;

4 changes: 2 additions & 2 deletions packages/midscene/modern.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { moduleTools, defineConfig } from '@modern-js/module-tools';
import { defineConfig, moduleTools } from '@modern-js/module-tools';

export default defineConfig({
plugins: [moduleTools()],
Expand All @@ -13,6 +13,6 @@ export default defineConfig({
},
// input: ['src/utils.ts', 'src/index.ts', 'src/image/index.ts'],
externals: ['node:buffer'],
target: 'es2017'
target: 'es2017',
},
});
21 changes: 5 additions & 16 deletions packages/midscene/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
"main": "./dist/lib/index.js",
"module": "./dist/es/index.js",
"types": "./dist/types/index.d.ts",
"files": [
"dist",
"README.md"
],
"files": ["dist", "README.md"],
"exports": {
".": {
"types": "./dist/types/index.d.ts",
Expand Down Expand Up @@ -44,18 +41,10 @@
},
"typesVersions": {
"*": {
".": [
"./dist/types/index.d.ts"
],
"utils": [
"./dist/types/utils.d.ts"
],
"ai-model": [
"./dist/types/ai-model.d.ts"
],
"image": [
"./dist/types/image.d.ts"
]
".": ["./dist/types/index.d.ts"],
"utils": ["./dist/types/utils.d.ts"],
"ai-model": ["./dist/types/ai-model.d.ts"],
"image": ["./dist/types/image.d.ts"]
}
},
"scripts": {
Expand Down
Loading

0 comments on commit e1ae31a

Please sign in to comment.