Skip to content

Commit

Permalink
enable some rules only in IDEs
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Nov 24, 2019
1 parent 6dccd41 commit 5a83af5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion configs/basic.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// NOTE: we start with all rules enabled (error) for a strict baseline (eslint:all)
// NOTE: all rules not following "<rule>: error" thus imply preference over the baseline

let isIde = process.env.VSCODE_PID !== undefined;

module.exports = {
plugins: [],

Expand Down Expand Up @@ -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',
Expand Down
5 changes: 4 additions & 1 deletion configs/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ _basic = _.cloneDeep(_basic);
_babel = _.cloneDeep(_babel);


let isIde = process.env.VSCODE_PID !== undefined;

module.exports = {
extends: [
'plugin:@typescript-eslint/recommended'
Expand Down Expand Up @@ -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',

Expand Down

0 comments on commit 5a83af5

Please sign in to comment.