Skip to content

Commit 43483f5

Browse files
Merge pull request #1 from 60frames/eslintrc
Add .eslintrc and .editorconfig
2 parents d1f0e02 + 43187ed commit 43483f5

File tree

8 files changed

+160
-1
lines changed

8 files changed

+160
-1
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
indent_size = 4
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[{package.json}]
17+
# The indent size used in the `package.json` file cannot be changed
18+
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
19+
indent_size = 2
20+
indent_style = space

.eslintrc-client

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./.eslintrc-default",
3+
"env": {
4+
"browser": true,
5+
"es6": true
6+
},
7+
"ecmaFeatures": {
8+
"modules": true
9+
}
10+
}

.eslintrc-default

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"rules": {
3+
// Possible Errors
4+
"no-console": 2,
5+
"no-extra-parens": 2,
6+
"valid-jsdoc": 2,
7+
"no-unexpected-multiline": 2,
8+
9+
// Best Practices
10+
"accessor-pairs": 2,
11+
"block-scoped-var": 2,
12+
"dot-location": 2,
13+
"guard-for-in": 2,
14+
"no-else-return": 2,
15+
"no-eq-null": 2,
16+
"no-floating-decimal": 2,
17+
"no-process-env": 2,
18+
"no-self-compare": 2,
19+
"no-warning-comments": [1, { "terms": ["todo"], "location": "anywhere" }],
20+
"no-throw-literal": 2,
21+
"radix": 2,
22+
"vars-on-top": 2,
23+
"wrap-iife": 2,
24+
25+
// Variables
26+
"no-catch-shadow": 2,
27+
"no-undefined": 2,
28+
29+
// Stylistic Issues
30+
"array-bracket-spacing": 2,
31+
"brace-style": 2,
32+
"comma-style": 2,
33+
"computed-property-spacing": 2,
34+
"consistent-this": [2, "self"],
35+
"func-style": [2, "declaration"],
36+
"indent": 2,
37+
"linebreak-style": 2,
38+
"max-nested-callbacks": [2, 3],
39+
"no-lonely-if": 2,
40+
"no-multiple-empty-lines": [1, { "max": 2 }],
41+
"no-nested-ternary": 2,
42+
"no-unneeded-ternary": 2,
43+
"object-curly-spacing": 2,
44+
"one-var": [2, "never"],
45+
"operator-linebreak": 2,
46+
"quotes": [2, "single", "avoid-escape"],
47+
"space-after-keywords": 2,
48+
"space-before-blocks": 2,
49+
"space-in-parens": 2,
50+
"spaced-comment": 2,
51+
52+
// ECMAScript 6
53+
"constructor-super": 2,
54+
"no-this-before-super": 2
55+
}
56+
}

.eslintrc-react

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./.eslintrc-client",
3+
"ecmaFeatures": {
4+
"jsx": true
5+
},
6+
"plugins": [
7+
"react"
8+
]
9+
}

.eslintrc-server

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./.eslintrc-default",
3+
"env": {
4+
"node": true
5+
}
6+
}

.eslintrc-test

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./.eslintrc-default",
3+
"env": {
4+
"jasmine": true
5+
}
6+
}

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# coding-standards
2-
60frame.es coding standards
2+
3+
This README will eventually outline coding standards and preferred best
4+
practices which cannot be enforced through automated tools.
5+
6+
## .eslintrc usage example
7+
```
8+
.
9+
├── src
10+
│   ├── .eslintrc /* extends .eslintrc-client || .eslintrc-react */
11+
│   └── test
12+
│   └── .eslintrc /* extends .eslintrc-test */
13+
└── server
14+
├── .eslintrc /* extends .eslintrc-server */
15+
└── test
16+
└── .eslintrc /* extends .eslintrc-test */
17+
```

package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "coding-standards",
3+
"version": "1.0.0",
4+
"description": "60fram.es coding standards.",
5+
"main": "",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/60frames/coding-standards.git"
12+
},
13+
"author": {
14+
"name": "60frames",
15+
"email": "devs@60fram.es",
16+
"url": "http://60fram.es"
17+
},
18+
"contributors": [
19+
{
20+
"name": "Matt Derrick",
21+
"email": "matt@60fram.es",
22+
"url": "http://mattderrick.co.uk"
23+
},
24+
{
25+
"name": "Richard Scarrott",
26+
"email": "rich@60fram.es"
27+
},
28+
{
29+
"name": "Albert Kang",
30+
"email": "albert@60fram.es"
31+
}
32+
],
33+
"bugs": {
34+
"url": "https://github.com/60frames/coding-standards/issues"
35+
},
36+
"homepage": "https://github.com/60frames/coding-standards"
37+
}

0 commit comments

Comments
 (0)