Skip to content

Commit f71b34e

Browse files
committed
Configure prettier and tslint
Overrides local tslint in the test directory so that it includes dev dependencies. Next step: linting
1 parent 2fec586 commit f71b34e

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"printWidth": 80,
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 2,
6+
"trailingComma": "all"
7+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"build": "babel src/ --out-dir=dist/ --copy-files",
1111
"dev": "concurrently --kill-others --prefix=name --names=server,eslint --prefix-colors=green,magenta \"npm run dev:server\" \"npm run dev:lint\"",
1212
"dev:server": "onchange -i -k 'src/**/*.ts' -- ts-node test/server.ts",
13-
"dev:lint": "esw src/ --changed --watch",
13+
"dev:lint": "onchange -i -k 'src/**/*.ts' -- tslint 'src/**/*.ts'",
1414
"prepublishOnly": "npm run build"
1515
},
1616
"author": "",

test/tslint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "../tslint.json",
3+
"rules": {
4+
"no-implicit-dependencies": [true, "dev"]
5+
}
6+
}

tslint.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"extends": ["tslint:latest", "tslint-config-prettier"],
3+
"rulesDirectory": [
4+
"tslint-plugin-prettier"
5+
],
6+
"rules": {
7+
"prettier": true,
8+
"no-console": [false],
9+
"quotemark": [true, "single"],
10+
"semicolon": [true, "always", "ignore-bound-class-methods"],
11+
"trailing-comma": [true, {
12+
"multiline": "always",
13+
"singleline": "never"
14+
}],
15+
"only-arrow-functions": [true, "allow-named-functions"],
16+
"arrow-parens": false,
17+
"variable-name": [true, "check-format", "allow-pascal-case", "allow-leading-underscore"],
18+
"switch-default": false,
19+
"member-access": false,
20+
"ordered-imports": [false],
21+
"object-literal-sort-keys": false,
22+
"no-unused-expression": [true, "allow-fast-null-checks", "allow-tagged-template"],
23+
"max-classes-per-file": [true, 1],
24+
"object-literal-key-quotes": [true, "as-needed"],
25+
"no-object-literal-type-assertion": false,
26+
"member-ordering": [true, {
27+
"order": "statics-first"
28+
}],
29+
"no-submodule-imports": false,
30+
"interface-name": [true, "never-prefix"]
31+
}
32+
}

0 commit comments

Comments
 (0)