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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,8 @@ Please take a moment to review this document to understand our contribution guid
20
20
21
21
## Code of Conduct
22
22
23
-
This project and everyone participating in it is governed by the [js-quality-starter Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to <shytiger@yahoo.com>.
23
+
This project and everyone participating in it is governed by the [js-quality-starter Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [YOUR_PROJECT_CONTACT_EMAIL].
|**[ESLint](https://eslint.org/)**| Statically analyzes your code to quickly find and fix problems. It's configured with recommended rules to enforce best practices. |
14
-
|**[Prettier](https://prettier.io/)**| An opinionated code formatter that enforces a consistent style across your entire codebase, eliminating arguments over code style. |
15
-
|**[Jest](https://jestjs.io/)**| A delightful JavaScript Testing Framework with a focus on simplicity. It's set up and ready for you to write unit and integration tests. |
16
-
|**[Husky](https://typicode.github.io/husky/)**| Manages Git hooks to make it easy to run scripts at specific stages, like before a commit. |
17
-
|**[lint-staged](https://github.com/okonet/lint-staged)**| Works with Husky to run linters and formatters on your staged files _before_ they are committed, ensuring no bad code gets in. |
18
-
|**[GitHub Actions](https://github.com/features/actions)**| Automates your workflow with two pre-configured CI pipelines for validating code on `main` and all other feature branches. |
17
+
|**ESLint**| Statically analyzes your code to quickly find and fix problems. It's configured with recommended rules to enforce best practices. |
18
+
|**Prettier**| An opinionated code formatter that enforces a consistent style across your entire codebase, eliminating arguments over code style. |
19
+
|**Jest**| A delightful JavaScript Testing Framework with a focus on simplicity. It's set up and ready for you to write unit and integration tests. |
20
+
|**markdownlint**| A linter for Markdown files to enforce consistent style and catch common errors in documentation. |
21
+
|**Husky**| Manages Git hooks to make it easy to run scripts at specific stages, like before a commit. |
22
+
|**lint-staged**| Works with Husky to run linters and formatters on your staged files _before_ they are committed, ensuring no bad code gets in. |
23
+
|**GitHub Actions**| Automates your workflow with two pre-configured CI pipelines for validating code on `main` and all other feature branches. |
19
24
20
25
## Getting Started
21
26
@@ -35,17 +40,23 @@ This template comes pre-configured with a suite of modern, industry-standard too
35
40
cd your-new-repo
36
41
```
37
42
38
-
This will install all dependencies and also run the `prepare` script, which sets up the Husky pre-commit hooks automatically.
43
+
2. Install dependencies:
44
+
```bash
45
+
npm install
46
+
```
47
+
This will install all dependencies and also run the `prepare` script, which sets up the Husky pre-commit hooks automatically.
39
48
40
-
2. Start coding!
49
+
3. Start coding!
41
50
42
51
### Post-Template Setup
43
52
44
53
After creating your repository from this template, be sure to:
45
54
46
55
1. **Update `package.json`**: Change the `name`, `description`, and `author` fields.
47
56
2. **Update `LICENSE`**: Modify the `[year]` and `[fullname]` to reflect your project's ownership.
48
-
3.**Update `CODE_OF_CONDUCT.md` and `CONTRIBUTING.md`**: Replace the `[INSERT CONTACT EMAIL ADDRESS]` placeholder with a valid project contact email.
57
+
3. **Update `CODE_OF_CONDUCT.md` and `CONTRIBUTING.md`**: Replace the `[YOUR_PROJECT_CONTACT_EMAIL]` placeholder with a valid project contact email.
58
+
59
+
49
60
50
61
## Available Scripts
51
62
@@ -56,6 +67,8 @@ In the project directory, you can run:
56
67
- `npm run lint:fix`: Lints and automatically fixes fixable issues.
57
68
- `npm run format`: Checks for formatting issues with Prettier.
58
69
- `npm run format:fix`: Formats all supported files with Prettier.
70
+
- `npm run lint:md`: Lints all Markdown files.
71
+
- `npm run lint:md:fix`: Lints and automatically fixes fixable issues in Markdown files.
59
72
- `npm run format:md`: Checks for formatting issues with Prettier for Markdown files.
60
73
- `npm run format:md:fix`: Formats all Markdown files with Prettier.
61
74
@@ -78,23 +91,49 @@ Both workflows perform the following steps across multiple Node.js versions (18.
78
91
79
92
1. **Install dependencies** using `npm ci`for fast, reliable installs.
80
93
2. **Lint code** with `npm run lint`.
81
-
3.**Check Markdown formatting** with `npm run format:md`.
82
-
4.**Check formatting** with `npm run format`.
83
-
5.**Run tests** with `npm test`.
94
+
3. **Lint Markdown files** with `npm run lint:md`.
95
+
4. **Check code formatting** with `npm run format`.
96
+
5. **Check Markdown formatting** with `npm run format:md`.
97
+
6. **Check forbroken links**in Markdown with `npm run check:links`.
98
+
7. **Audit for vulnerabilities** with `npm audit --production`.
99
+
8. **Run tests** with `npm test`.
100
+
101
+
84
102
85
103
## Customization
86
104
87
105
This template is a starting point. You can easily customize it to fit your project's needs:
88
106
89
107
- **Linting Rules**: Modify the `.eslintrc.js` file to add or change ESLint rules.
90
108
- **Formatting Options**: Adjust the `.prettierrc` file to change Prettier's formatting options.
109
+
- **Markdown Linting**: Customize `markdownlint` rules by editing the `.markdownlint.json` file.
91
110
- **Testing**: The `jest.config.js` file can be configured for more advanced testing scenarios.
92
111
- **CI/CD**: Edit the workflow files in`.github/workflows` to add new steps, such as deployment or notifications.
93
112
113
+
## Code Coverage
114
+
115
+
This template is configured to generate code coverage reports using Jest. The reports are output to the `coverage/` directory in various formats, including `lcov`, which is compatible with popular code coverage services.
116
+
117
+
To get a dynamic code coverage badge like the one at the top of this `README.md`, you can integrate with a service like Codecov or Coveralls.
118
+
119
+
**Steps to set up Codecov (example):**
120
+
1. Sign up for Codecov with your GitHub account.
121
+
2. Add your repository to Codecov.
122
+
3. Codecov will provide you with a `CODECOV_TOKEN`. Add this token as a secret in your GitHub repository settings (e.g., `CODECOV_TOKEN`).
123
+
4. Add a step to your CI workflow (`.github/workflows/ci.yml`) to upload the coverage report to Codecov. This typically involves adding a step like:
124
+
```yaml
125
+
- name: Upload coverage to Codecov
126
+
uses: codecov/codecov-action@v4
127
+
with:
128
+
token: ${{ secrets.CODECOV_TOKEN }}
129
+
```
130
+
5. Update the badge URL in`README.md` with your specific repository details and token (if required by Codecov for public repos, though often not for public repos).
131
+
132
+
94
133
## Contributing
95
134
96
135
We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines on how to contribute, report bugs, and suggest enhancements.
97
136
98
137
## License
99
138
100
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details.
139
+
This project is licensed under the [LICENSE](LICENSE.md) file for details.
0 commit comments