Tools
In order to maintain code consistency in ink, we have some rules of how names and files should be written and how the folders should be organized.
Our linter runs automatically within all scripts and will catch most issues that may exist in your code. You will see the status of your changes in real time, regardless of the script you choose to run.
If you are unsure about something, looking at Airbnb’s Style Guide will guide you in the right direction.
We also have some specific conventions which should be followed above and beyond the Airbnb Style Guide:
helpers
helpers
(e.g. if you have getHelpA()
and getHelpB()
they should be in herlpes/getHelpA.ts
and helpers/getHelpB.ts
respectively)helpers/getHelpA.spec.ts
)constants.ts
constants.ts
or helperFunction.ts
for a module containing a helper of the same name)When building a component, take care that new code meets these criteria to save time in the code review process:
The component code itself should:
src/components
;// ink-component
on the first line of the main tsx
file;props
interfaces. Parent components should also import/export
their children props
;Styled Components and Tokens:
Samples and Usage guides
_________.md
file with important information about the usage of the component. They should have the file even if no information is added;samples.js
file where samples for the components are to be written following the samples guidelines.References in ink/src/index.ts
:
import
for the new componentexport {...}
export default {...}
Tests:
helpers
folder. See React to learn more about helpers.If you need any further help navigating the ink folder, you can ask for help from any ink team member. One of us can probably hop on a quick zoom call to explain it better.
Is this page helpful?