{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/flow/issues/4654","repository_url":"https://api.github.com/repos/facebook/flow","labels_url":"https://api.github.com/repos/facebook/flow/issues/4654/labels{/name}","comments_url":"https://api.github.com/repos/facebook/flow/issues/4654/comments","events_url":"https://api.github.com/repos/facebook/flow/issues/4654/events","html_url":"https://github.com/facebook/flow/issues/4654","id":251397111,"number":4654,"title":"Use regex for a string type","user":{"login":"xareelee","id":804308,"avatar_url":"https://avatars1.githubusercontent.com/u/804308?v=4","gravatar_id":"","url":"https://api.github.com/users/xareelee","html_url":"https://github.com/xareelee","followers_url":"https://api.github.com/users/xareelee/followers","following_url":"https://api.github.com/users/xareelee/following{/other_user}","gists_url":"https://api.github.com/users/xareelee/gists{/gist_id}","starred_url":"https://api.github.com/users/xareelee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xareelee/subscriptions","organizations_url":"https://api.github.com/users/xareelee/orgs","repos_url":"https://api.github.com/users/xareelee/repos","events_url":"https://api.github.com/users/xareelee/events{/privacy}","received_events_url":"https://api.github.com/users/xareelee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-19T03:27:37Z","updated_at":"2017-08-21T15:29:18Z","closed_at":null,"body":"I have a `EventType` which should be a string with only capital letters and underscores:\r\n\r\n```js\r\ntype EventType = string & ('HELLO_WORLD' | 'NICE_TO_MEET_YOU' | ...)\r\n```\r\n\r\nI expect to add a regex to check the strings are containing only capital letters and underscores:\r\n\r\n```js\r\n// The type `string` could be removed, because the regex indicate the type should be a string\r\ntype EventType = string & `/^[A-Z]+(?:_[A-Z]+)*$/` & ('HELLO_WORLD' | 'NICE_TO_MEET_YOU' | ...)\r\n\r\n// This would raise a flowtype error, because `nice_to_meet_you` doesn't match the regex \r\ntype EventType = `/^[A-Z]+(?:_[A-Z]+)*$/` & ('HELLO_WORLD' | 'nice_to_meet_you' | ...)\r\n```\r\n\r\nHow can I achieve this?"},"comment":{"url":"https://api.github.com/repos/facebook/flow/issues/comments/323775364","html_url":"https://github.com/facebook/flow/issues/4654#issuecomment-323775364","issue_url":"https://api.github.com/repos/facebook/flow/issues/4654","id":323775364,"user":{"login":"xareelee","id":804308,"avatar_url":"https://avatars1.githubusercontent.com/u/804308?v=4","gravatar_id":"","url":"https://api.github.com/users/xareelee","html_url":"https://github.com/xareelee","followers_url":"https://api.github.com/users/xareelee/followers","following_url":"https://api.github.com/users/xareelee/following{/other_user}","gists_url":"https://api.github.com/users/xareelee/gists{/gist_id}","starred_url":"https://api.github.com/users/xareelee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xareelee/subscriptions","organizations_url":"https://api.github.com/users/xareelee/orgs","repos_url":"https://api.github.com/users/xareelee/repos","events_url":"https://api.github.com/users/xareelee/events{/privacy}","received_events_url":"https://api.github.com/users/xareelee/received_events","type":"User","site_admin":false},"created_at":"2017-08-21T15:29:18Z","updated_at":"2017-08-21T15:29:18Z","body":"@asolove How can I set the linter rule to check the type being uppercase and underscored?"}}
{"actor":{"display_login":"xareelee"}}