Skip to content

Commit

Permalink
Merge pull request #166 from WordPress/add/base-eslint
Browse files Browse the repository at this point in the history
Add base ESLint and EditorConfig configurations
  • Loading branch information
aduth authored Mar 2, 2017
2 parents a15ce73 + a9b1dc1 commit d386503
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = tab
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
53 changes: 53 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"root": true,
"extends": "wordpress",
"env": {
"browser": true
},
"rules": {
"array-bracket-spacing": [ "error", "always" ],
"brace-style": [ "error", "1tbs" ],
"comma-spacing": "error",
"comma-style": "error",
"computed-property-spacing": [ "error", "always" ],
"dot-notation": "error",
"eol-last": "error",
"func-call-spacing": "error",
"indent": [ "error", "tab", { "SwitchCase": 1 } ],
"key-spacing": "error",
"keyword-spacing": "error",
"no-console": "error",
"no-debugger": "error",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-else-return": "error",
"no-extra-semi": "error",
"no-lonely-if": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": [ "error", { "max": 1 } ],
"no-multi-spaces": "error",
"no-negated-in-lhs": "error",
"no-nested-ternary": "error",
"no-redeclare": "error",
"no-shadow": "error",
"no-unreachable": "error",
"no-use-before-define": [ "error", "nofunc" ],
"no-var": "error",
"object-curly-spacing": [ "error", "always" ],
"padded-blocks": [ "error", "never" ],
"quote-props": [ "error", "as-needed", { "keywords": true } ],
"semi": "error",
"semi-spacing": "error",
"space-before-blocks": [ "error", "always" ],
"space-before-function-paren": [ "error", "never" ],
"space-in-parens": [ "error", "always" ],
"space-infix-ops": [ "error", { "int32Hint": false } ],
"space-unary-ops": [ "error", {
"overrides": {
"!": true
}
} ],
"valid-jsdoc": [ "error", { "requireReturn": false } ]
}
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
},
"homepage": "https://github.com/WordPress/gutenberg#readme",
"devDependencies": {
"eslint": "^3.16.1",
"eslint-config-wordpress": "^1.1.0",
"http-server": "0.9.0"
}
}

0 comments on commit d386503

Please sign in to comment.