{ "id": "155524", "key": "TIMOB-20608", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2018-07-23T15:49:05.000+0000", "created": "2016-03-07T20:43:51.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "updated": "2018-08-06T17:34:46.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10207", "name": "Tooling" } ], "description": "As a developer,\r\nI want to be able to to format code submissions to Appcelerator's open source projects,\r\nSo that the added code format matches the coding standards set by Appcelerator.\r\n\r\nCould you include the .files for jsbeautify and similar libraries to help in contributing? ", "attachment": [], "flagged": false, "summary": "Add config files jsbeautify, etc that match Appcelerator's coding style", "creator": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "environment": null, "closedSprints": [ { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "380234", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\n \r\n\r\nThanks for sharing with us. Code formatting option has already present in Appcelerator Studio. To find this option, please go to *Studio* > *Source* > *Format* from the menu bar of the Studio. Please check [screenshot|http://postimg.org/image/z18hgbb0r/].\r\n\r\n \r\n\r\nThanks.", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-03-21T10:06:54.000+0000", "updated": "2016-03-21T10:06:54.000+0000" }, { "id": "380253", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "Thanks, but I am talking about providing some of the dotfiles for those of us that don't use Studio... :)", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2016-03-21T15:42:47.000+0000", "updated": "2016-03-21T15:42:47.000+0000" }, { "id": "380254", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "[~mrahman] also, can you remove the link to screenshot you provided above? It links to inappropriate images... Thanks!", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2016-03-21T15:44:39.000+0000", "updated": "2016-03-21T15:44:39.000+0000" }, { "id": "394166", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Code processor is dead.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-24T19:42:15.000+0000", "updated": "2016-08-24T19:42:15.000+0000" }, { "id": "394178", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "[~cbarber] Not sure what part is dead but these would be helpful in matching the Appc style of coding so that contribs don't get rejected b/c of formatting issues.", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-24T19:49:57.000+0000", "updated": "2016-08-24T19:49:57.000+0000" }, { "id": "394182", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "Whoops. Had the wrong component and wasn't paying attention. :)", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-08-24T19:51:15.000+0000", "updated": "2016-08-24T19:51:15.000+0000" }, { "id": "418175", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "Reviving this issue as we could really use some definition around what Axway/Appcelerator defines as their JavaScript coding style. I can work on creating the appropriate helper files if there is a style guide that I can use as a reference.\r\n\r\ncc: [~hansknoechel] ", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2017-04-27T15:44:23.000+0000", "updated": "2017-04-27T15:44:23.000+0000" }, { "id": "418176", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~brentonhouse] I wrote the original JS style guide (https://wiki.appcelerator.org/display/guides2/JavaScript+Coding+Standards), however it is very out-of-date. There are so many things that even I don't follow anymore.\r\n\r\nNow, I use ESLint now and here's my config:\r\n\r\n{code}\r\n{\r\n\t\"ecmaFeatures\": {\r\n\t\t\"modules\": true\r\n\t},\r\n\t\"env\": {\r\n\t\t\"es6\": true,\r\n\t\t\"node\": true\r\n\t},\r\n\t\"extends\": \"eslint:recommended\",\r\n\t\"globals\": [\r\n\t\t\"appcd\"\r\n\t],\r\n\t\"parser\": \"babel-eslint\",\r\n\t\"plugins\": [\r\n\t\t\"security\"\r\n\t],\r\n\t\"rules\": {\r\n\t\t\"indent\": [ 2, \"tab\", { \"SwitchCase\": 1 } ],\r\n\t\t\"linebreak-style\": [ 2, \"unix\" ],\r\n\t\t\"no-console\": 0,\r\n\t\t\"no-cond-assign\": 0,\r\n\t\t\"no-mixed-spaces-and-tabs\": 0,\r\n\t\t\"no-inner-declarations\": 0,\r\n\t\t\"no-case-declarations\": 0,\r\n\t\t\"no-unused-vars\": 0,\r\n\t\t\"quotes\": [ 2, \"single\" ],\r\n\t\t\"semi\": [ 2, \"always\" ]\r\n\t}\r\n}\r\n{code}\r\n\r\nThe dashboard team uses an even stricter version.\r\n\r\nSince most of the code I write these days is ES6 and beyond, I'm still trying to define best practices and coding style. Promise chains and imports are pretty new and I'm not sure the best way to format them. Most other coding constructs are pretty straightforward. I always use {{const}} unless I need {{let}}, never {{var}}. I favor arrow functions over explicit functions unless I need to access {{this}}. The list goes on and on.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-04-27T15:54:38.000+0000", "updated": "2017-04-27T15:54:38.000+0000" }, { "id": "418181", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "[~cbarber] After talking with a few different people, I have heard that there are some rules around things like:\r\n\r\n{noformat}\r\n- Add padding spaces within empty paren, \"f()\" vs \"f( )\"\r\n- Add padding spaces within paren, ie. f( a, b )\r\n- Should the space before conditional statement be added, \"if(true)\" vs \"if (true)\"\r\n- Should the space before an anonymous function's parens be added, \"function()\" vs \"function ()\"\r\n{noformat}\r\n\r\nI am not sure if ESLint gets to this level of detail. I took a look at the link you provided and I am not sure these are addressed in that doc either. I will take another look in case I missed it. Thanks!\r\n", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2017-04-27T16:05:40.000+0000", "updated": "2017-04-27T16:05:40.000+0000" }, { "id": "418182", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "{{f()}}, never {{f( )}}\r\n\r\n{{f(a, b)}}, never {{f( a, b )}}. However, for arrays, add the space: {{f([ a, b ])}}.\r\n\r\n{{if (true) {}}, never {{if(true){}}\r\n\r\n{{} else {}}, never {{}\\nelse {}}, though there's a ton of this going on.\r\n\r\n{{function ()}}, never {{function()}}\r\n\r\nAnd most importantly, tabs, not spaces! :)", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-04-27T16:10:52.000+0000", "updated": "2017-04-27T16:10:52.000+0000" }, { "id": "418185", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "awesome! thank you!!\r\n\r\nI will put together some config files for these for anyone that is interested. A lot of IDEs/tools look for the dot config files in root of project and will then format code accordingly. \r\n\r\nhttps://github.com/prettier/prettier\r\nhttps://github.com/beautify-web/js-beautify\r\n\r\nIf there are other tools used by devs in axway/appc community, let me know and I can research and create those as well. Thanks again!!", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2017-04-27T16:24:38.000+0000", "updated": "2017-04-27T16:24:38.000+0000" }, { "id": "418567", "author": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "body": "[~cbarber] -- Based on your feedback I have added the following eslint rules but there are probably more than can be defined based on the axway coding standard:\r\n\r\n\r\n{code:javascript}\r\n\"space-before-function-paren\": [\"error\", {\r\n\t\"anonymous\": \"always\",\r\n\t\"named\": \"ignore\",\r\n\t\"asyncArrow\": \"always\"\r\n},\r\n\"array-bracket-spacing\": [\"error\", \"always\", { \"objectsInArrays\": false, \"arraysInArrays\": false }],\r\n\"space-in-parens\": [\"error\", \"never\"],\r\n\"keyword-spacing\": [\"error\"],\r\n{code}\r\n", "updateAuthor": { "name": "brentonhouse", "key": "brentonhouse", "displayName": "Brenton House", "active": true, "timeZone": "America/Chicago" }, "created": "2017-05-02T15:21:51.000+0000", "updated": "2017-05-02T15:21:51.000+0000" }, { "id": "418576", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~brentonhouse] This is awesome! I added those rules to my eslint file and it caught about a dozen whitespace issues. I appreciate the help. :)", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2017-05-02T16:03:56.000+0000", "updated": "2017-05-02T16:03:56.000+0000" }, { "id": "439412", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "We've moved to using eslint rules that apply to our JS code, and clang-format for Java/Obj-C code. We check these rules on CI builds and try to provide feedback about any issues flagged in the PRs (specifically via Danger.JS for the SDK).", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-07-23T15:49:05.000+0000", "updated": "2018-07-23T15:49:05.000+0000" }, { "id": "439835", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closed as completed. If this is in error, please reopen.", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-06T17:34:46.000+0000", "updated": "2018-08-06T17:34:46.000+0000" } ], "maxResults": 16, "total": 16, "startAt": 0 } } }