Skip to content

Commit 764e39d

Browse files
authored
chore: update CONTRIBUTING.md (#1087)
1 parent 083ea48 commit 764e39d

File tree

1 file changed

+28
-30
lines changed

1 file changed

+28
-30
lines changed

CONTRIBUTING.md

+28-30
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing
22

3-
Thanks for contributing!
3+
Thank you for contributing!
44

55
## Installation
66

@@ -10,62 +10,60 @@ cd eslint-plugin-svelte
1010
pnpm install
1111
```
1212

13-
## Running the tests
13+
## Running Tests
1414

1515
```sh
16+
cd packages/eslint-plugin-svelte
1617
pnpm run test
1718
```
1819

19-
To run the tests with debugging log, you can use `pnpm run test:debug`.
20+
This is an [ESLint](http://eslint.org) plugin. See ESLint's [Working with Plugins](http://eslint.org/docs/developer-guide/working-with-plugins) for API details.
2021

21-
This is an [ESLint](http://eslint.org) plugin. Documentation for the APIs that it uses can be found on ESLint's [Working with Plugins](http://eslint.org/docs/developer-guide/working-with-plugins) page.
22-
23-
This plugin is used to lint itself. The style is checked when `pnpm run lint` is run, and the build will fail if there are any linting errors. You can use `pnpm run lint-fix` to fix some linting errors.
22+
The plugin lints itself. Running `pnpm run lint` checks the style and will fail the build if there are lint errors. Use `pnpm run lint-fix` to automatically fix some issues.
2423

2524
## Other Development Tools
2625

27-
- `pnpm run test` runs tests.
28-
- `pnpm run cover` runs tests and measures coverage.
29-
- `pnpm run new -- [new-rule-name]` generate the files needed to implement the new rule.
30-
- `pnpm run update` runs in order to update readme and recommended configuration.
31-
- `pnpm run docs:watch` launch the document site in development mode.
26+
- `pnpm run test` – runs tests.
27+
- `pnpm run new -- [new-rule-name]` – generates files for a new rule.
28+
- `pnpm run update` – updates the README and recommended configuration.
3229

33-
## Test the Rule
30+
## Rule Testing
3431

35-
Rule testing almost always uses fixtures.
36-
For example, for an `indent` rule, the `.ts` file that runs the test is `tests/src/rules/indent.ts` and the fixture is in `tests/fixtures/rules/indent`.
37-
The fixture directory has an `invalid` directory and a `valid` directory.
32+
Rule tests typically use fixtures. For example, for the `indent` rule, the test file is `tests/src/rules/indent.ts` and the fixtures are in `tests/fixtures/rules/indent`, which contains `invalid` and `valid` directories.
3833

39-
- The `invalid` directory contains test cases where the rule reports problems.
40-
- The `valid` directory contains test cases where the rule does not report a problem.
34+
- The `invalid` directory contains test cases where the rule should report errors.
35+
- The `valid` directory contains test cases where no errors are reported.
4136

42-
The fixture input file should be named `*-input.svelte`. It is automatically collected and tested.
43-
If your test requires configuration, you need to add a json file with the configuration.
37+
Fixture input files should be named `*-input.svelte` and are automatically collected.
38+
If configuration is needed, include a JSON file:
4439

45-
- If you want to apply a configuration to `my-test-input.svelte`, add `my-test-config.json`.
46-
- If you want to apply the same configuration to all the fixtures in that directory, add `_config.json`.
40+
- For a specific test file (e.g., `my-test-input.svelte`), add `my-test-config.json`.
41+
- For all fixtures in a directory, add `_config.json`.
4742

48-
To verify the output of invalid test cases requires `*-errors.json`, and `*-output.svelte` (for auto-fix). However, you don't have to add them yourself. If they do not exist, they will be automatically generated when you run the test. In other words, delete them manually when you want to recreate them.
43+
Verifying output for invalid tests requires `*-errors.json` and `*-output.svelte` (for auto-fix). These files are auto-generated if missing—delete them to recreate.
4944

5045
**Tips**:
5146

52-
If you want to test only one rule, run the following command (for `indent` rule):
47+
To test only one rule (e.g., `indent`), run:
5348

5449
```sh
5550
pnpm run test -- -g indent
5651
```
5752

58-
Take <https://stackoverflow.com/questions/10832031/how-to-run-a-single-test-with-mocha> as reference for details.
53+
Refer to [this Stack Overflow post](https://stackoverflow.com/questions/10832031/how-to-run-a-single-test-with-mocha) for details.
5954

60-
If you want to test only `my-test-input.svelte`, add `my-test-config.json` and save `{"only": true}`.
61-
(Note that `{"only": true}` must be removed before making a pull request.)
55+
To test a single file (e.g., `my-test-input.svelte`), add a `my-test-config.json` with `{"only": true}`.
56+
(Remember to remove `{"only": true}` before submitting a pull request.)
6257

63-
## Commit messages
58+
## Preview Docs
6459

65-
Please view [commitlint](https://commitlint.js.org) and [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) for more details.
60+
```sh
61+
cd docs-svelte-kit
62+
pnpm run build && pnpm run preview
63+
```
6664

6765
## Publishing
6866

69-
We're using [changesets](https://github.com/changesets/changesets) for version management, CHANGELOG and releasing automatically.
67+
We use [changesets](https://github.com/changesets/changesets) for version management, changelog generation, and automated releases.
7068

71-
Please view [changesets-bot](https://github.com/apps/changeset-bot) and its [action](https://github.com/changesets/action) for more details.
69+
For more details, see [changesets-bot](https://github.com/apps/changeset-bot) and its [action](https://github.com/changesets/action).

0 commit comments

Comments
 (0)