Skip to content

Commit

Permalink
refactor: use ts-config-standard
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed Mar 27, 2017
1 parent a2e2555 commit 240e602
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 177 deletions.
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
access=public
24 changes: 14 additions & 10 deletions package.json
@@ -1,13 +1,16 @@
{
"name": "typescript-lib-starter",
"name": "@next-gen/typescript-lib-starter",
"version": "1.3.0",
"description": "TypeScript library setup for multiple compilation targets using tsc and webpack",
"main": "lib/index.js",
"module": "lib-esm/index.js",
"jsnext:main": "lib-esm/index.js",
"umd:main": "umd/typescript-lib-starter.min.js",
"typings": "typings/index.d.ts",
"repository": "https://www.github.com/Hotell/typescript-lib-starter",
"repository": {
"type": "git",
"url": "https://www.github.com/Hotell/typescript-lib-starter"
},
"author": "Martin Hochel",
"license": "MIT",
"engines": {
Expand Down Expand Up @@ -87,23 +90,24 @@
"dependencies": {},
"devDependencies": {
"@types/jest": "19.2.2",
"awesome-typescript-loader": "3.0.8",
"awesome-typescript-loader": "3.1.2",
"commitizen": "2.9.6",
"cross-var": "1.0.2",
"cross-var": "1.0.3",
"cz-conventional-changelog": "2.0.0",
"gzip-size-cli": "2.0.0",
"husky": "0.13.1",
"husky": "0.13.3",
"irish-pub": "0.2.0",
"jest": "19.0.2",
"shx": "0.2.2",
"standard-version": "4.0.0",
"strip-json-comments-cli": "1.0.1",
"ts-jest": "19.0.1",
"ts-jest": "19.0.6",
"tslint": "4.5.1",
"tslint-react": "2.4.0",
"tslint-config-standard": "4.0.0",
"tslint-react": "2.5.0",
"typescript": "2.2.1",
"typescript-formatter": "5.0.1",
"validate-commit-msg": "2.11.1",
"webpack": "2.2.1"
"typescript-formatter": "5.1.2",
"validate-commit-msg": "2.11.2",
"webpack": "2.3.2"
}
}
2 changes: 1 addition & 1 deletion src/Greeter.ts
@@ -1,6 +1,6 @@
export class Greeter {
constructor(private greeting: string) { }
greet() {
return `Hello, ${this.greeting}!`;
return `Hello, ${this.greeting}!`
}
}
18 changes: 9 additions & 9 deletions src/__tests__/Greeter.spec.ts
@@ -1,20 +1,20 @@
import { Greeter } from '../Greeter';
import { Greeter } from '../Greeter'

describe(`Greeter`, () => {

let greeter: Greeter;
let greeter: Greeter

beforeEach(() => {
greeter = new Greeter('World');
});
greeter = new Greeter('World')
})

it(`should greet`, () => {

const actual = greeter.greet();
const expected = 'Hello, World!';
const actual = greeter.greet()
const expected = 'Hello, World!'

expect(actual).toBe(expected);
expect(actual).toBe(expected)

});
})

});
})
100 changes: 4 additions & 96 deletions tslint.json
@@ -1,5 +1,6 @@
{
"extends": [
"tslint-config-standard",
"tslint-react"
],
"rules": {
Expand All @@ -10,22 +11,14 @@
"jsx-no-multiline-js": false,
"jsx-curly-spacing": false,
"jsx-wrap-multiline": false,
"jsx-boolean-value": [true,"never"],
"arrow-parens": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"use-isnan": true,
"await-promise": true,
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
"spaces"
],
"label-position": true,
"linebreak-style": [
true,
"LF"
Expand All @@ -34,7 +27,6 @@
true,
120
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
Expand All @@ -46,19 +38,8 @@
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"trailing-comma": [
true
],
"no-trailing-whitespace": true,
"no-consecutive-blank-lines": [
true
],
"no-inferrable-types": [
true
],
Expand All @@ -67,85 +48,13 @@
"no-require-imports": true,
"no-duplicate-super": true,
"no-boolean-literal-compare": true,
"no-unused-expression": true,
"no-use-before-declare": false,
"no-var-keyword": true,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"radix": true,
"semicolon": [
true,
"always",
"ignore-interfaces"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
},
{
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
}
],
"variable-name": [
true,
"ban-keywords",
"allow-leading-underscore"
],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type",
"check-typecast"
],
"space-before-function-paren": [true, "never"],
"quotemark": [
true,
"single",
"avoid-escape",
"jsx-double"
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"public-static-field",
"private-static-field",
"public-static-method",
"private-static-method",
"public-instance-field",
"protected-instance-field",
"private-instance-field",
"constructor",
"public-instance-method",
"protected-instance-method",
"private-instance-method"
]
}
],
"one-variable-per-declaration": [
true
],
"no-namespace": [
true,
"allow-declarations"
Expand All @@ -161,7 +70,6 @@
"interface-name": [
false
],
"no-angle-bracket-type-assertion": true,
"newline-before-return": true,
"object-literal-shorthand": true,
"typeof-compare": true,
Expand Down

0 comments on commit 240e602

Please sign in to comment.