question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

new-cap's capIsNewExceptions false warning

See original GitHub issue

I’m using 0.16.2. This code:

'use strict';
var Immutable = require('immutable');
var foo = Immutable.List();

triggers a new-cap warning for me, A function with a name starting with an uppercase letter should only be used as a constructor, even though I have an exception set:

    "new-cap": [2, {
      "capIsNewExceptions": ["Immutable"]
    }]

Thank you For reference: http://facebook.github.io/immutable-js/

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yvelecommented, Nov 15, 2016

This exception is working for Immutable:

"new-cap": [2, { "capIsNewExceptionPattern" : "^Immutable\\.." }]

PS: About immutable new-cap convention: https://github.com/facebook/immutable-js/issues/10

0reactions
nzakascommented, Mar 14, 2015

It seems like #2025 is the real issue here, so closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

new-cap - ESLint - Pluggable JavaScript Linter
"capIsNew": false allows uppercase-started functions to be called without new operators. "newIsCapExceptions" allows specified lowercase-started function names ...
Read more >
ESLint: How to set "new-cap" rule's "capIsNewExceptions ...
1 — makes it a warning, 2 — makes it an error. I'm too lazy to check, but I assume that the rest...
Read more >
https://itacademy.mu/wp-content/plugins/svg-suppor...
... "optionString" : "'never', {'singleValue': false, 'objectsInArrays': false, 'arraysInArrays': false}" }, "array-callback-return" : { "active" : 0, ...
Read more >
config.codekit3
... "ft" : 4, "ma" : 0, "oA" : 1, "oAP" : "\/scss\/bootstrap\/mixins\/_alert.css", ... {'singleValue': false, 'objectsInArrays': false, 'arraysInArrays': ...
Read more >
https://www.cwc.com/live/careers/config.codekit3
... "dJ": 0, "ft": 1, "ie": 1, "iI": 0, "ma": 1, "oA": 1, "oAP": "\/Users\/pwong\/Documents\/_columbus\/cwc.com\/dev\/template\/bootstrap\/css\/alerts.css", ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found