Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit 667b298

Browse files
committed
Merge pull request #56 from mobify/eslint-update
Beef up .eslintrc with rules from JS code style doc
2 parents 4a4242a + e61dd70 commit 667b298

3 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2.1.0
2+
- Add new rules to .eslintrc to closer match our JS style
3+
guidelines.
4+
2.0.1
5+
- Adds .eslintrc to allow usage of ESLint
6+
- Adds Java code style guide
7+
- Updates to CSS hybrid project conventions

javascript/.eslintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"Adaptive": true
1313
},
1414
"rules": {
15+
// K&R brace style, e.g. `if (x) {` <-- no new line before {
16+
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
17+
1518
// Enforce === instead of ==; !== instead of !=
1619
"eqeqeq": 2,
1720

@@ -48,6 +51,9 @@
4851
// Disallow mixed spaces and tabs for indentation
4952
"no-mixed-spaces-and-tabs": 2,
5053

54+
// Enforce 4 spaces indentation
55+
"indent": [2, 4, {"indentSwitchCase": true}],
56+
5157
// Disallow use of multiline strings
5258
"no-multi-str": 2,
5359

@@ -67,6 +73,9 @@
6773
// Enforce spacing before opening brace of block statements
6874
"space-before-blocks": [2, "always"],
6975

76+
// Disallow spaces before function parentheses
77+
"space-before-function-paren": [2, "never"],
78+
7079
// Enforce spaceing around infix operators: +, -, :, ?
7180
"space-infix-ops": 2,
7281

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobify-code-style",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "Code style guide and linting tools for Mobify",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)