Commit a0229da3 authored by Philip Chimento's avatar Philip Chimento 🚮

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.
parent 2a0834f3
......@@ -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
...
......@@ -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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment