Linter Overview

Bit's Linter simplifies and standardizes the process of component linting. It does so for linting during development (in the workspace) and for linting during component build (in a capsule, as part of the Build Pipeline)

Linting helps us maintain consistent code styling and avoid potential bugs by analyzing our source code, statically, before it is compiled and executed.

Linting in development

Bit lints all components in the workspace using just a single command. That is true for components of all types, regardless of their specific Env, and as a consequence of that, their specific Linter implementation and configuration.

bit lint
CopiedCopy

To learn more on linting during development, please refer to Workspace Linting.

Linting during build

During build, the lint task is only used for checking linting issues. it will not re-write the components with the auto fix option.

Testing components for distribution is done during build by the Bit Builder. Component build can be simulated with bit build and done through snaps.

bit build
CopiedCopy

By default, linting is not part of the build pipeline.

Configuring and implementing Linters

The Linter implementation is configured in the env which is configured on your component. Customizing it can be done by customizing an existing env with your linter or by implementing your own Env .

Linter can also be implemented into Bit through few interfaces. For more information on implementing your own linter please refer to Implement a Linter.