Enable the getter-return, no-dupe-else-if, and no-setter-return ESLint rules

All of these rules can help catch errors during development. Please note that only `getter-return` required a few changes, which was limited to disabling the rule in a couple of spots; please find additional details about these rules at:
 - https://eslint.org/docs/rules/getter-return
 - https://eslint.org/docs/rules/no-dupe-else-if
 - https://eslint.org/docs/rules/no-setter-return
This commit is contained in:
Jonas Jenwald 2019-11-23 11:28:29 +01:00
parent b8f0cf0bc0
commit a965662184
4 changed files with 8 additions and 4 deletions

View File

@ -35,10 +35,12 @@
// Possible errors
"for-direction": "error",
"getter-return": "error",
"no-async-promise-executor": "error",
"no-cond-assign": ["error", "except-parens"],
"no-constant-condition": ["error", { "checkLoops": false, }],
"no-dupe-args": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": ["error", { "allowEmptyCatch": true, }],
@ -51,6 +53,7 @@
"no-irregular-whitespace": "error",
"no-obj-calls": "error",
"no-regex-spaces": "error",
"no-setter-return": "error",
"no-sparse-arrays": "error",
"no-unexpected-multiline": "error",
"no-unreachable": "error",

View File

@ -394,7 +394,7 @@ class IdentityCMap extends CMap {
return 0x10000;
}
get isIdentityCMap() {
get isIdentityCMap() { // eslint-disable-line getter-return
unreachable('should not access .isIdentityCMap');
}
}

View File

@ -106,15 +106,15 @@ class BaseFontLoader {
unreachable('Abstract method `_queueLoadingCallback`.');
}
get isFontLoadingAPISupported() {
get isFontLoadingAPISupported() { // eslint-disable-line getter-return
unreachable('Abstract method `isFontLoadingAPISupported`.');
}
get isSyncFontLoadingSupported() {
get isSyncFontLoadingSupported() { // eslint-disable-line getter-return
unreachable('Abstract method `isSyncFontLoadingSupported`.');
}
get _loadTestFont() {
get _loadTestFont() { // eslint-disable-line getter-return
unreachable('Abstract method `_loadTestFont`.');
}

View File

@ -12,6 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable getter-return */
/**
* @interface