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
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.
20
21
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.
24
23
25
24
## Other Development Tools
26
25
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.
32
29
33
-
## Test the Rule
30
+
## Rule Testing
34
31
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.
38
33
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.
41
36
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:
44
39
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`.
47
42
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.
49
44
50
45
**Tips**:
51
46
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:
53
48
54
49
```sh
55
50
pnpm run test -- -g indent
56
51
```
57
52
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.
59
54
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.)
62
57
63
-
## Commit messages
58
+
## Preview Docs
64
59
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
+
```
66
64
67
65
## Publishing
68
66
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.
70
68
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