Wrap consts in kibana tutorials#22181
Conversation
💔 Build Failed |
💔 Build Failed |
|
|
💔 Build Failed |
|
retest |
💔 Build Failed |
|
retest |
|
@LeanidShutau maybe merge latest master? |
💚 Build Succeeded |
| } | ||
| ] | ||
| }; | ||
| export function createOnPremElasticCloudInstructions() { |
There was a problem hiding this comment.
There'll be much fewer diffs in PRs like this if the export was like:
const COMMON_NETFLOW_INSTRUCTIONS = createCommonNetflowInstructions();
const TRYCLOUD_OPTION1 = createTrycloudOption1();
const TRYCLOUD_OPTION2 = createTrycloudOption2();
const LOGSTASH_INSTRUCTIONS = createLogstashInstructions();
export const createOnPremElasticCloudInstructions = () => ({
instructionSets: [
//...
]
});that is, using implicit return should keep the indentation the same
There was a problem hiding this comment.
@tsullivan
createCommonNetflowInstructions(), ..., createLogstashInstructions() can't be called outside the function, because i18n engine should be initialized before text translation.
tsullivan
left a comment
There was a problem hiding this comment.
requesting to use arrow functions and implicit return where possible to make the code more concise and the diffs show fewer lines of code change
💚 Build Succeeded |
* Wrap consts in kibana tutorials * Fix onPrem instructions * Fix rails instructions * Use arrow functions and implicit return Co-authored-by: LeanidShutau <leanidshutau@gmail.com>
|
6.x/6.5: 91989b5 |
I18n engine must be initialized before
i18n.translate(...)calls. So all objects with translatable labels should be wrapped into functions.const OBJECT_NAME = {...};becomesfunction createObjectName { return {...}; }.