mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
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/merge_requests/627
46 lines
1 KiB
JSON
46 lines
1 KiB
JSON
{
|
|
"rules": {
|
|
"camelcase": [
|
|
"error",
|
|
{
|
|
"properties": "never",
|
|
"allow": ["^vfunc_", "^on_"]
|
|
}
|
|
],
|
|
"consistent-return": "error",
|
|
"key-spacing": [
|
|
"error",
|
|
{
|
|
"mode": "minimum",
|
|
"beforeColon": false,
|
|
"afterColon": true
|
|
}
|
|
],
|
|
"no-unused-vars": [
|
|
"error",
|
|
{
|
|
"argsIgnorePattern": "^_",
|
|
"varsIgnorePattern": "_$"
|
|
}
|
|
],
|
|
"object-curly-spacing": [
|
|
"error",
|
|
"always"
|
|
],
|
|
"prefer-arrow-callback": "error"
|
|
},
|
|
|
|
"overrides": [
|
|
{
|
|
"files": "js/**",
|
|
"excludedFiles": ["js/extensionPrefs/*", "js/portalHelper/*"],
|
|
"globals": {
|
|
"global": false,
|
|
"_": false,
|
|
"C_": false,
|
|
"N_": false,
|
|
"ngettext": false
|
|
}
|
|
}
|
|
]
|
|
}
|