Skip to content

Commit 02ecec3

Browse files
Merge pull request #168 from preactjs/prettier
2 parents 60431d9 + 4ff57e3 commit 02ecec3

File tree

14 files changed

+2059
-538
lines changed

14 files changed

+2059
-538
lines changed

package-lock.json

Lines changed: 1252 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 125 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,127 @@
11
{
2-
"name": "preact-render-to-string",
3-
"amdName": "preactRenderToString",
4-
"version": "5.1.10",
5-
"description": "Render JSX to an HTML string, with support for Preact components.",
6-
"main": "dist/index.js",
7-
"umd:main": "dist/index.js",
8-
"module": "dist/index.module.js",
9-
"jsnext:main": "dist/index.module.js",
10-
"exports": {
11-
".": {
12-
"require": "./dist/index.js",
13-
"import": "./dist/index.mjs",
14-
"browser": "./dist/index.module.js"
15-
},
16-
"./jsx": {
17-
"require": "./dist/jsx.js",
18-
"import": "./dist/jsx.mjs",
19-
"browser": "./dist/jsx.module.js"
20-
},
21-
"./package.json": "./package.json",
22-
"./": "./"
23-
},
24-
"scripts": {
25-
"build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
26-
"postbuild": "node ./config/node-13-exports.js",
27-
"transpile": "microbundle src/index.js -f es,umd --target web --external preact",
28-
"transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs",
29-
"copy-typescript-definition": "copyfiles -f src/*.d.ts dist",
30-
"test": "eslint src test && tsc && mocha -r babel-core/register test/**/*.js",
31-
"prepublishOnly": "npm run build",
32-
"release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
33-
},
34-
"keywords": [
35-
"preact",
36-
"render",
37-
"universal",
38-
"isomorphic"
39-
],
40-
"files": [
41-
"src",
42-
"dist",
43-
"jsx.js",
44-
"typings.json"
45-
],
46-
"eslintConfig": {
47-
"extends": "developit",
48-
"rules": {
49-
"react/prefer-stateless-function": 0,
50-
"react/jsx-no-bind": 0,
51-
"react/no-danger": 0,
52-
"jest/valid-expect": 0,
53-
"new-cap": 0
54-
},
55-
"settings": {
56-
"react": {
57-
"version": "16.8"
58-
}
59-
}
60-
},
61-
"babel": {
62-
"presets": [
63-
"env"
64-
],
65-
"plugins": [
66-
[
67-
"transform-react-jsx",
68-
{
69-
"pragma": "h"
70-
}
71-
],
72-
"transform-object-rest-spread"
73-
]
74-
},
75-
"author": "Jason Miller <[email protected]>",
76-
"license": "MIT",
77-
"typings": "src/index.d.ts",
78-
"repository": "developit/preact-render-to-string",
79-
"bugs": "https://github.com/developit/preact-render-to-string/issues",
80-
"homepage": "https://github.com/developit/preact-render-to-string",
81-
"peerDependencies": {
82-
"preact": ">=10"
83-
},
84-
"devDependencies": {
85-
"babel-plugin-transform-object-rest-spread": "^6.26.0",
86-
"babel-plugin-transform-react-jsx": "^6.24.1",
87-
"babel-preset-env": "^1.7.0",
88-
"babel-register": "^6.26.0",
89-
"chai": "^3.5.0",
90-
"copyfiles": "^1.2.0",
91-
"eslint": "^4.19.1",
92-
"eslint-config-developit": "^1.1.1",
93-
"microbundle": "^0.6.0",
94-
"mocha": "^5.2.0",
95-
"npm-merge-driver-install": "^1.1.1",
96-
"preact": "^10.0.4",
97-
"sinon": "^1.17.5",
98-
"sinon-chai": "^2.8.0",
99-
"typescript": "^3.4.1"
100-
},
101-
"dependencies": {
102-
"pretty-format": "^3.8.0"
103-
}
2+
"name": "preact-render-to-string",
3+
"amdName": "preactRenderToString",
4+
"version": "5.1.10",
5+
"description": "Render JSX to an HTML string, with support for Preact components.",
6+
"main": "dist/index.js",
7+
"umd:main": "dist/index.js",
8+
"module": "dist/index.module.js",
9+
"jsnext:main": "dist/index.module.js",
10+
"exports": {
11+
".": {
12+
"require": "./dist/index.js",
13+
"import": "./dist/index.mjs",
14+
"browser": "./dist/index.module.js"
15+
},
16+
"./jsx": {
17+
"require": "./dist/jsx.js",
18+
"import": "./dist/jsx.mjs",
19+
"browser": "./dist/jsx.module.js"
20+
},
21+
"./package.json": "./package.json",
22+
"./": "./"
23+
},
24+
"scripts": {
25+
"build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
26+
"postbuild": "node ./config/node-13-exports.js",
27+
"transpile": "microbundle src/index.js -f es,umd --target web --external preact",
28+
"transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs",
29+
"copy-typescript-definition": "copyfiles -f src/*.d.ts dist",
30+
"test": "eslint src test && tsc && mocha -r babel-core/register test/**/*.js",
31+
"format": "prettier src/**/*.{d.ts,js} test/**/*.js --write",
32+
"prepublishOnly": "npm run build",
33+
"release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
34+
},
35+
"keywords": [
36+
"preact",
37+
"render",
38+
"universal",
39+
"isomorphic"
40+
],
41+
"files": [
42+
"src",
43+
"dist",
44+
"jsx.js",
45+
"typings.json"
46+
],
47+
"eslintConfig": {
48+
"extends": "developit",
49+
"rules": {
50+
"react/prefer-stateless-function": 0,
51+
"react/jsx-no-bind": 0,
52+
"react/no-danger": 0,
53+
"jest/valid-expect": 0,
54+
"new-cap": 0,
55+
"curly": "off",
56+
"brace-style": "off",
57+
"indent": "off"
58+
},
59+
"settings": {
60+
"react": {
61+
"version": "16.8"
62+
}
63+
}
64+
},
65+
"babel": {
66+
"presets": [
67+
"env"
68+
],
69+
"plugins": [
70+
[
71+
"transform-react-jsx",
72+
{
73+
"pragma": "h"
74+
}
75+
],
76+
"transform-object-rest-spread"
77+
]
78+
},
79+
"author": "Jason Miller <[email protected]>",
80+
"license": "MIT",
81+
"typings": "src/index.d.ts",
82+
"repository": "developit/preact-render-to-string",
83+
"bugs": "https://github.com/developit/preact-render-to-string/issues",
84+
"homepage": "https://github.com/developit/preact-render-to-string",
85+
"peerDependencies": {
86+
"preact": ">=10"
87+
},
88+
"devDependencies": {
89+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
90+
"babel-plugin-transform-react-jsx": "^6.24.1",
91+
"babel-preset-env": "^1.7.0",
92+
"babel-register": "^6.26.0",
93+
"chai": "^3.5.0",
94+
"copyfiles": "^1.2.0",
95+
"eslint": "^4.19.1",
96+
"eslint-config-developit": "^1.1.1",
97+
"husky": "^4.3.0",
98+
"lint-staged": "^10.4.0",
99+
"microbundle": "^0.6.0",
100+
"mocha": "^5.2.0",
101+
"npm-merge-driver-install": "^1.1.1",
102+
"preact": "^10.0.4",
103+
"prettier": "^2.1.2",
104+
"sinon": "^1.17.5",
105+
"sinon-chai": "^2.8.0",
106+
"typescript": "^3.4.1"
107+
},
108+
"dependencies": {
109+
"pretty-format": "^3.8.0"
110+
},
111+
"prettier": {
112+
"singleQuote": true,
113+
"trailingComma": "none",
114+
"useTabs": true,
115+
"tabWidth": 2
116+
},
117+
"lint-staged": {
118+
"**/*.{js,jsx,ts,tsx,yml}": [
119+
"prettier --write"
120+
]
121+
},
122+
"husky": {
123+
"hooks": {
124+
"pre-commit": "lint-staged"
125+
}
126+
}
104127
}

src/index.d.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import { VNode } from 'preact';
22

33
interface Options {
4-
shallow?: boolean;
5-
xml?: boolean;
6-
pretty?: boolean | string;
4+
shallow?: boolean;
5+
xml?: boolean;
6+
pretty?: boolean | string;
77
}
88

9-
export function render(vnode: VNode, context?: any, options?: Options):string;
10-
export function renderToString(vnode: VNode, context?: any, options?: Options):string;
11-
export function shallowRender(vnode: VNode, context?: any):string;
9+
export function render(vnode: VNode, context?: any, options?: Options): string;
10+
export function renderToString(
11+
vnode: VNode,
12+
context?: any,
13+
options?: Options
14+
): string;
15+
export function shallowRender(vnode: VNode, context?: any): string;
1216
export default render;

0 commit comments

Comments
 (0)