{"action":"opened","number":1689,"pull_request":{"url":"https://api.github.com/repos/eslint/eslint/pulls/1689","id":27697675,"html_url":"https://github.com/eslint/eslint/pull/1689","diff_url":"https://github.com/eslint/eslint/pull/1689.diff","patch_url":"https://github.com/eslint/eslint/pull/1689.patch","issue_url":"https://api.github.com/repos/eslint/eslint/issues/1689","number":1689,"state":"open","locked":false,"title":"Add allowPattern option to dot-notation rule","user":{"login":"tschaub","id":41094,"avatar_url":"https://avatars.githubusercontent.com/u/41094?v=3","gravatar_id":"","url":"https://api.github.com/users/tschaub","html_url":"https://github.com/tschaub","followers_url":"https://api.github.com/users/tschaub/followers","following_url":"https://api.github.com/users/tschaub/following{/other_user}","gists_url":"https://api.github.com/users/tschaub/gists{/gist_id}","starred_url":"https://api.github.com/users/tschaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschaub/subscriptions","organizations_url":"https://api.github.com/users/tschaub/orgs","repos_url":"https://api.github.com/users/tschaub/repos","events_url":"https://api.github.com/users/tschaub/events{/privacy}","received_events_url":"https://api.github.com/users/tschaub/received_events","type":"User","site_admin":false},"body":"This adds an `allowPattern` option to the `dot-notation` rule for allowing exceptions to the rule.  If a string pattern is provided, it will be used to create a RegExp for testing property names.  In member expressions where the property name matches the `allowPattern`, bracket notation will be allowed.\r\n\r\nFor example, with this rule configuration:\r\n```js\r\n  \"rules\": {\r\n    \"dot-notation\": [2, {\"allowPattern\": \"^[a-z]+(_[a-z]+)+$\"}]\r\n  }\r\n```\r\n\r\nThe following would not be treated as an error:\r\n```js\r\nvar data = {};\r\ndata['foo_bar'] = 42;\r\n```\r\n\r\nWhile the following would be treated as an error:\r\n```js\r\nvar data = {};\r\ndata['fooBar'] = 42; // better written as data.fooBar\r\n```\r\n\r\nThe example above allows the `dot-notation` rule to be used in conjunction with the `camelcase` rule - allowing snake_case properties to be assigned with bracket notation (for example when generating data to be sent to an external service).\r\n\r\nFixes #1679.\r\n","created_at":"2015-01-20T17:51:57Z","updated_at":"2015-01-20T17:51:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/eslint/eslint/pulls/1689/commits","review_comments_url":"https://api.github.com/repos/eslint/eslint/pulls/1689/comments","review_comment_url":"https://api.github.com/repos/eslint/eslint/pulls/comments/{number}","comments_url":"https://api.github.com/repos/eslint/eslint/issues/1689/comments","statuses_url":"https://api.github.com/repos/eslint/eslint/statuses/917a1ad4c437fd30475c9a5055d6401d574df722","head":{"label":"tschaub:allow_pattern","ref":"allow_pattern","sha":"917a1ad4c437fd30475c9a5055d6401d574df722","user":{"login":"tschaub","id":41094,"avatar_url":"https://avatars.githubusercontent.com/u/41094?v=3","gravatar_id":"","url":"https://api.github.com/users/tschaub","html_url":"https://github.com/tschaub","followers_url":"https://api.github.com/users/tschaub/followers","following_url":"https://api.github.com/users/tschaub/following{/other_user}","gists_url":"https://api.github.com/users/tschaub/gists{/gist_id}","starred_url":"https://api.github.com/users/tschaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschaub/subscriptions","organizations_url":"https://api.github.com/users/tschaub/orgs","repos_url":"https://api.github.com/users/tschaub/repos","events_url":"https://api.github.com/users/tschaub/events{/privacy}","received_events_url":"https://api.github.com/users/tschaub/received_events","type":"User","site_admin":false},"repo":{"id":28669171,"name":"eslint","full_name":"tschaub/eslint","owner":{"login":"tschaub","id":41094,"avatar_url":"https://avatars.githubusercontent.com/u/41094?v=3","gravatar_id":"","url":"https://api.github.com/users/tschaub","html_url":"https://github.com/tschaub","followers_url":"https://api.github.com/users/tschaub/followers","following_url":"https://api.github.com/users/tschaub/following{/other_user}","gists_url":"https://api.github.com/users/tschaub/gists{/gist_id}","starred_url":"https://api.github.com/users/tschaub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschaub/subscriptions","organizations_url":"https://api.github.com/users/tschaub/orgs","repos_url":"https://api.github.com/users/tschaub/repos","events_url":"https://api.github.com/users/tschaub/events{/privacy}","received_events_url":"https://api.github.com/users/tschaub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tschaub/eslint","description":"A fully pluggable tool for identifying and reporting on patterns in JavaScript.","fork":true,"url":"https://api.github.com/repos/tschaub/eslint","forks_url":"https://api.github.com/repos/tschaub/eslint/forks","keys_url":"https://api.github.com/repos/tschaub/eslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tschaub/eslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tschaub/eslint/teams","hooks_url":"https://api.github.com/repos/tschaub/eslint/hooks","issue_events_url":"https://api.github.com/repos/tschaub/eslint/issues/events{/number}","events_url":"https://api.github.com/repos/tschaub/eslint/events","assignees_url":"https://api.github.com/repos/tschaub/eslint/assignees{/user}","branches_url":"https://api.github.com/repos/tschaub/eslint/branches{/branch}","tags_url":"https://api.github.com/repos/tschaub/eslint/tags","blobs_url":"https://api.github.com/repos/tschaub/eslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tschaub/eslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tschaub/eslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/tschaub/eslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tschaub/eslint/statuses/{sha}","languages_url":"https://api.github.com/repos/tschaub/eslint/languages","stargazers_url":"https://api.github.com/repos/tschaub/eslint/stargazers","contributors_url":"https://api.github.com/repos/tschaub/eslint/contributors","subscribers_url":"https://api.github.com/repos/tschaub/eslint/subscribers","subscription_url":"https://api.github.com/repos/tschaub/eslint/subscription","commits_url":"https://api.github.com/repos/tschaub/eslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/tschaub/eslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/tschaub/eslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/tschaub/eslint/issues/comments/{number}","contents_url":"https://api.github.com/repos/tschaub/eslint/contents/{+path}","compare_url":"https://api.github.com/repos/tschaub/eslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tschaub/eslint/merges","archive_url":"https://api.github.com/repos/tschaub/eslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tschaub/eslint/downloads","issues_url":"https://api.github.com/repos/tschaub/eslint/issues{/number}","pulls_url":"https://api.github.com/repos/tschaub/eslint/pulls{/number}","milestones_url":"https://api.github.com/repos/tschaub/eslint/milestones{/number}","notifications_url":"https://api.github.com/repos/tschaub/eslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tschaub/eslint/labels{/name}","releases_url":"https://api.github.com/repos/tschaub/eslint/releases{/id}","created_at":"2014-12-31T15:42:17Z","updated_at":"2015-01-19T22:14:16Z","pushed_at":"2015-01-19T23:12:45Z","git_url":"git://github.com/tschaub/eslint.git","ssh_url":"git@github.com:tschaub/eslint.git","clone_url":"https://github.com/tschaub/eslint.git","svn_url":"https://github.com/tschaub/eslint","homepage":"http://eslint.org","size":3676,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"eslint:master","ref":"master","sha":"8fefa10b55e1cf54facd96f1a55b2fc7133d57e2","user":{"login":"eslint","id":6019716,"avatar_url":"https://avatars.githubusercontent.com/u/6019716?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint","html_url":"https://github.com/eslint","followers_url":"https://api.github.com/users/eslint/followers","following_url":"https://api.github.com/users/eslint/following{/other_user}","gists_url":"https://api.github.com/users/eslint/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint/subscriptions","organizations_url":"https://api.github.com/users/eslint/orgs","repos_url":"https://api.github.com/users/eslint/repos","events_url":"https://api.github.com/users/eslint/events{/privacy}","received_events_url":"https://api.github.com/users/eslint/received_events","type":"Organization","site_admin":false},"repo":{"id":11061773,"name":"eslint","full_name":"eslint/eslint","owner":{"login":"eslint","id":6019716,"avatar_url":"https://avatars.githubusercontent.com/u/6019716?v=3","gravatar_id":"","url":"https://api.github.com/users/eslint","html_url":"https://github.com/eslint","followers_url":"https://api.github.com/users/eslint/followers","following_url":"https://api.github.com/users/eslint/following{/other_user}","gists_url":"https://api.github.com/users/eslint/gists{/gist_id}","starred_url":"https://api.github.com/users/eslint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eslint/subscriptions","organizations_url":"https://api.github.com/users/eslint/orgs","repos_url":"https://api.github.com/users/eslint/repos","events_url":"https://api.github.com/users/eslint/events{/privacy}","received_events_url":"https://api.github.com/users/eslint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eslint/eslint","description":"A fully pluggable tool for identifying and reporting on patterns in JavaScript.","fork":false,"url":"https://api.github.com/repos/eslint/eslint","forks_url":"https://api.github.com/repos/eslint/eslint/forks","keys_url":"https://api.github.com/repos/eslint/eslint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eslint/eslint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eslint/eslint/teams","hooks_url":"https://api.github.com/repos/eslint/eslint/hooks","issue_events_url":"https://api.github.com/repos/eslint/eslint/issues/events{/number}","events_url":"https://api.github.com/repos/eslint/eslint/events","assignees_url":"https://api.github.com/repos/eslint/eslint/assignees{/user}","branches_url":"https://api.github.com/repos/eslint/eslint/branches{/branch}","tags_url":"https://api.github.com/repos/eslint/eslint/tags","blobs_url":"https://api.github.com/repos/eslint/eslint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eslint/eslint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eslint/eslint/git/refs{/sha}","trees_url":"https://api.github.com/repos/eslint/eslint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eslint/eslint/statuses/{sha}","languages_url":"https://api.github.com/repos/eslint/eslint/languages","stargazers_url":"https://api.github.com/repos/eslint/eslint/stargazers","contributors_url":"https://api.github.com/repos/eslint/eslint/contributors","subscribers_url":"https://api.github.com/repos/eslint/eslint/subscribers","subscription_url":"https://api.github.com/repos/eslint/eslint/subscription","commits_url":"https://api.github.com/repos/eslint/eslint/commits{/sha}","git_commits_url":"https://api.github.com/repos/eslint/eslint/git/commits{/sha}","comments_url":"https://api.github.com/repos/eslint/eslint/comments{/number}","issue_comment_url":"https://api.github.com/repos/eslint/eslint/issues/comments/{number}","contents_url":"https://api.github.com/repos/eslint/eslint/contents/{+path}","compare_url":"https://api.github.com/repos/eslint/eslint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eslint/eslint/merges","archive_url":"https://api.github.com/repos/eslint/eslint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eslint/eslint/downloads","issues_url":"https://api.github.com/repos/eslint/eslint/issues{/number}","pulls_url":"https://api.github.com/repos/eslint/eslint/pulls{/number}","milestones_url":"https://api.github.com/repos/eslint/eslint/milestones{/number}","notifications_url":"https://api.github.com/repos/eslint/eslint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eslint/eslint/labels{/name}","releases_url":"https://api.github.com/repos/eslint/eslint/releases{/id}","created_at":"2013-06-29T23:59:48Z","updated_at":"2015-01-20T17:37:13Z","pushed_at":"2015-01-20T17:37:13Z","git_url":"git://github.com/eslint/eslint.git","ssh_url":"git@github.com:eslint/eslint.git","clone_url":"https://github.com/eslint/eslint.git","svn_url":"https://github.com/eslint/eslint","homepage":"http://eslint.org","size":10621,"stargazers_count":1506,"watchers_count":1506,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":249,"mirror_url":null,"open_issues_count":107,"forks":249,"open_issues":107,"watchers":1506,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eslint/eslint/pulls/1689"},"html":{"href":"https://github.com/eslint/eslint/pull/1689"},"issue":{"href":"https://api.github.com/repos/eslint/eslint/issues/1689"},"comments":{"href":"https://api.github.com/repos/eslint/eslint/issues/1689/comments"},"review_comments":{"href":"https://api.github.com/repos/eslint/eslint/pulls/1689/comments"},"review_comment":{"href":"https://api.github.com/repos/eslint/eslint/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/eslint/eslint/pulls/1689/commits"},"statuses":{"href":"https://api.github.com/repos/eslint/eslint/statuses/917a1ad4c437fd30475c9a5055d6401d574df722"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":51,"deletions":2,"changed_files":3}}