{"action":"created","issue":{"url":"https://api.github.com/repos/eslint/eslint-tester/issues/24","labels_url":"https://api.github.com/repos/eslint/eslint-tester/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/eslint/eslint-tester/issues/24/comments","events_url":"https://api.github.com/repos/eslint/eslint-tester/issues/24/events","html_url":"https://github.com/eslint/eslint-tester/issues/24","id":88526968,"number":24,"title":"Two different references to eslint","user":{"login":"btmills","id":1709537,"avatar_url":"https://avatars.githubusercontent.com/u/1709537?v=3","gravatar_id":"","url":"https://api.github.com/users/btmills","html_url":"https://github.com/btmills","followers_url":"https://api.github.com/users/btmills/followers","following_url":"https://api.github.com/users/btmills/following{/other_user}","gists_url":"https://api.github.com/users/btmills/gists{/gist_id}","starred_url":"https://api.github.com/users/btmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btmills/subscriptions","organizations_url":"https://api.github.com/users/btmills/orgs","repos_url":"https://api.github.com/users/btmills/repos","events_url":"https://api.github.com/users/btmills/events{/privacy}","received_events_url":"https://api.github.com/users/btmills/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eslint/eslint-tester/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-15T20:10:19Z","updated_at":"2015-07-10T19:42:53Z","closed_at":null,"body":"Split from #22.\r\n\r\nFirst, @PiPeep:\r\n\r\nTo add to what @zpao said, in #21, there appears to be a line saying:\r\n\r\n```js\r\n...\r\nvalidator = require(\"eslint\").validator,\r\n...\r\n```\r\n\r\nHowever, [`ESLintTester` is already be passed `eslint.linter`](https://github.com/eslint/eslint-tester/blob/18d2a86dd45c67ebc7fb184a365229b6377e8ffb/tests/lib/eslint-tester.js#L54). IMHO, either it should be able to pick validator out from `eslint.linter`, or require we pass `eslint` instead of `eslint.linter`.\r\n\r\nRight now, it's possible that eslint-tester might end up with two different versions of eslint, and cause some strange issues.\r\n\r\nThen @btmills:\r\n\r\n> either it should be able to pick validator out from eslint.linter, or require we pass eslint instead of eslint.linter\r\n\r\nAgreed. Unfortunately, due to the complicated relationship between eslint and eslint-tester, either option will mean handling two concurrent releases again. @nzakas or @ilyavolodin - thoughts?\r\n\r\n**Option 1:** Export `validator` from `lib/eslint`, and it no longer needs to be exported from `lib/api`.\r\n\r\n**Option 2:** Rules should pass `lib/api`, not `lib/eslint` to eslint-tester.\r\n\r\nArchitecturally, I think it's more proper that eslint-tester would use the public API (so option 2), but that would require changing *every single rule*, and we can't suddenly break third-party plugin rules, meaning we might have to go with option 1."},"comment":{"url":"https://api.github.com/repos/eslint/eslint-tester/issues/comments/120504823","html_url":"https://github.com/eslint/eslint-tester/issues/24#issuecomment-120504823","issue_url":"https://api.github.com/repos/eslint/eslint-tester/issues/24","id":120504823,"user":{"login":"nzakas","id":38546,"avatar_url":"https://avatars.githubusercontent.com/u/38546?v=3","gravatar_id":"","url":"https://api.github.com/users/nzakas","html_url":"https://github.com/nzakas","followers_url":"https://api.github.com/users/nzakas/followers","following_url":"https://api.github.com/users/nzakas/following{/other_user}","gists_url":"https://api.github.com/users/nzakas/gists{/gist_id}","starred_url":"https://api.github.com/users/nzakas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nzakas/subscriptions","organizations_url":"https://api.github.com/users/nzakas/orgs","repos_url":"https://api.github.com/users/nzakas/repos","events_url":"https://api.github.com/users/nzakas/events{/privacy}","received_events_url":"https://api.github.com/users/nzakas/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T19:42:52Z","updated_at":"2015-07-10T19:42:52Z","body":"@lo1tuma these are some of the issues with the first point I mentioned. We could, in theory, create a rule tester that doesn't need to know about Mocha or Chai ( we could use native assert module ). We definitely don't need `describe` baked in, we could just have people do that themselves. \r\n\r\nThis is just off the top of my head, but what if we did something like this:\r\n\r\n```js\r\nvar RuleTester = require(\"../../util/rule-tester\"),\r\n    linter = require('../../eslint'),\r\n    rule = require('../../../rules/my-rule');\r\n\r\ndescribe('my-rule', function() {\r\n\r\n    var tester = new RuleTester(linter, rule);\r\n\r\n    // optionally, say you want to use \"it\"\r\n    tester.separateWith(it);\r\n\r\n    tester.add({ /* valid/invalid */);\r\n\r\n});\r\n```\r\n\r\n"}}