Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to TypeScript #26

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ indent_size = 2

[*.md]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2
57 changes: 0 additions & 57 deletions .eslintrc

This file was deleted.

111 changes: 70 additions & 41 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
{
"name": "vhtml",
"amdName": "vhtml",
"version": "2.2.0",
"version": "3.0.0",
"description": "Hyperscript reviver that constructs a sanitized HTML string.",
"jsnext:main": "dist/vhtml.es.js",
"source": "src/vhtml.ts",
"module": "dist/vhtml.es.js",
"esmodules": "dist/vhtml.modern.js",
"main": "dist/vhtml.js",
"minified:main": "dist/vhtml.min.js",
"jsnext:main": "src/vhtml.js",
"umd:main": "dist/vhtml.umd.js",
"typings": "dist/vhtml.d.ts",
"scripts": {
"build": "npm-run-all transpile minify size",
"transpile": "rollup -c rollup.config.js",
"minify": "uglifyjs $npm_package_main -cm -o $npm_package_minified_main -p relative --in-source-map ${npm_package_main}.map --source-map ${npm_package_minified_main}.map",
"size": "echo \"gzip size: $(gzip-size $npm_package_minified_main | pretty-bytes)\"",
"test": "eslint {src,test} && mocha --compilers js:babel-register test/**/*.js",
"prepublish": "npm-run-all build test",
"release": "npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
},
"babel": {
"presets": [
"es2015",
"stage-0"
],
"plugins": [
"transform-object-rest-spread",
[
"transform-react-jsx",
{
"pragma": "h"
}
]
]
"test": "npm-run-all --silent typecheck lint testonly",
"testonly": "mocha --require ts-node/register --require tsconfig-paths/register test/**/*.tsx",
"lint": "eslint src test --ext tsx --ext ts --ext jsx --ext js",
"typecheck": "tsc --noEmit",
"bundle": "microbundle && cp src/jsx.d.ts dist/jsx.d.ts && rimraf dist/empty-tags.d.ts",
"build": "npm run clean && npm run bundle",
"clean": "rimraf dist",
"release": "npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"
},
"files": [
"src",
Expand All @@ -50,24 +40,63 @@
"url": "https://github.com/developit/vhtml/issues"
},
"homepage": "https://github.com/developit/vhtml",
"eslintConfig": {
"extends": [
"developit",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"env": {
"browser": true,
"mocha": true,
"jest": false,
"es6": true
},
"globals": {
"expect": true
},
"settings": {
"react": {
"pragma": "h",
"version": "16.13"
}
},
"rules": {
"semi": [
2,
"always"
],
"jest/valid-expect": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-empty-interface": 0,
"react/no-danger": 0,
"react/self-closing-comp": 0
}
},
"eslintIgnore": [
"dist"
],
"devDependencies": {
"babel-core": "^6.6.4",
"babel-eslint": "^7.0.0",
"babel-plugin-transform-object-rest-spread": "^6.6.4",
"babel-plugin-transform-react-jsx": "^6.6.5",
"babel-preset-es2015": "^6.9.0",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.7.2",
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
"@typescript-eslint/eslint-plugin": "^3.0.1",
"@typescript-eslint/parser": "^3.0.1",
"chai": "^3.5.0",
"eslint": "^3.1.0",
"gzip-size-cli": "^1.0.0",
"mkdirp": "^0.5.1",
"mocha": "^3.1.2",
"eslint": "^7.2.0",
"eslint-config-developit": "^1.2.0",
"microbundle": "^0.12.0",
"mocha": "^8.0.1",
"npm-run-all": "^2.3.0",
"pretty-bytes-cli": "^1.0.0",
"rollup": "^0.36.3",
"rollup-plugin-babel": "^2.4.0",
"rollup-plugin-es3": "^1.0.3",
"uglify-js": "^2.6.2"
"rimraf": "^3.0.2",
"ts-node": "^8.10.2",
"tsconfig-paths": "^3.9.0",
"typescript": "^3.9.3"
}
}
26 changes: 0 additions & 26 deletions rollup.config.js

This file was deleted.

3 changes: 1 addition & 2 deletions src/empty-tags.js → src/empty-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export default [
'base',
'br',
'col',
'command',
'embed',
'hr',
'img',
Expand All @@ -15,4 +14,4 @@ export default [
'source',
'track',
'wbr'
];
];
Loading