[gnome-shell-extensions/wip/fmuellner/lint-ci: 11/18] lint: Allow marking variables/arguments as unused
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions/wip/fmuellner/lint-ci: 11/18] lint: Allow marking variables/arguments as unused
- Date: Mon, 28 Jan 2019 05:53:14 +0000 (UTC)
commit 85112394b36c0c5de7d42b32bc36df8c74eda8d3
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jan 28 01:37:12 2019 +0100
lint: Allow marking variables/arguments as unused
Unused variables or arguments can indicate bugs, but they can also
help document the code, in particular in case of signal handlers
and destructuring.
Account for this by keeping the error, but set up patterns that allow
us to opt out of if for individual variables/arguments. For arguments
we pick a '_' prefix, while for variables we go with a suffix instead,
to not accidentally exempt private module-scope variables.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/50
lint/eslintrc-shell.json | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/lint/eslintrc-shell.json b/lint/eslintrc-shell.json
index 7deed61..198a750 100644
--- a/lint/eslintrc-shell.json
+++ b/lint/eslintrc-shell.json
@@ -35,6 +35,13 @@
"afterColon": true
}
],
+ "no-unused-vars": [
+ "error",
+ {
+ "argsIgnorePattern": "^_",
+ "varsIgnorePattern": "_$"
+ }
+ ],
"object-curly-spacing": [
"error",
"always"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]