Created
March 19, 2014 18:23
-
-
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'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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