Skip to content

Commit

Permalink
feat: migrate to prettier and bump deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Jun 4, 2017
1 parent eee2150 commit 999043e
Show file tree
Hide file tree
Showing 5 changed files with 1,302 additions and 1,474 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -2,6 +2,7 @@

[![Build Status](https://travis-ci.org/Hotell/typescript-lib-starter.svg?branch=master)](https://travis-ci.org/Hotell/typescript-lib-starter)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)


> based on https://github.com/elboman/typescript-lib-example and http://marcobotto.com/compiling-and-bundling-typescript-libraries-with-webpack/
Expand Down
57 changes: 29 additions & 28 deletions package.json
Expand Up @@ -22,16 +22,18 @@
"build": " tsc && tsc --module es2015 --target es2015 --outDir lib-esm && webpack",
"docs": "typedoc -p . --theme minimal --target 'es6' --excludeNotExported --excludePrivate --ignoreCompilerErrors --exclude \"**/src/**/__tests__/*.*\" --out docs src/",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"ts:lint": "tslint --project tsconfig.json --type-check \"src/**/*.tsx\" \"src/**/*.ts\"",
"test:watch": "npm test -- --watch",
"test:coverage": "npm test -- --coverage",
"ts:lint": "tslint --project tsconfig.json --type-check \"src/**/*.{ts,tsx}\"",
"ts:lint:fix": "npm run ts:lint -- --fix",
"ts:format": "tsfmt --verify",
"ts:format:fix": "tsfmt -r",
"ts:format:base": "prettier --single-quote --print-width 120 --trailing-comma es5 --no-semi --parser typescript {src,__{tests,mocks}__}/**/*.{ts,tsx}",
"ts:format": "npm run ts:format:base -- --list-different",
"ts:format:fix": "npm run ts:format:base -- --write",
"ts:style": "npm run ts:format && npm run ts:lint",
"ts:style:fix": "npm run ts:format:fix && npm run ts:lint:fix",
"verify": "npm run ts:style && npm test",
"commit": "git-cz",
"precommit": "lint-staged",
"commitmsg": "validate-commit-msg",
"prepush": "npm run verify",
"prerelase": "npm run build",
Expand All @@ -52,28 +54,26 @@
"maxSubjectLength": 120
}
},
"lint-staged": {
"src/**/*.{ts,tsx}": [
"ts:style:fix",
"git add"
]
},
"jest": {
"globals": {
"__TS_CONFIG__": {
"module": "commonjs"
}
},
"roots": [
"<rootDir>/src"
],
"transform": {
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js"
"^.+\\.tsx?$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$",
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"modulePathIgnorePatterns": [
"/^((?!src).)/"
],
"testResultsProcessor": "<rootDir>/node_modules/ts-jest/coverageprocessor.js",
"mapCoverage": true,
"coveragePathIgnorePatterns": [
"<rootDir>/node_modules/",
"<rootDir>/lib/",
Expand All @@ -92,26 +92,27 @@
},
"dependencies": {},
"devDependencies": {
"@types/jest": "19.2.2",
"awesome-typescript-loader": "3.1.2",
"@types/jest": "19.2.4",
"awesome-typescript-loader": "3.1.3",
"commitizen": "2.9.6",
"cross-var": "1.0.3",
"cz-conventional-changelog": "2.0.0",
"gzip-size-cli": "2.0.0",
"husky": "0.13.3",
"husky": "0.13.4",
"irish-pub": "0.2.0",
"jest": "19.0.2",
"jest": "20.0.4",
"lint-staged": "3.6.0",
"prettier": "1.4.2",
"shx": "0.2.2",
"standard-version": "4.0.0",
"strip-json-comments-cli": "1.0.1",
"ts-jest": "19.0.6",
"tslint": "4.5.1",
"tslint-config-standard": "4.0.0",
"tslint-react": "2.5.0",
"typedoc": "0.5.9",
"typescript": "2.2.1",
"typescript-formatter": "5.1.2",
"validate-commit-msg": "2.11.2",
"webpack": "2.3.2"
"ts-jest": "20.0.5",
"tslint": "5.4.2",
"tslint-config-standard": "5.0.2",
"tslint-react": "3.0.0",
"typedoc": "0.7.1",
"typescript": "2.3.4",
"validate-commit-msg": "2.12.1",
"webpack": "2.6.1"
}
}
7 changes: 3 additions & 4 deletions tsconfig.json
Expand Up @@ -7,15 +7,14 @@
"es2015",
"dom"
],
"noUnusedLocals": true,
"strictNullChecks": true,
"noImplicitAny": true,
"noImplicitThis": true,
"strict": true,
"allowSyntheticDefaultImports": true,
"suppressImplicitAnyIndexErrors": true,
"forceConsistentCasingInFileNames": true,
"pretty": true,
"jsx": "react",
// change this to any hyperscript like function taht you're using'
"jsxFactory": "React",
"sourceMap": true,
"outDir": "lib",
"declaration": true,
Expand Down
3 changes: 3 additions & 0 deletions tslint.json
Expand Up @@ -4,6 +4,7 @@
"tslint-react"
],
"rules": {
// tslint-react rules
"jsx-no-lambda": true,
"jsx-alignment": true,
"jsx-no-string-ref": true,
Expand All @@ -12,8 +13,10 @@
"jsx-curly-spacing": false,
"jsx-wrap-multiline": false,
"jsx-boolean-value": [true,"never"],
// core ts-lint rules
"arrow-parens": true,
"await-promise": true,
"no-unused-variable": true,
"forin": true,
"indent": [
true,
Expand Down

0 comments on commit 999043e

Please sign in to comment.