Last Updated: Jan 12, 2026
How we keep code consistency in ink
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.
React
We also have some specific conventions which should be followed above and beyond the Airbnb Style Guide:
helpershelpers (e.g. if you have getHelpA() and getHelpB() they should be in helpers/getHelpA.ts and helpers/getHelpB.ts respectively)helpers/getHelpA.spec.ts)styles.ts if they're style-relatedconstants.ts file if there are many unrelated constantsconstants.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 fileprops interfaces. Parent components should also import/export their children propscomponents/ subfolderDropdown.Item = DropdownItem)contexts/ subfolderStyled Components and Tokens:
Documentation and Samples
ComponentName.md file with important information about the usage of the component. They should have the file even if no information is addedaccessibility.md and testing.md files for detailed documentation on those specific aspectssamples.js file where samples for the components are to be written in an Array of objects.References in ink/src/index.ts:
export { default as Button, ButtonProps } from './components/Button/Button';export { default as Dropdown, DropdownProps, DropdownItemProps, DropdownTriggerProps, ... } from './components/Dropdown/Dropdown';Tests:
ComponentName.spec.tsx file for unit tests using Jest and Testing LibraryComponentName.axe.tsx file for accessibility testing using axe-corehelpers folder. See React to learn more about helpers.If you need any further help navigating the ink folder, you can reach out on the ink channel #ink