ESLint linting modules in node_modules on Circle

nodejs

#1

on Circle ESLint seam to lint files in node_modules, this does happen on my local machine, and according to http://eslint.org/docs/user-guide/configuring.html “ESLint always ignores files in node_modules/**” it shouldn’t.

> @ test /home/ubuntu/DroneSite
> eslint src && jest


/home/ubuntu/DroneSite/src/components/App/App.js
  73:5  warning  Unexpected console statement  no-console

/home/ubuntu/DroneSite/src/server.js
  39:3  warning  Unexpected console statement  no-console
  52:5  warning  Unexpected console statement  no-console
  57:5  warning  Unexpected console statement  no-console
  58:5  warning  Unexpected console statement  no-console

✖ 5 problems (0 errors, 5 warnings)


/home/ubuntu/DroneSite/node_modules/jest-cli/bin/jest.js:12
const fs = require('fs');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
npm ERR! Test failed.  See above for more details.

npm test returned exit code 1

#2

Just realized that isn’t a problem with ESLint and with Jest running.


#3

Fixed it by changing the node version. http://stackoverflow.com/questions/34024864/jest-with-npm-test-fails-with-use-of-const-in-strict-mode


#4