{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint/issues/3792","labels_url":"https://api.github.com/repos/eslint/eslint/issues/3792/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/3792/comments","events_url":"https://api.github.com/repos/eslint/eslint/issues/3792/events","html_url":"https://github.com/eslint/eslint/issues/3792","id":106322260,"number":3792,"title":"with ESLint 1.4.x `eslint ./` will lint all files on a drive","user":{"login":"jvdl","id":309957,"avatar_url":"https://avatars.githubusercontent.com/u/309957?v=3","gravatar_id":"","url":"https://api.github.com/users/jvdl","html_url":"https://github.com/jvdl","followers_url":"https://api.github.com/users/jvdl/followers","following_url":"https://api.github.com/users/jvdl/following{/other_user}","gists_url":"https://api.github.com/users/jvdl/gists{/gist_id}","starred_url":"https://api.github.com/users/jvdl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jvdl/subscriptions","organizations_url":"https://api.github.com/users/jvdl/orgs","repos_url":"https://api.github.com/users/jvdl/repos","events_url":"https://api.github.com/users/jvdl/events{/privacy}","received_events_url":"https://api.github.com/users/jvdl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint/labels/accepted","name":"accepted","color":"0052cc"},{"url":"https://api.github.com/repos/eslint/eslint/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/eslint/eslint/labels/cli","name":"cli","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-14T11:26:08Z","updated_at":"2015-09-14T16:39:27Z","closed_at":null,"body":"With eslint 1.4.x a new globbing matcher was introduced and the `processPath()` method used to pass it an appropriate glob has introduced a bug whereby a relative path to the current directory in the form of `./` would end up with a glob of `/**/*.js` - in effect searching from the root of the drive.\r\n\r\nTo resolve this, it may be better, instead of replacing the `./` in `processPath()`, to use `path.normalize()`.\r\n\r\nI've added a console.log to cli-engine.js at CLIEngine.prototype.executeOnFiles:\r\n\r\n```js \r\nconsole.log('before processing pattern is:', patterns);\r\npatterns = patterns.map(processPath(extensions));\r\nconsole.log('after processing pattern is:', patterns);\r\n```\r\n\r\nWith the current code:\r\n\r\n```\r\n[~/src/testrepo]$ ./node_modules/eslint/bin/eslint.js ./ ../ .\r\nbefore processing pattern is: [ './', '../', '.' ]\r\nafter processing pattern is: [ '/**/*.js', '..//**/*.js', '**/*.js' ]\r\n```\r\n\r\nNote that the first pattern passed in, `./` is transformed to `/**/*.js`\r\n\r\nWith the `path.normalize()` fix:\r\n\r\n```\r\n[~/src/testrepo]$ ./node_modules/eslint/bin/eslint.js ./ ../ .\r\nbefore processing pattern is: [ './', '../', '.' ]\r\nafter processing pattern is: [ '**/*.js', '../**/*.js', '**/*.js' ]\r\n```\r\n\r\nTo summarise:\r\n\r\n1. Run `eslint ./`\r\n2. Expected result: JS files in the current directory are linted\r\n3. Actual result: All JS files on the drive are linted\r\n4. Suggested fix: use `path.normalize()` in favour of replacing `./` at the start of a path."},"comment":{"url":"https://api.github.com/repos/eslint/eslint/issues/comments/140138736","html_url":"https://github.com/eslint/eslint/issues/3792#issuecomment-140138736","issue_url":"https://api.github.com/repos/eslint/eslint/issues/3792","id":140138736,"user":{"login":"BYK","id":126780,"avatar_url":"https://avatars.githubusercontent.com/u/126780?v=3","gravatar_id":"","url":"https://api.github.com/users/BYK","html_url":"https://github.com/BYK","followers_url":"https://api.github.com/users/BYK/followers","following_url":"https://api.github.com/users/BYK/following{/other_user}","gists_url":"https://api.github.com/users/BYK/gists{/gist_id}","starred_url":"https://api.github.com/users/BYK/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BYK/subscriptions","organizations_url":"https://api.github.com/users/BYK/orgs","repos_url":"https://api.github.com/users/BYK/repos","events_url":"https://api.github.com/users/BYK/events{/privacy}","received_events_url":"https://api.github.com/users/BYK/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T16:39:27Z","updated_at":"2015-09-14T16:39:27Z","body":"Looking"}}