Skip to content

Commit d11abff

Browse files
clementDoursClément Dours
andauthored
Feat/create how to contribute file (#20)
* feat: move content on how to contribute to a separate file * feat: link the contributing file in the readme --------- Co-authored-by: Clément Dours <clementdo@bam.tech>
1 parent 4ee0483 commit d11abff

2 files changed

Lines changed: 61 additions & 56 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ESLint plugin for BAM
2+
3+
This project is an ESLint plugin that gathers all the rules, plugins and parsers that should be used in any new BAM project. Here is the documentation on how to contribute to this plugin
4+
5+
## How to improve?
6+
7+
If you find a useful rule that you feel every project at BAM should use, feel free to open a PR.
8+
9+
Use the documentation on how to create a shareable configuration [here](https://eslint.org/docs/latest/developer-guide/shareable-configs).
10+
11+
Here is a small summary:
12+
13+
### Adding new rules
14+
15+
Adding new rules is quite simple, you just have to modify `index.js` and add your rule to the `rules` object:
16+
17+
```js
18+
module.exports = {
19+
...
20+
rules: {
21+
...
22+
"my-new-rule": "error",
23+
},
24+
...
25+
}
26+
```
27+
28+
### Extending new shareable configurations
29+
30+
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):
31+
32+
```js
33+
module.exports = {
34+
...
35+
extends: [
36+
...
37+
"@some-scope/eslint-config",
38+
],
39+
...
40+
}
41+
```
42+
43+
The package containing your shareable configuration should be added as a dependency by running `yarn add your-package`.
44+
45+
### Adding a plugin
46+
47+
Adding a plugin is quite simple, you just have to modify `index.js` and add your plugin to the `plugins` array:
48+
49+
```js
50+
module.exports = {
51+
...
52+
plugins: [
53+
...
54+
"your-plugin",
55+
],
56+
...
57+
}
58+
```
59+
60+
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`.

packages/eslint-plugin/README.md

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -40,59 +40,4 @@ In your `.eslintrc` config file, extend the exported recommended configuration (
4040

4141
You can still customize your ESLint config by adding configurations, plugins and rules to your `.eslintrc` config file.
4242

43-
## How to improve?
44-
45-
If you find a useful rule that you feel every project at BAM should use, feel free to open a PR.
46-
47-
Use the documentation on how to create a shareable configuration [here](https://eslint.org/docs/latest/developer-guide/shareable-configs).
48-
49-
Here is a small summary:
50-
51-
### Adding new rules
52-
53-
Adding new rules is quite simple, you just have to modify `index.js` and add your rule to the `rules` object:
54-
55-
```js
56-
module.exports = {
57-
...
58-
rules: {
59-
...
60-
"my-new-rule": "error",
61-
},
62-
...
63-
}
64-
```
65-
66-
### Extending new shareable configurations
67-
68-
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):
69-
70-
```js
71-
module.exports = {
72-
...
73-
extends: [
74-
...
75-
"@some-scope/eslint-config",
76-
],
77-
...
78-
}
79-
```
80-
81-
The package containing your shareable configuration should be added as a dependency by running `yarn add your-package`.
82-
83-
### Adding a plugin
84-
85-
Adding a plugin is quite simple, you just have to modify `index.js` and add your plugin to the `plugins` array:
86-
87-
```js
88-
module.exports = {
89-
...
90-
plugins: [
91-
...
92-
"your-plugin",
93-
],
94-
...
95-
}
96-
```
97-
98-
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`.
43+
If you find a useful rule that you feel every project at BAM should use, feel free to contribute, [here is a link](./CONTRIBUTING.md) where you'll find explanations on how to do so.

0 commit comments

Comments
 (0)