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
- clone the project: `git clone https://github.com/bamlab/react-native-project-config`,
20
+
- install the dependencies: `yarn install`,
21
+
22
+
## Modifying the project
23
+
24
+
To have a complete understanding on how to modify the project, see [Lerna's documentation](https://lerna.js.org/docs/introduction).
25
+
26
+
Here are some useful commands:
27
+
28
+
- creating a new package named `package-my-config`: `yarn lerna create package-my-config`,
29
+
- rename the directory of a package: `mv package-my-config new-directory-name && yarn lerna bootstrap`,
30
+
- run a script `do-something` that exists in at least one package: `yarn lerna run do-something` (this will try to run the script in all packages in which it is defined).
31
+
32
+
## Running commands
14
33
15
34
-`yarn lerna run start`: run the 'start' script in all packages (currently only present in `example-app`),
16
35
-`yarn lerna run lint`: run the 'lint' script in all packages (currently only present in `example-app`).
This project is an ESLint config that gathers all the rules, plugins and parsers that should be used in any new BAM project.
4
+
5
+
## How to use?
6
+
7
+
In your app, run `yarn add --dev @bam.tech/eslint-config @typescript-eslint/eslint-plugin eslint`.
8
+
9
+
In your `.eslintrc` config file, extend the exported configuration:
10
+
11
+
```json
12
+
// .eslintrc
13
+
{
14
+
"extends": "@bam.tech/eslint-config"
15
+
}
16
+
```
17
+
18
+
## How to customize?
19
+
20
+
You can still customize your ESLint config by adding configurations, plugins and rules to your `.eslintrc` config file.
21
+
22
+
## How to improve?
23
+
24
+
If you find a useful rule that you feel every project at BAM should use, feel free to open a PR.
25
+
26
+
Use the documentation on how to create a shareable configuration [here](https://eslint.org/docs/latest/developer-guide/shareable-configs).
27
+
28
+
Here is a small summary:
29
+
30
+
### Adding new rules
31
+
32
+
Adding new rules is quite simple, you just have to modify `index.js` and add your rule to the `rules` object:
33
+
34
+
```js
35
+
module.exports= {
36
+
...
37
+
rules: {
38
+
...
39
+
"my-new-rule":"error",
40
+
},
41
+
...
42
+
}
43
+
```
44
+
45
+
### Extending new shareable configurations
46
+
47
+
Extending new shareable configurations is quite simple, you just have to modify `index.js` and add your shareable configuration to the `extends` array (the order of configurations is important):
48
+
49
+
```js
50
+
module.exports= {
51
+
...
52
+
extends: [
53
+
...
54
+
"@some-scope/eslint-config",
55
+
],
56
+
...
57
+
}
58
+
```
59
+
60
+
The package containing your shareable configuration should be added as a dependency by running `yarn add your-package`.
61
+
62
+
### Adding a plugin
63
+
64
+
Adding a plugin is quite simple, you just have to modify `index.js` and add your plugin to the `plugins` array:
65
+
66
+
```js
67
+
module.exports= {
68
+
...
69
+
plugins: [
70
+
...
71
+
"your-plugin",
72
+
],
73
+
...
74
+
}
75
+
```
76
+
77
+
The package containing your plugin should be added as a [peer dependency](https://classic.yarnpkg.com/en/docs/dependency-types/) by running `yarn add --peer your-plugin`.
0 commit comments