{"action":"created","issue":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/895","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/895/labels{/name}","comments_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/895/comments","events_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/895/events","html_url":"https://github.com/jscs-dev/node-jscs/issues/895","id":53914474,"number":895,"title":"Add ability to declare acceptable values for the rules","user":{"login":"markelog","id":945528,"avatar_url":"https://avatars.githubusercontent.com/u/945528?v=3","gravatar_id":"","url":"https://api.github.com/users/markelog","html_url":"https://github.com/markelog","followers_url":"https://api.github.com/users/markelog/followers","following_url":"https://api.github.com/users/markelog/following{/other_user}","gists_url":"https://api.github.com/users/markelog/gists{/gist_id}","starred_url":"https://api.github.com/users/markelog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markelog/subscriptions","organizations_url":"https://api.github.com/users/markelog/orgs","repos_url":"https://api.github.com/users/markelog/repos","events_url":"https://api.github.com/users/markelog/events{/privacy}","received_events_url":"https://api.github.com/users/markelog/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jscs-dev/node-jscs/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/milestones/3","html_url":"https://github.com/jscs-dev/node-jscs/milestones/2.0","labels_url":"https://api.github.com/repos/jscs-dev/node-jscs/milestones/3/labels","id":704662,"number":3,"title":"2.0","description":"","creator":{"login":"mdevils","id":176898,"avatar_url":"https://avatars.githubusercontent.com/u/176898?v=3","gravatar_id":"","url":"https://api.github.com/users/mdevils","html_url":"https://github.com/mdevils","followers_url":"https://api.github.com/users/mdevils/followers","following_url":"https://api.github.com/users/mdevils/following{/other_user}","gists_url":"https://api.github.com/users/mdevils/gists{/gist_id}","starred_url":"https://api.github.com/users/mdevils/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdevils/subscriptions","organizations_url":"https://api.github.com/users/mdevils/orgs","repos_url":"https://api.github.com/users/mdevils/repos","events_url":"https://api.github.com/users/mdevils/events{/privacy}","received_events_url":"https://api.github.com/users/mdevils/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":8,"state":"open","created_at":"2014-06-29T11:57:07Z","updated_at":"2015-03-17T07:18:43Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2015-01-09T21:02:21Z","updated_at":"2015-03-23T23:37:41Z","closed_at":null,"body":"Now this responsibility falls on the `configure` method, but it would much easier if this method would be replaced by some declaration like:\r\n\r\n```js\r\nvalues: [{\r\n    type: \"object\",\r\n    value: { \r\n        type: \"string\",\r\n        value: \"allExcept\"\r\n    }\r\n}, {\r\n    type: \"boolean\",\r\n    value: true\r\n}];\r\n```\r\n\r\nwe couldn't fully dispose from the `configure` method, but it will simplify a lot of things\r\n\r\n/cc @mdevils \r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/7625533-add-ability-to-declare-acceptable-values-for-the-rules?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F281640&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/comments/85247073","html_url":"https://github.com/jscs-dev/node-jscs/issues/895#issuecomment-85247073","issue_url":"https://api.github.com/repos/jscs-dev/node-jscs/issues/895","id":85247073,"user":{"login":"hzoo","id":588473,"avatar_url":"https://avatars.githubusercontent.com/u/588473?v=3","gravatar_id":"","url":"https://api.github.com/users/hzoo","html_url":"https://github.com/hzoo","followers_url":"https://api.github.com/users/hzoo/followers","following_url":"https://api.github.com/users/hzoo/following{/other_user}","gists_url":"https://api.github.com/users/hzoo/gists{/gist_id}","starred_url":"https://api.github.com/users/hzoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzoo/subscriptions","organizations_url":"https://api.github.com/users/hzoo/orgs","repos_url":"https://api.github.com/users/hzoo/repos","events_url":"https://api.github.com/users/hzoo/events{/privacy}","received_events_url":"https://api.github.com/users/hzoo/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T23:37:41Z","updated_at":"2015-03-23T23:37:41Z","body":"Some ideas on a declarative format:\r\n\r\n```js\r\nvalues: [\r\n    // true,\r\n    // number,\r\n    // string\r\n    // one of the strings in an array\r\n    // object with properties 'beforeOpeningRoundBrace' and 'beforeOpeningCurlyBrace' which are both true\r\n];\r\n\r\nvalues: [{\r\n    type: \"boolean\",\r\n    value: true\r\n}, {\r\n    type: \"number\" // maybe no value?\r\n}, {\r\n    type: \"string\"\r\n}, {\r\n    type: \"string\",\r\n    value: ['a', 'b', 'c']\r\n}, {\r\n    type: \"object\",\r\n    value: [ // not sure how this would work\r\n        { \r\n            type: \"string\",\r\n            value: \"beforeOpeningCurlyBrace\"\r\n        },\r\n        { \r\n            type: \"string\",\r\n            value: \"beforeOpeningRoundBrace\"\r\n        },\r\n    ]\r\n}, ];\r\n\r\n// use constructor functions?\r\nvalues: [\r\n    true,\r\n    Number,\r\n    ['a', 'b', 'c'],\r\n    {\r\n        beforeOpeningCurlyBrace: [String] \r\n        beforeOpeningRoundBrace: [String] \r\n    }\r\n];\r\n\r\n// react type (namespaces to represent things)\r\nvalues: [\r\n    Types.true,\r\n    Types.number,\r\n    Types.oneOf(['a', 'b', 'c']),\r\n    Types.object({\r\n        beforeOpeningCurlyBrace: Types.arrayOf(Types.String)\r\n        beforeOpeningRoundBrace: Types.arrayOf(Types.String)\r\n    })\r\n];\r\n```\r\n\r\nI like the 2nd one if something like that is possible."}}