{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/linter/issues/23","labels_url":"https://api.github.com/repos/dart-lang/linter/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/linter/issues/23/comments","events_url":"https://api.github.com/repos/dart-lang/linter/issues/23/events","html_url":"https://github.com/dart-lang/linter/issues/23","id":57238953,"number":23,"title":"Lint to prefer using a public final field instead of a private field with a public getter (Style Guide)","user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/linter/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-10T21:25:22Z","updated_at":"2015-02-18T17:29:58Z","closed_at":"2015-02-11T01:00:04Z","body":"From the [style guide] (https://www.dartlang.org/articles/style-guide/):\r\n\r\n**PREFER** using a public final field instead of a private field with a public getter.\r\n\r\nIf you have a field that outside code should be able to see but not assign to (and you don’t need to set it outside of the constructor), a simple solution that works in many cases is to just mark it `final`.\r\n\r\n**GOOD:**\r\n```\r\nclass Box {\r\n  final contents = [];\r\n}\r\n```\r\n**BAD:**\r\n```\r\nclass Box {\r\n  var _contents;\r\n  get contents => _contents;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dart-lang/linter/issues/comments/74907615","html_url":"https://github.com/dart-lang/linter/issues/23#issuecomment-74907615","issue_url":"https://api.github.com/repos/dart-lang/linter/issues/23","id":74907615,"user":{"login":"pq","id":67586,"avatar_url":"https://avatars.githubusercontent.com/u/67586?v=3","gravatar_id":"","url":"https://api.github.com/users/pq","html_url":"https://github.com/pq","followers_url":"https://api.github.com/users/pq/followers","following_url":"https://api.github.com/users/pq/following{/other_user}","gists_url":"https://api.github.com/users/pq/gists{/gist_id}","starred_url":"https://api.github.com/users/pq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pq/subscriptions","organizations_url":"https://api.github.com/users/pq/orgs","repos_url":"https://api.github.com/users/pq/repos","events_url":"https://api.github.com/users/pq/events{/privacy}","received_events_url":"https://api.github.com/users/pq/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T17:29:58Z","updated_at":"2015-02-18T17:29:58Z","body":"Opened corresponding bug: #35."}}