Ink ESLint Plugin

Last Updated: Jan 10, 2026

An ESLint plugin with ink specific rules

How to install the plugin

You can install it with:

yarn add @carta/eslint-plugin-ink-rules

add it to your .eslintrc file as a plugin:

{
"plugins": ["@carta/ink-rules"]
}

and extend the plugin's recommended rules:

{
"extends": ["plugin:@carta/ink-rules/recommended"]
}

If you want to separately configure each rule you can follow the ESLint documentation, but we highly recommend using the pre-existing configuration so your code is always up to date with the recommended ink guidelines and no accidental errors are introduced.

Categories

These are the rules we currently have in the linter. They are sectioned into different categories according to what the rule does and are in alphabetical order. They each have a recommended severity, which are the same severities set through the recommended configuration of the plugin.

Possible Errors

RuleShort DescriptionSeverity
checkbox-with-idEnforces the use of id on NewCheckbox and Checkboxerror
no-ink-classesDisallows the usage of .ink-* classeserror

Accessibility & UX

RuleShort DescriptionSeverity
field-with-htmlforSuggests the use of htmlFor in Fields and matching ids in the internal inputswarning
no-placeholdersDisallows the usage of placeholders in inputs outside tableswarning

Deprecation

RuleShort DescriptionSeverity
no-deprecated-propsDisallows the usage of deprecated props in specific componentserror
no-deprecated-componentsDisallows usage and alerts for the deletion date of deprecated componentserror

Rules

Checkbox with id

Recommended Severity: error

In order to properly work, each Ink checkbox needs an id. This rule prevents non-functional checkboxes by enforcing the use of ids on Checkbox and NewCheckbox and throwing an error when an id is not provided.

Link to the rule on AST Explorer.

No ink classes

This rule prevents the usage of .ink-* hardcoded classes. These class names are a part of a private API used internally for the Ink library, and are being deprecated. Instead, use Ink components themselves to ensure compatibility with future versions of the library.

Recommended Severity: error

Field with htmlFor

This rule suggests the use of htmlFor in Fields and id in inputs, and reinforces that those two props should be the same. Matching the htmlFor and id props improves accessibility - if they don't match, the input is not linked to the label inside Field, and consequently cannot be hovered, focused, or selected when clicking the label.

Recommended Severity: warning

Link to the rule on AST Explorer.

No placeholders

This rule suggests avoiding the use of placeholder in inputs except when inside a table cell. Using placeholders in inputs can cause accessibility issues and a bad user experience. An empty input tells the user that they still need to add information, while placeholders may cause confusion.

Recommended Severity: warning

Link to the rule on AST Explorer.

No deprecated props

This rule disallows the use of deprecated props in ink components. These props will eventually be deleted. Avoid using them to mitigate the risk of your product breaking in the near future.

At the moment the components and props affected by this rule are:

ComponentPropReplacement Prop
Alerttypevariant
ListItemstatusColorvariant
ListItemstatusIconvariant
ListItemstatusDashedvariant
ListItemstatusInversevariant
ListItemstatusSpinnervariant= "pending"
MonologuemarginBottomBox bottom
MonologuemarginTopBox top
NewInputinputRefexternalRef
Statuscolorvariant
Statusiconvariant
StatusisDashedvariant
StatusisInversevariant
StatusisSpinnervariant= "pending"

Recommended Severity: error

Link to the rule on AST Explorer.

No deprecated components

This rule disallows the use of deprecated components. If these components are already in use, they should be replaced with their newer counterparts. These components will be deleted on their determined date. Follow each migration guide to replace older components and reach out to the ink team if you have any problems.

At the moment the components affected by this rule are:

To migrate off of these components, go to their specific page to see their migration guide.

To check the code for this plugin, go to our Repository.