Skip to content

Add .eslintrc and .editorconfig #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig: http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[{package.json}]
# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
indent_size = 2
indent_style = space
10 changes: 10 additions & 0 deletions .eslintrc-client
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./.eslintrc-default",
"env": {
"browser": true,
"es6": true
},
"ecmaFeatures": {
"modules": true
}
}
56 changes: 56 additions & 0 deletions .eslintrc-default
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"rules": {
// Possible Errors
"no-console": 2,
"no-extra-parens": 2,
"valid-jsdoc": 2,
"no-unexpected-multiline": 2,

// Best Practices
"accessor-pairs": 2,
"block-scoped-var": 2,
"dot-location": 2,
"guard-for-in": 2,
"no-else-return": 2,
"no-eq-null": 2,
"no-floating-decimal": 2,
"no-process-env": 2,
"no-self-compare": 2,
"no-warning-comments": [1, { "terms": ["todo"], "location": "anywhere" }],
"no-throw-literal": 2,
"radix": 2,
"vars-on-top": 2,
"wrap-iife": 2,

// Variables
"no-catch-shadow": 2,
"no-undefined": 2,

// Stylistic Issues
"array-bracket-spacing": 2,
"brace-style": 2,
"comma-style": 2,
"computed-property-spacing": 2,
"consistent-this": [2, "self"],
"func-style": [2, "declaration"],
"indent": 2,
"linebreak-style": 2,
"max-nested-callbacks": [2, 3],
"no-lonely-if": 2,
"no-multiple-empty-lines": [1, { "max": 2 }],
"no-nested-ternary": 2,
"no-unneeded-ternary": 2,
"object-curly-spacing": 2,
"one-var": [2, "never"],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dupe

"operator-linebreak": 2,
"quotes": [2, "single", "avoid-escape"],
"space-after-keywords": 2,
"space-before-blocks": 2,
"space-in-parens": 2,
"spaced-comment": 2,

// ECMAScript 6
"constructor-super": 2,
"no-this-before-super": 2
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing "no-warning-comments": [1, { "terms": ["todo"], "location": "anywhere" }]"

9 changes: 9 additions & 0 deletions .eslintrc-react
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./.eslintrc-client",
"ecmaFeatures": {
"jsx": true
},
"plugins": [
"react"
]
}
6 changes: 6 additions & 0 deletions .eslintrc-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./.eslintrc-default",
"env": {
"node": true
}
}
6 changes: 6 additions & 0 deletions .eslintrc-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./.eslintrc-default",
"env": {
"jasmine": true
}
}
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# coding-standards
60frame.es coding standards

This README will eventually outline coding standards and preferred best
practices which cannot be enforced through automated tools.

## .eslintrc usage example
```
.
├── src
│   ├── .eslintrc /* extends .eslintrc-client || .eslintrc-react */
│   └── test
│   └── .eslintrc /* extends .eslintrc-test */
└── server
├── .eslintrc /* extends .eslintrc-server */
└── test
└── .eslintrc /* extends .eslintrc-test */
```
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "coding-standards",
"version": "1.0.0",
"description": "60fram.es coding standards.",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/60frames/coding-standards.git"
},
"author": {
"name": "60frames",
"email": "devs@60fram.es",
"url": "http://60fram.es"
},
"contributors": [
{
"name": "Matt Derrick",
"email": "matt@60fram.es",
"url": "http://mattderrick.co.uk"
},
{
"name": "Richard Scarrott",
"email": "rich@60fram.es"
},
{
"name": "Albert Kang",
"email": "albert@60fram.es"
}
],
"bugs": {
"url": "https://github.com/60frames/coding-standards/issues"
},
"homepage": "https://github.com/60frames/coding-standards"
}