For more development details you may have a look at the confluence pages about development details.
- Avoid including runtime dependencies as much as possible.
- Write integration tests with these advices.
- Re-use existing helper functions and classes.
- Use existing linting and code styles, based on configuration.
- Follow the existing structures for documentation, naming and setup.
Development environment and defaults
Many defaults are given by the linting and prettier configurations. But to keep the code base consistent and clean, we have set a certain set of rules:
- Use Volta for Node.js and yarn version handling.
- Use only Function and Class Components for components, elements, fragments and extensions - no Hooks.
- Use strictly the naming conventions.
- Use correct message decoration to insure correct versioning.
- Use best practices for CSS style structures.
- Use nested CSS class selectors with SASS (SCSS) and BEM (Block Element Modifier).
How to publish a new version to NPM?
Create a Fork, make your changes and create a Pull Request) - or commit your changes to a new branch. From there an admin will create a Pull Request into the
origin/main branch. Once Your commits got approved on CI, we will create a Pull Request to merge the changes in to the
As soon as the Pull Request gets merged into
origin/release, a CI/CD server will check all commits and figure out the new NPM Version Number and publish a new version based on the message decorations.
How to create a local package
yarn build:pack inside
/dnb-eufemia and you get this file:
How to enable lint-staged?
Create a file called
.env.local in the root of the repo (side-by-side to the .git folder), and put
# File: .env.localLINT_STAGED=1