Skip to content

Commit 94ab41f

Browse files
committed
chore: lint code
1 parent 516f950 commit 94ab41f

24 files changed

+368
-357
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- "v*"
6+
- 'v*'
77

88
jobs:
99
release:
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
node-version: 16.x
2323
cache: pnpm
24-
registry-url: "https://registry.npmjs.org"
24+
registry-url: 'https://registry.npmjs.org'
2525

2626
- run: npx changelogithub
2727
continue-on-error: true

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ pnpm i -D @uni-helper/vite-plugin-uni-layouts
1414

1515
```ts
1616
// vite.config.ts
17-
import { defineConfig } from "vite";
18-
import uni from "@dcloudio/vite-plugin-uni";
19-
import UniLayouts from "@uni-helper/vite-plugin-uni-layouts";
17+
import { defineConfig } from 'vite'
18+
import uni from '@dcloudio/vite-plugin-uni'
19+
import UniLayouts from '@uni-helper/vite-plugin-uni-layouts'
2020

2121
export default defineConfig({
2222
plugins: [UniLayouts(), uni()],
23-
});
23+
})
2424
```
2525

2626
### 创建布局
@@ -41,13 +41,13 @@ export default defineConfig({
4141
```json
4242
// pages.json
4343
{
44-
...
44+
// ...
4545
"pages": [{
4646
"path": "pages/index/index",
4747
// 可选, 这是默认值
4848
"layout": "default"
4949
}]
50-
...
50+
// ...
5151
}
5252
```
5353

@@ -56,12 +56,12 @@ export default defineConfig({
5656
```json
5757
// pages.json
5858
{
59-
...
59+
// ...
6060
"pages": [{
6161
"path": "pages/index/index",
6262
"layout": false
6363
}]
64-
...
64+
// ...
6565
}
6666
```
6767

build.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { defineBuildConfig } from "unbuild";
1+
import { defineBuildConfig } from 'unbuild'
22

33
export default defineBuildConfig({
4-
entries: ["src/index"],
4+
entries: ['src/index'],
55
declaration: true,
66
clean: true,
77
rollup: {
88
emitCJS: true,
99
},
1010
failOnWarn: false,
11-
externals: ["vite", "vue"],
12-
});
11+
externals: ['vite', 'vue'],
12+
})

client.d.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
declare module "virtual:uni-layouts" {
2-
import type { DefineComponent, App, Plugin } from "vue";
3-
export const layouts: Record<string, DefineComponent<{}, {}, any>>;
1+
declare module 'virtual:uni-layouts' {
2+
import type { DefineComponent, Plugin } from 'vue'
3+
4+
export const layouts: Record<string, DefineComponent<object, object, any>>
45
const plugin: Plugin
5-
export default plugin;
6+
export default plugin
67
}

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
}
4545
},
4646
"files": [
47-
"dist",
48-
"client.d.ts"
47+
"client.d.ts",
48+
"dist"
4949
],
5050
"scripts": {
5151
"build": "unbuild",
@@ -58,6 +58,15 @@
5858
"lint": "eslint .",
5959
"lint:fix": "eslint . --fix"
6060
},
61+
"dependencies": {
62+
"@uni-helper/uni-env": "^0.0.3",
63+
"@vue/compiler-dom": "^3.3.4",
64+
"estree-walker": "^3.0.3",
65+
"fast-glob": "^3.3.1",
66+
"jsonc-parser": "^3.2.0",
67+
"magic-string": "^0.30.3",
68+
"scule": "^1.0.0"
69+
},
6170
"devDependencies": {
6271
"@antfu/eslint-config": "1.0.0-beta.26",
6372
"@types/node": "^20.5.7",
@@ -67,14 +76,5 @@
6776
"unbuild": "^2.0.0",
6877
"vite": "^4.4.9",
6978
"vitest": "^0.34.3"
70-
},
71-
"dependencies": {
72-
"@uni-helper/uni-env": "^0.0.3",
73-
"@vue/compiler-dom": "^3.3.4",
74-
"estree-walker": "^3.0.3",
75-
"fast-glob": "^3.3.1",
76-
"jsonc-parser": "^3.2.0",
77-
"magic-string": "^0.30.3",
78-
"scule": "^1.0.0"
7979
}
8080
}

playground/src/env.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/// <reference types="vite/client" />
22
/// <reference types="@uni-helper/vite-plugin-uni-layouts/client" />
33

4-
declare module "*.vue" {
5-
import { DefineComponent } from "vue";
6-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
7-
const component: DefineComponent<{}, {}, any>;
8-
export default component;
4+
declare module '*.vue' {
5+
import type { DefineComponent } from 'vue'
6+
7+
const component: DefineComponent<object, object, any>
8+
export default component
99
}

playground/src/main.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { createSSRApp } from "vue";
2-
import App from "./App.vue";
1+
import { createSSRApp } from 'vue'
2+
import App from './App.vue'
33

44
export function createApp() {
5-
const app = createSSRApp(App);
5+
const app = createSSRApp(App)
66
return {
77
app,
8-
};
8+
}
99
}

playground/src/pages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
2+
"pages": [ // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
33
{
44
"path": "pages/index/index",
55
"style": {

playground/tsconfig.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"compilerOptions": {
33
"target": "esnext",
4+
"jsx": "preserve",
5+
"lib": ["esnext", "dom"],
46
"useDefineForClassFields": true,
57
"module": "esnext",
68
"moduleResolution": "node",
9+
"resolveJsonModule": true,
10+
"types": ["@dcloudio/types"],
711
"strict": true,
8-
"jsx": "preserve",
912
"sourceMap": true,
10-
"resolveJsonModule": true,
11-
"esModuleInterop": true,
12-
"lib": ["esnext", "dom"],
13-
"types": ["@dcloudio/types"]
13+
"esModuleInterop": true
1414
},
1515
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
1616
}

playground/vite.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { defineConfig } from "vite";
2-
import uni from "@dcloudio/vite-plugin-uni";
3-
import UniLayouts from "@uni-helper/vite-plugin-uni-layouts";
1+
import { defineConfig } from 'vite'
2+
import uni from '@dcloudio/vite-plugin-uni'
3+
import UniLayouts from '@uni-helper/vite-plugin-uni-layouts'
44

55
// https://vitejs.dev/config/
66
export default defineConfig({
77
plugins: [UniLayouts(), uni()],
8-
});
8+
})

0 commit comments

Comments
 (0)