[gjs: 1/5] CI: Adjust eslint and clang-format rules [skip eslint]
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/5] CI: Adjust eslint and clang-format rules [skip eslint]
- Date: Mon, 23 Jul 2018 18:10:29 +0000 (UTC)
commit 8ae00b8e68f512e665aa0fdb7fa7eea78274bc97
Author: Philip Chimento <philip chimento gmail com>
Date: Tue Jul 3 00:34:04 2018 +0200
CI: Adjust eslint and clang-format rules [skip eslint]
.clang-format | 4 +++-
.eslintrc.json | 9 +++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/.clang-format b/.clang-format
index 1dc29a2e..50769463 100644
--- a/.clang-format
+++ b/.clang-format
@@ -12,6 +12,7 @@ DerivePointerAlignment: false
ForEachMacros: []
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
@@ -20,8 +21,9 @@ PointerAlignment: Left # Google style allows both, but clang-format doesn't
Language: JavaScript
AlignAfterOpenBracket: DontAlign
AllowShortFunctionsOnASingleLine: false
-JavaScriptQuotes: Single
+JavaScriptQuotes: Leave # It's not smart enough to allow " to minimize escapes
PenaltyBreakBeforeFirstCallParameter: 1000000
PenaltyExcessCharacter: 1
+SpacesBeforeTrailingComments: 2
SpacesInContainerLiterals: false
...
diff --git a/.eslintrc.json b/.eslintrc.json
index 82edcf07..eae87873 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -4,6 +4,7 @@
},
"extends": "eslint:recommended",
"rules": {
+ "array-bracket-spacing": ["error", "never"],
"brace-style": "error",
"comma-spacing": [
"error",
@@ -19,6 +20,13 @@
"MemberExpression": "off"
}
],
+ "key-spacing": [
+ "error",
+ {
+ "beforeColon": false,
+ "afterColon": true
+ }
+ ],
"keyword-spacing": [
"error",
{
@@ -36,6 +44,7 @@
"allowEmptyCatch": true
}
],
+ "nonblock-statement-body-position": ["error", "below"],
"quotes": [
"error",
"single",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]