The team follows the Google developer's and the Microsoft's documentation style guide. The style rules are configured with the help of Vale linter.
Please ensure that the below prerequisites are met before you configure vale linter. You should have:
-
Brew installed on your Mac, or Chocolatey installed on your Windows machine.
For windows, you could also use the command prompt and curl command to install brew -
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh -
Vale installed on your mac/windows.
If not already installed, you could install vale using
brew install valefor mac, orchoco install valeon Windows. Once installed, verify the versionvale -v. You can also check the Vale installation page for other options. -
Install the vale extension for VS Code Editor.
You could also use vale cli.
Follow the below steps to setup the linter:
- Clone the documentation appsmith-docs repository and open it in VS Code Editor.
- Create a branch that you need to work on.
- Configure the vale extension to read the
.vale.inifile. Go to Extension Settings --> SelectWorkspacetab --> Set up the path of.vale.inifile forVale › Vale CLI: Configparameter.
You could use
${workspaceFolder}/.vale.inito specify the path. Please note that${workspaceFolder}points to the folder that's opened in the VS Code Editor.
Restart the VS code editor and open up any .md file to verify the errors if any. The vale linter issues are shown in the problems tab.
- Add words to be recognized as valid: There could be instances where the linter would raise issues for words as misspelled, even though they are technically correct. For example,
datasource,Appsmith, and more. To add these exceptions, navigate to.github\styles\Vocab\technical. Openaccept.txtfile and add the words to it. Vale linter will now treat these words as valid and will not raise errors for them. - Add words to be recognized as invalid: There are some words that we want to raise errors, even if they are technically correct. To do that, navigate to
.github\styles\Vocab\technical. Openreject.txtand add the words to it on new lines. Vale linter ensures that these words are treated as invalid and errors are raised.