diff --git a/eslint/.eslintrc.js b/eslint/.eslintrc.js index 7ba85240..13df2eb9 100644 --- a/eslint/.eslintrc.js +++ b/eslint/.eslintrc.js @@ -156,6 +156,15 @@ module.exports = { 'self' ], + // require a capital letter for constructors + 'new-cap': [ 'error', { + newIsCap: true, + newIsCapExceptionPattern: '^(options|this|window)\\.\\w+', // Allow constructors to be passed through options. + newIsCapExceptions: [ 'rsync', 'jimp', 'Math.seedrandom' ], + capIsNew: false, + capIsNewExceptions: [ 'Immutable.Map', 'Immutable.Set', 'Immutable.List' ] + } ], + // don't escape characters that don't need to be escaped 'no-useless-escape': 2, diff --git a/eslint/format_eslintrc.js b/eslint/format_eslintrc.js index 89fcfe07..19574b40 100644 --- a/eslint/format_eslintrc.js +++ b/eslint/format_eslintrc.js @@ -268,14 +268,6 @@ module.exports = { // TODO: enable? 'multiline-ternary': [ 'off', 'never' ], - // require a capital letter for constructors - 'new-cap': [ 'error', { - newIsCap: true, - newIsCapExceptions: [], - capIsNew: false, - capIsNewExceptions: [ 'Immutable.Map', 'Immutable.Set', 'Immutable.List' ] - } ], - // disallow the omission of parentheses when invoking a constructor with no arguments // https://eslint.org/docs/rules/new-parens 'new-parens': 'error',