Skip to content

Commit 1feb7f3

Browse files
committed
Prepping the package to be delivered over the internets.
1 parent 135b512 commit 1feb7f3

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Writing Javascript at Transit
2+
_Javascript style guide we use at [Transit](https://transitapp.com/)._
3+
4+
## Content
5+
- [Airbnb Javascript style guide](#airbnb-javascript-style-guide)
6+
- [Exceptions](#exceptions)
7+
8+
## Airbnb Javascript style guide
9+
Our styles are based on the excellent [javascript guide from Airbnb](https://github.com/airbnb/javascript) with a few exceptions.
10+
11+
## Exceptions
12+
13+
### Whitespace
14+
- Limit your lines to 105 characters. eslint: [max-len](http://eslint.org/docs/rules/max-len).
15+
> This ensures readability and maintainability.
16+
17+
```javascript
18+
// Bad.
19+
const promise = Promise.resolve(true).then(Promise.resolve).then(Promise.resolve).then(Promise.resolve).then(Promise.resolve);
20+
21+
// Good
22+
const promise = Promise.resolve()
23+
.then(Promise.resolve)
24+
.then(Promise.resolve)
25+
.then(Promise.resolve)
26+
.then(Promise.resolve);
27+
```
28+
29+
## Naming conventions
30+
For sure, there are things we'd like to add here.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "eslint-config-transit",
3+
"version": "0.0.1",
4+
"description": "Transit's ESLint config",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "eslint test"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+ssh://[email protected]/TransitApp/javascript.git"
12+
},
13+
"keywords": [
14+
"eslint",
15+
"eslintconfig",
16+
"config",
17+
"transit",
18+
"javascript",
19+
"styleguide"
20+
],
21+
"author": "Thomas Lefebvre <[email protected]>",
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/TransitApp/javascript/issues"
25+
},
26+
"homepage": "https://github.com/TransitApp/javascript#readme",
27+
"peerDependencies": {
28+
"eslint": "^3.15.0"
29+
},
30+
"dependencies": {
31+
"eslint-config-airbnb-base": "^11.1.0"
32+
},
33+
"eslintConfig": {
34+
"extends": "airbnb-base",
35+
"parserOptions": {
36+
"ecmaVersion": 6,
37+
"ecmaFeatures": {}
38+
},
39+
"rules": {
40+
"max-len": ["error", 105, 2]
41+
}
42+
},
43+
"engines": {
44+
"node": ">= 4.0.0"
45+
}
46+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// # Whitespace
2+
// Limit your lines to 105 characters
3+
function testMyStringLikeYouNeverTestedItBefore() {
4+
const string = 'The path of the righteous man is beset on all sides by the iniquities of the ' +
5+
'selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, ' +
6+
'shepherds the weak through the valley of darkness, for he is truly his brother\'s ' +
7+
'keeper and the finder of lost children. And I will strike down upon thee with great' +
8+
'vengeance and furious anger those who would attempt to poison and destroy My brothers.';
9+
10+
return string;
11+
}
12+
13+
testMyStringLikeYouNeverTestedItBefore();

0 commit comments

Comments
 (0)