Skip to content

Commit 5782948

Browse files
authored
Merge pull request #3 from ololabs/tslint
Add tslint-config-olo package
2 parents b870f43 + 5dfb1a9 commit 5782948

File tree

11 files changed

+179
-0
lines changed

11 files changed

+179
-0
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ node_js:
33
- "5"
44
env:
55
- PACKAGE_DIR=packages/eslint-config-olo
6+
- PACKAGE_DIR=packages/tslint-config-olo
67
- PACKAGE_DIR=packages/olo-gulp-helpers
78
script: cd $PACKAGE_DIR && npm install && npm run lint

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ This repository contains packages and guides relevant to JavaScript development
77
## Packages
88

99
- [eslint-config-olo](packages/eslint-config-olo)
10+
- [tslint-config-olo](packages/tslint-config-olo)
1011
- [olo-gulp-helpers](packages/olo-gulp-helpers)

packages/tslint-config-olo/.eslintrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "olo",
3+
"env": {
4+
"node": true
5+
}
6+
}

packages/tslint-config-olo/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Olo
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/tslint-config-olo/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# tslint-config-olo
2+
3+
This package provides Olo's shared TSLint configuration, to be used in all TypeScript applications.
4+
5+
## Usage
6+
7+
Specify the following in your `tslint.json` file:
8+
9+
```
10+
{
11+
"extends": "tslint-config-olo"
12+
}
13+
```

packages/tslint-config-olo/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: [
3+
'./rules/functionality.js',
4+
'./rules/maintainability.js',
5+
'./rules/style.js',
6+
'./rules/typescript.js',
7+
].map(require.resolve),
8+
rules: {},
9+
env: {}
10+
};
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "tslint-config-olo",
3+
"version": "0.1.0",
4+
"description": "Olo's TSLint configs",
5+
"main": "index.js",
6+
"scripts": {
7+
"lint": "eslint ."
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/ololabs/javascript"
12+
},
13+
"keywords": [
14+
"tslint",
15+
"tslintconfig",
16+
"config",
17+
"olo",
18+
"javascript",
19+
"typescript"
20+
],
21+
"author": "Olo",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/ololabs/javascript/issues"
25+
},
26+
"homepage": "https://github.com/ololabs/javascript",
27+
"devDependencies": {
28+
"eslint": "^2.5.1",
29+
"eslint-config-olo": "^0.1.1"
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
module.exports = {
2+
'rules': {
3+
'ban': false,
4+
'curly': true,
5+
'forin': true,
6+
'label-position': true,
7+
'label-undefined': true,
8+
'no-arg': true,
9+
'no-bitwise': true,
10+
'no-conditional-assignment': true,
11+
'no-console': true,
12+
'no-construct': true,
13+
'no-debugger': true,
14+
'no-duplicate-key': true,
15+
'no-duplicate-variable': true,
16+
'no-eval': true,
17+
'no-invalid-this': true,
18+
'no-null-keyword': true,
19+
'no-shadowed-variable': true,
20+
'no-string-literal': false,
21+
'no-switch-case-fall-through': true,
22+
'no-unreachable': true,
23+
'no-unused-expression': true,
24+
'no-unused-variable': [true, 'react', { 'ignore-pattern': 'React' }],
25+
'no-use-before-declare': true,
26+
'no-var-keyword': true,
27+
'radix': true,
28+
'switch-default': true,
29+
'triple-equals': true,
30+
'use-isnan': true,
31+
'use-strict': true
32+
}
33+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
'rules': {
3+
'eofline': false,
4+
'indent': [true, 'spaces'],
5+
'linebreak-style': false,
6+
'max-line-length': false,
7+
'no-default-export': false,
8+
'no-mergeable-namespace': false,
9+
'no-require-imports': true,
10+
'no-trailing-whitespace': true,
11+
'object-literal-sort-keys': false,
12+
'trailing-comma': false
13+
}
14+
};
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
'rules': {
3+
'align': true,
4+
'class-name': true,
5+
'comment-format': [true, 'check-space'],
6+
'interface-name': [true, 'always-prefix'],
7+
'jsdoc-format': true,
8+
'new-parens': true,
9+
'no-angle-bracket-type-assertion': true,
10+
'no-consecutive-blank-lines': true,
11+
'no-constructor-vars': true,
12+
'one-line': [true, 'check-catch', 'check-finally', 'check-else', 'check-open-brace', 'check-whitespace'],
13+
'one-variable-per-declaration': false,
14+
'quotemark': [true, 'single', 'jsx-double', 'avoid-escape'],
15+
'semicolon': [true, 'always'],
16+
'variable-name': false,
17+
'whitespace': [true, 'check-branch', 'check-decl', 'check-operator', 'check-module', 'check-separator', 'check-type', 'check-typecast']
18+
}
19+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
'rules': {
3+
'member-access': false,
4+
'member-ordering': false,
5+
'no-any': false,
6+
'no-inferrable-types': true,
7+
'no-internal-module': true,
8+
'no-namespace': true,
9+
'no-reference': true,
10+
'no-var-requires': true,
11+
'typedef': false,
12+
'typedef-whitespace': [
13+
true,
14+
{
15+
'call-signature': 'nospace',
16+
'index-signature': 'nospace',
17+
'parameter': 'nospace',
18+
'property-declaration': 'nospace',
19+
'variable-declaration': 'nospace'
20+
},
21+
{
22+
'call-signature': 'onespace',
23+
'index-signature': 'onespace',
24+
'parameter': 'onespace',
25+
'property-declaration': 'onespace',
26+
'variable-declaration': 'onespace'
27+
}
28+
]
29+
}
30+
};

0 commit comments

Comments
 (0)