Skip to content

Commit

Permalink
workflow: remove eslint, apply prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 23, 2022
1 parent 6f8fb22 commit 72aed6a
Show file tree
Hide file tree
Showing 261 changed files with 6,858 additions and 5,809 deletions.
13 changes: 0 additions & 13 deletions .babelrc.js

This file was deleted.

3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
semi: false
singleQuote: true
printWidth: 80
trailingComma: 'none'
arrowParens: 'avoid'
6 changes: 0 additions & 6 deletions examples/.eslintrc.json

This file was deleted.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"test:e2e": "npm run build -- web-full-prod,web-server-renderer-basic && vitest run test/e2e",
"test:transition": "karma start test/transition/karma.conf.js",
"test:types": "tsc -p ./types/tsconfig.json",
"lint": "eslint src scripts test",
"format": "prettier --write --parser typescript \"(src|test|packages)/**/*.ts\"",
"ts-check": "tsc -p tsconfig.json --noEmit",
"ts-check:test": "tsc -p test/tsconfig.json --noEmit",
"bench:ssr": "npm run build:ssr && node benchmarks/ssr/renderToString.js && node benchmarks/ssr/renderToStream.js",
Expand All @@ -42,7 +42,10 @@
},
"lint-staged": {
"*.js": [
"eslint --fix"
"prettier --write"
],
"*.ts": [
"prettier --parser=typescript --write"
]
},
"repository": {
Expand All @@ -65,8 +68,6 @@
"@rollup/plugin-replace": "^4.0.0",
"@types/he": "^1.1.2",
"@types/node": "^17.0.30",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"acorn": "^8.7.1",
"acorn-walk": "^8.2.0",
"chalk": "^4.0.0",
Expand All @@ -77,7 +78,6 @@
"de-indent": "^1.0.2",
"esbuild": "^0.14.39",
"escodegen": "^2.0.0",
"eslint": "^8.14.0",
"file-loader": "^3.0.1",
"hash-sum": "^2.0.0",
"he": "^1.2.0",
Expand All @@ -95,6 +95,7 @@
"lru-cache": "^7.8.1",
"marked": "^3.0.8",
"memory-fs": "^0.5.0",
"prettier": "^2.6.2",
"puppeteer": "^14.1.1",
"resolve": "^1.22.0",
"rollup": "^2.70.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/vue-server-renderer/client-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { WebpackPlugin } from './types/plugin';
declare const Plugin: WebpackPlugin;
export = Plugin;
import { WebpackPlugin } from './types/plugin'
declare const Plugin: WebpackPlugin
export = Plugin
6 changes: 3 additions & 3 deletions packages/vue-server-renderer/server-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { WebpackPlugin } from './types/plugin';
declare const Plugin: WebpackPlugin;
export = Plugin;
import { WebpackPlugin } from './types/plugin'
declare const Plugin: WebpackPlugin
export = Plugin
59 changes: 31 additions & 28 deletions packages/vue-server-renderer/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
import Vue, { VNode, VNodeDirective } from 'vue';
import { Readable } from 'stream';
import Vue, { VNode, VNodeDirective } from 'vue'
import { Readable } from 'stream'

export declare function createRenderer(options?: RendererOptions): Renderer;
export declare function createRenderer(options?: RendererOptions): Renderer

export declare function createBundleRenderer(bundle: string | object, options?: BundleRendererOptions): BundleRenderer;
export declare function createBundleRenderer(
bundle: string | object,
options?: BundleRendererOptions
): BundleRenderer

type RenderCallback = (err: Error | null, html: string) => void;
type RenderCallback = (err: Error | null, html: string) => void

interface Renderer {
renderToString(vm: Vue, callback: RenderCallback): void;
renderToString(vm: Vue, context: object, callback: RenderCallback): void;
renderToString(vm: Vue): Promise<string>;
renderToString(vm: Vue, context: object): Promise<string>;
renderToString(vm: Vue, callback: RenderCallback): void
renderToString(vm: Vue, context: object, callback: RenderCallback): void
renderToString(vm: Vue): Promise<string>
renderToString(vm: Vue, context: object): Promise<string>

renderToStream(vm: Vue, context?: object): Readable;
renderToStream(vm: Vue, context?: object): Readable
}

interface BundleRenderer {
renderToString(callback: RenderCallback): void;
renderToString(context: object, callback: RenderCallback): void;
renderToString(): Promise<string>;
renderToString(context: object): Promise<string>;
renderToString(callback: RenderCallback): void
renderToString(context: object, callback: RenderCallback): void
renderToString(): Promise<string>
renderToString(context: object): Promise<string>

renderToStream(context?: object): Readable;
renderToStream(context?: object): Readable
}

interface RendererOptions {
template?: string;
inject?: boolean;
shouldPreload?: (file: string, type: string) => boolean;
shouldPrefetch?: (file: string, type: string) => boolean;
cache?: RenderCache;
template?: string
inject?: boolean
shouldPreload?: (file: string, type: string) => boolean
shouldPrefetch?: (file: string, type: string) => boolean
cache?: RenderCache
directives?: {
[key: string]: (vnode: VNode, dir: VNodeDirective) => void
};
}
}

interface BundleRendererOptions extends RendererOptions {
clientManifest?: object;
serializer?: (state: object) => string;
runInNewContext?: boolean | 'once';
basedir?: string;
clientManifest?: object
serializer?: (state: object) => string
runInNewContext?: boolean | 'once'
basedir?: string
}

interface RenderCache {
get: (key: string, cb?: (res: string) => void) => string | void;
set: (key: string, val: string) => void;
has?: (key: string, cb?: (hit: boolean) => void) => boolean | void;
get: (key: string, cb?: (res: string) => void) => string | void
set: (key: string, val: string) => void
has?: (key: string, cb?: (hit: boolean) => void) => boolean | void
}
6 changes: 3 additions & 3 deletions packages/vue-server-renderer/types/plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { DefinePlugin } from 'webpack';
import { DefinePlugin } from 'webpack'

interface WebpackPluginOptions {
filename?: string;
filename?: string
}

export interface WebpackPlugin {
// NOTE NOT SURE ABOUT THIS
// TODO DOUBLE CHECK HERE
new (options?: WebpackPluginOptions): DefinePlugin;
new (options?: WebpackPluginOptions): DefinePlugin
}
Loading

0 comments on commit 72aed6a

Please sign in to comment.