Skip to content

Instantly share code, notes, and snippets.

@lsegal
Created March 19, 2014 18:23
Show Gist options
  • Save lsegal/9648027 to your computer and use it in GitHub Desktop.
Save lsegal/9648027 to your computer and use it in GitHub Desktop.
Bug in ESLint checking of .eslintrc files in subdirectories. Run 'node setup.js' then 'eslint lib'
var fs = require('fs');
fs.mkdirSync('lib');
fs.mkdirSync('lib/foo');
// turn off camelcase check for .eslintrc
fs.writeFileSync('.eslintrc', '{ "rules": { "camelcase": 0 } }');
// this file should not raise error, not inside of lib/foo/*
fs.writeFileSync('lib/foo.js', 'var not_camelcase = 0;');
// turn on camelcase check in lib/foo/*
fs.writeFileSync('lib/foo/.eslintrc', '{ "rules": { "camelcase": 2 } }');
// this file should raise error
fs.writeFileSync('lib/foo/bar.js', 'var not_camelcase = 0;');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment