Linting during Development

During development, Bit lints your components using the bit lint. That command provides a standard dev experience for linting any kind of component, whether it is a NodeJS modules, a React component or anything else.

Lint all components in the Workspace

Bit lints all components in the workspace regardless to the configured env and therefor linter, with a single command.

bit lint
CopiedCopy

Lint only components that changed

Use the --changed flag to lint only new and modified components. Use bit status to learn which components are either new or modified.

bit lint --changed
CopiedCopy

CLI References

Linter workspace configurations

The Linter can be configured in the workspace.jsonc configuration file.

fixTypes

Determines whether to automatically fix issues found.

For example:

{
  "teambit.defender/linter": {
    "fixTypes": ["problem", "suggestion", "layout']
  }
}
CopiedCopy

extensionFormats

Determines the files to lint by their extension.

For example:

{
  "teambit.defender/linter": {
    "extensionFormats": ["*.ts", "*.tsx"]
  }
}
CopiedCopy