You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to automate the release process. Please follow the commit message format described in the link above. Lerna will automatically generate the changelog for each package based on the commit messages since the last version. (see [README.md](README.md#publishing-a-new-version-of-a-package))
9
+
We use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) to automate the release process. Please follow the commit message format described in the link above. Lerna will automatically generate the changelog for each package based on the commit messages since the last version. (see [README.md](https://github.com/bamlab/react-native-project-config/blob/main/README.md#publishing-a-new-version-of-a-package))
10
+
11
+
## markdown lint
12
+
13
+
We don't use relative links bewteen .md files, NPM handles them differently than github does, and this creates a bug on NPM where the links are broken. On this project you have markdown lint set up. You can download the [markdown lint VSCode extension](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint), it will lint your .md files as you write them. There is a [custom rule](https://github.com/bamlab/react-native-project-config/blob/main/markdown-lint-custom-rules/no-relative-links.js) that prevents the use of relative links in .md files. You can check it if you need to write a new custom rule. The scipt and the extension use this [configuration file](https://github.com/bamlab/react-native-project-config/blob/main/.vscode/settings.json), and the custom rules that are added in the VS Code [settings](https://github.com/bamlab/react-native-project-config/blob/main/.markdownlint.json)
The publication is done automatically by this [Github Workflow](.github/workflows/publish.yml) when a new tag is pushed to the repository.
35
+
The publication is done automatically by this [Github Workflow](https://github.com/bamlab/react-native-project-config/blob/main/.github/workflows/publish.yml) when a new tag is pushed to the repository.
36
36
All you have to do is the versioning of the packages you want to publish.
37
37
38
38
> You need to be on the main branch and have the repo write access to publish a new version.
Copy file name to clipboardExpand all lines: packages/eslint-plugin/CONTRIBUTING.md
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,17 @@ It is important to keep it up to date and to add new rules and configurations wh
7
7
8
8
If you feel that a rule could be useful to all react-native new projects, you can add it to the plugin by following these steps:
9
9
10
-
####Open an issue to discuss the rule with the community:
10
+
### Open an issue to discuss the rule with the community
11
11
12
12
- Go to this link : [RFC for a new rule on eslint-plugin ⭐](https://github.com/bamlab/react-native-project-config/issues/new?assignees=&labels=%F0%9F%93%8F+eslint-plugin%2C%E2%AD%90+enhancement&projects=&template=RFC-NEW-RULE.yml&title=%5BRFC%5D%3A+plugin%3Arule-name)
13
13
- Fill the template with any relevant information about the rule (why it is needed, how it works, shareable configs to add it to, etc.)
14
14
- Submit the issue and share it with the community
15
15
16
-
####After the discussion, if the rule is approved, you can create a PR to add the rule to the plugin:
16
+
### After the discussion, if the rule is approved, you can create a PR to add the rule to the plugin
17
17
18
18
- Create a new branch from `main` with the name `feat/plugin-rule-name`
19
19
- Go to the corresponding shareable config file (for example `recommended.js`) and add the rule to the `rules` object:
20
+
20
21
```js
21
22
// recommended.js
22
23
module.exports= {
@@ -27,9 +28,13 @@ If you feel that a rule could be useful to all react-native new projects, you ca
27
28
},
28
29
}
29
30
```
31
+
30
32
> If you feel a new shareable config should be created for the rule, please refer to the [Creating new shareable configuration](#creating-new-shareable-configuration) section.
33
+
31
34
- (Optional) If the plugin the rule is part of is not yet added as a dependency:
35
+
32
36
- add the plugin in the `plugins` array of the shareable config file:
37
+
33
38
```js
34
39
// recommended.js
35
40
module.exports= {
@@ -40,7 +45,9 @@ If you feel that a rule could be useful to all react-native new projects, you ca
40
45
],
41
46
}
42
47
```
48
+
43
49
- add the plugin to the `peerDependencies`of the `package.json` file:
50
+
44
51
```json
45
52
// package.json
46
53
{
@@ -51,9 +58,10 @@ If you feel that a rule could be useful to all react-native new projects, you ca
51
58
},
52
59
}
53
60
```
61
+
54
62
- In the description of the PR, add `Closes #<issue number>` to link the PR to the issue and close it automatically when the PR is merged
55
63
56
-
#### (OPTIONAL) Feel free to add a breaking example of the rule in the `example-app/eslint-breaking-examples` directory:
64
+
#### (OPTIONAL) Feel free to add a breaking example of the rule in the `example-app/eslint-breaking-examples` directory
57
65
58
66
Here's an example:
59
67
@@ -93,6 +101,7 @@ Creating new rules is quite simple:
|[`@bam.tech/recommended`](./lib/configs/recommended.js)| The recommended config for all projects |
36
-
|[`@bam.tech/tests`](./lib/configs/tests.js)| The recommended config for test files. By default this applies to every file: put it in an `overrides` to filter on your test files. |
37
-
|[`@bam.tech/a11y`](./lib/configs/a11y.js)|[beta] Eslint config to check for accessibility. Still in beta to not break existing projects, but will be merged into the recommended config in the future. |
|[`@bam.tech/recommended`](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/lib/configs/recommended.js)| The recommended config for all projects |
36
+
|[`@bam.tech/tests`](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/lib/configs/tests.js)| The recommended config for test files. By default this applies to every file: put it in an `overrides` to filter on your test files. |
37
+
|[`@bam.tech/a11y`](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/lib/configs/a11y.js)|[beta] Eslint config to check for accessibility. Still in beta to not break existing projects, but will be merged into the recommended config in the future. |
38
38
39
39
These configs need some peer dependencies. You can list them with:
40
40
@@ -59,14 +59,15 @@ This plugin exports some custom rules that you can optionally use in your projec
59
59
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
60
60
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).
|[accessibility-props-require-accessible](docs/rules/accessibility-props-require-accessible.md)| Requires accessible prop when accessibility props are defined | ♿ | 🔧 ||
65
-
|[do-not-use-role-on-image](docs/rules/do-not-use-role-on-image.md)| Disallow role prop on Image component | ♿ | 🔧 ||
|[requires-accessibility-role-when-accessible](docs/rules/requires-accessibility-role-when-accessible.md)| Enforces accessibilityRole or role when component is accessible | ♿ || 💡 |
|[accessibility-props-require-accessible](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/accessibility-props-require-accessible.md)| Requires accessible prop when accessibility props are defined | ♿ | 🔧 ||
66
+
|[do-not-use-role-on-image](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/do-not-use-role-on-image.md)| Disallow role prop on Image component | ♿ | 🔧 ||
|[require-named-effect](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/require-named-effect.md)| Enforces the use of named functions inside a useEffect ||||
|[requires-accessibility-role-when-accessible](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/docs/rules/requires-accessibility-role-when-accessible.md)| Enforces accessibilityRole or role when component is accessible | ♿ || 💡 |
70
71
71
72
<!-- end auto-generated rules list -->
72
73
@@ -88,6 +89,6 @@ To use a rule, just declare it in your `.eslintrc`:
88
89
89
90
You can still customize your ESLint config by adding other configurations, plugins and rules to your `.eslintrc` config file.
If you find a useful rule that you feel every project at BAM should use, feel free to [contribute](./CONTRIBUTING.md).
94
+
If you find a useful rule that you feel every project at BAM should use, feel free to [contribute](https://github.com/bamlab/react-native-project-config/blob/main/packages/eslint-plugin/CONTRIBUTING.md).
0 commit comments