Build a Lint Rule
This documentation provides step-by-step instructions on developing a lint rule for the inlang ecosystem. Lint rules are used to check for specific patterns or issues in translated messages to ensure high-quality translations. Follow the guide below to create your own custom lint rule.
Pre-requisites
Before you begin developing a lint rule, make sure you have the following pre-requisites installed on your system:
- Node.js (version 18 or higher)
Step-by-step
1. Initialize a new lint rule module
You need to initialize a new lint rule module using the inlang CLI to get started. Open your terminal and run the following command:
This command will create a new lint rule project with the necessary files and directory structure.
2. Implement your lint rule
Now that you have a basic lint rule project, it's time to implement your custom lint rule logic. You can use the following code as a starting point and customize it to fit your lint rule requirements:
Replace yourLintRule
with a meaningful name for your lint rule.
Helpful example implementations of lint rules can be found here.
3. Configure your lint rule
In your lint rule's marketplace-manifest.json
make sure to define the following information:
4. Test your lint rule
Before publishing your lint rule to the marketplace, thoroughly test it to ensure it functions correctly and detects issues as intended.
5. Publish your lint rule
To make your lint rule available in the inlang.com marketplace, see Publish on marketplace.
Feel free to join our Discord if you have any questions or need assistance developing and publishing your lint rule.