summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2018-08-08 23:10:39 -0400
committerPhilip Chimento <philip.chimento@gmail.com>2018-08-09 19:12:42 -0400
commita0229da3bce64cbe67a0340f2cf8f35c5037df42 (patch)
tree02cb393e20c2b4330c8a38e4f40bbf7fa947a5f4
parent2a0834f338c9535494a87ad010ae3cc7d7d7930d (diff)
downloadgjs-a0229da3bce64cbe67a0340f2cf8f35c5037df42.tar.gz
build: Fix linter rules
Add some eslint rules, and disable the clang-format rules for JS as they are getting too incompatible with eslint. [skip eslint] as this will change the eslint outcome.
-rw-r--r--.clang-format14
-rw-r--r--.eslintrc.json30
2 files changed, 30 insertions, 14 deletions
diff --git a/.clang-format b/.clang-format
index 50769463..e1b30577 100644
--- a/.clang-format
+++ b/.clang-format
@@ -14,16 +14,8 @@ IndentWidth: 4
PointerAlignment: Left # Google style allows both, but clang-format doesn't
SpacesBeforeTrailingComments: 2
---
-# We rely mostly on eslint for JavaScript linting, but this is a lax collection
-# of rules that will auto-fix some JS things. We really should use eslint --fix
-# instead, but we need to find a way to get that to operate on diffs like
-# clang-format does.
+# We should use eslint --fix instead, but we need to find a way to get that to
+# operate on diffs like clang-format does.
Language: JavaScript
-AlignAfterOpenBracket: DontAlign
-AllowShortFunctionsOnASingleLine: false
-JavaScriptQuotes: Leave # It's not smart enough to allow " to minimize escapes
-PenaltyBreakBeforeFirstCallParameter: 1000000
-PenaltyExcessCharacter: 1
-SpacesBeforeTrailingComments: 2
-SpacesInContainerLiterals: false
+DisableFormat: true
...
diff --git a/.eslintrc.json b/.eslintrc.json
index eae87873..5dca4532 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -4,7 +4,14 @@
},
"extends": "eslint:recommended",
"rules": {
- "array-bracket-spacing": ["error", "never"],
+ "array-bracket-newline": [
+ "error",
+ "consistent"
+ ],
+ "array-bracket-spacing": [
+ "error",
+ "never"
+ ],
"brace-style": "error",
"comma-spacing": [
"error",
@@ -44,7 +51,24 @@
"allowEmptyCatch": true
}
],
- "nonblock-statement-body-position": ["error", "below"],
+ "no-implicit-coercion": [
+ "error",
+ {
+ "allow": ["!!"]
+ }
+ ],
+ "nonblock-statement-body-position": [
+ "error",
+ "below"
+ ],
+ "object-curly-newline": [
+ "error",
+ {
+ "consistent": true
+ }
+ ],
+ "object-curly-spacing": "error",
+ "prefer-template": "error",
"quotes": [
"error",
"single",
@@ -86,4 +110,4 @@
"parserOptions": {
"ecmaVersion": 2017
}
-} \ No newline at end of file
+}