diff --git a/configs/basic.js b/configs/basic.js index f3d4fa7..c9c5aae 100644 --- a/configs/basic.js +++ b/configs/basic.js @@ -1,6 +1,8 @@ // NOTE: we start with all rules enabled (error) for a strict baseline (eslint:all) // NOTE: all rules not following ": error" thus imply preference over the baseline +let isIde = process.env.VSCODE_PID !== undefined; + module.exports = { plugins: [], @@ -134,7 +136,7 @@ module.exports = { }], 'no-continue': 'off', 'no-control-regex': 'error', - 'no-debugger': 'off', // FIXME set to warn after https://github.com/eslint/eslint/issues/7549 + 'no-debugger': isIde ? 'warn' : 'off', 'no-delete-var': 'error', 'no-div-regex': 'off', 'no-dupe-args': 'error', diff --git a/configs/typescript.js b/configs/typescript.js index a34f685..57dbc63 100644 --- a/configs/typescript.js +++ b/configs/typescript.js @@ -19,6 +19,8 @@ _basic = _.cloneDeep(_basic); _babel = _.cloneDeep(_babel); +let isIde = process.env.VSCODE_PID !== undefined; + module.exports = { extends: [ 'plugin:@typescript-eslint/recommended' @@ -86,7 +88,8 @@ module.exports = { '@typescript-eslint/strict-boolean-expressions': 'error', // requiresTypeInfo '@typescript-eslint/typedef': 'off', '@typescript-eslint/type-annotation-spacing': ['error'], // tslint:typedef-whitespace - '@typescript-eslint/unbound-method': 'off', // tslint:no-unbound-method + // @typescript-eslint/unbound-method is buggy, otherwise it should be set to 'error' + '@typescript-eslint/unbound-method': isIde ? 'warn' : 'off', // tslint:no-unbound-method '@typescript-eslint/no-unnecessary-type-arguments': 'error', // tslint:use-default-type-parameter '@typescript-eslint/unified-signatures': 'error',