[gjs: 1/4] build: Fix linter rules
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/4] build: Fix linter rules
- Date: Thu, 9 Aug 2018 23:57:19 +0000 (UTC)
commit a0229da3bce64cbe67a0340f2cf8f35c5037df42
Author: Philip Chimento <philip chimento gmail com>
Date: Wed Aug 8 23:10:39 2018 -0400
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.
.clang-format | 14 +++-----------
.eslintrc.json | 30 +++++++++++++++++++++++++++---
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
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]