Skip to content

Commit 8e2349f

Browse files
authored
docs: updated core config file details (#309)
* add id for monorepo-options * add titles to code blocks in config file * update config file creation details and links
1 parent 7ddeb37 commit 8e2349f

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

packages/core/docs/core.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,17 @@ npm install @react-native-ama/core
2424

2525
### Config File
2626

27-
When you install the `@react-native-ama/core` package, the ama.rules.json file should be generated automatically. In cases it doesn't generate automatically, run the following from the root of your project:
27+
When you install the `@react-native-ama/core` package, the `ama.rules.json` file should be generated automatically in your project's root folder. If it didn't generate automatically when you installed the package, you can create it manually with the default config:
2828

29-
```bash
30-
# Create ama.rules.json with an empty JSON object if it doesn't exist
31-
echo "{}" >> ama.rules.json
32-
33-
# Navigate to the internal directory
34-
cd node_modules/@react-native-ama/internal
35-
36-
# Create symlinks in src and dist directories
37-
ln -s ../../../ama.rules.json src/ama.rules.json
38-
ln -s ../../../ama.rules.json dist/ama.rules.json
39-
40-
# Go back to the root directory
41-
cd -
29+
```json title="ama.rules.json"
30+
{
31+
rules: {},
32+
accessibilityLabelExceptions: [],
33+
};
4234
```
4335

36+
If you are running a monorepo setup your config file may not be configured correctly, be sure to check the [options for customizing AMA's config](/docs/config-file#monorepo-options).
37+
4438
For more detailed information about the config file, please refer to [this documentation](/docs/config-file).
4539

4640
## Usage

website/docs/ama/config-file.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Rules marked with <No /> are considered bad practices and cannot be turned off!
5555

5656
A JSON file called `ama.config.json` should have been automatically generated in the project's root folder (If it didn't simply create it). This file is used to customize the log rules, then specify the custom log level for the wanted key. `accessibilityLabelExceptions` can also be specified in this file. Any changes to this file will automatically be picked up by AMA's config and applied to the applications warnings and errors in Dev mode. (You will need to restart your application to see the changes applied)
5757

58+
<p id="monorepo-options">
5859
:::warning
5960
If you are running a monorepo setup this file won't automatically generate and you will have two options customize AMA's config.
6061

@@ -102,11 +103,13 @@ cp ama.rules.json node_modules/@react-native-ama/internal/ama.rules.json
102103

103104
:::
104105

106+
</p>
107+
105108
### Example
106109

107110
The JSON file does not need to contain all log keys. **AMA** uses the default rule if a key is not present:
108111

109-
```json
112+
```json title="ama.rules.json"
110113
{
111114
rules: {
112115
"CONTRAST_FAILED": "warn",
@@ -124,7 +127,7 @@ Elements that perform a contrast check do it on all the children up to the level
124127
| -------------------------- | ------------- |
125128
| CONTRAST_CHECKER_MAX_DEPTH | 5 |
126129

127-
```json
130+
```json title="ama.rules.json"
128131
{
129132
"rules": {
130133
"CONTRAST_CHECKER_MAX_DEPTH": 0
@@ -140,7 +143,7 @@ This can be turned off by specifying a level of **0**
140143

141144
**AMA** performs various checks, including one for [uppercase](/guidelines/uppercase). This rule allows specifying a list of approved all-caps accessibility labels.
142145

143-
```json
146+
```json title="ama.rules.json"
144147
{
145148
"accessibilityLabelExceptions": ["FAQ"]
146149
}

0 commit comments

Comments
 (0)