markdownlint 0.26.2 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/CONTRIBUTING.md +81 -59
  2. package/README.md +424 -303
  3. package/demo/markdownlint-browser.js +374 -144
  4. package/doc/CustomRules.md +101 -50
  5. package/doc/Prettier.md +14 -10
  6. package/doc/ReleaseProcess.md +20 -0
  7. package/doc/Rules.md +453 -296
  8. package/doc/md001.md +37 -0
  9. package/doc/md002.md +37 -0
  10. package/doc/md003.md +59 -0
  11. package/doc/md004.md +49 -0
  12. package/doc/md005.md +53 -0
  13. package/doc/md006.md +46 -0
  14. package/doc/md007.md +55 -0
  15. package/doc/md009.md +51 -0
  16. package/doc/md010.md +56 -0
  17. package/doc/md011.md +30 -0
  18. package/doc/md012.md +38 -0
  19. package/doc/md013.md +60 -0
  20. package/doc/md014.md +54 -0
  21. package/doc/md018.md +27 -0
  22. package/doc/md019.md +28 -0
  23. package/doc/md020.md +29 -0
  24. package/doc/md021.md +31 -0
  25. package/doc/md022.md +46 -0
  26. package/doc/md023.md +26 -0
  27. package/doc/md024.md +47 -0
  28. package/doc/md025.md +49 -0
  29. package/doc/md026.md +41 -0
  30. package/doc/md027.md +24 -0
  31. package/doc/md028.md +40 -0
  32. package/doc/md029.md +98 -0
  33. package/doc/md030.md +82 -0
  34. package/doc/md031.md +50 -0
  35. package/doc/md032.md +38 -0
  36. package/doc/md033.md +27 -0
  37. package/doc/md034.md +44 -0
  38. package/doc/md035.md +42 -0
  39. package/doc/md036.md +45 -0
  40. package/doc/md037.md +37 -0
  41. package/doc/md038.md +40 -0
  42. package/doc/md039.md +21 -0
  43. package/doc/md040.md +52 -0
  44. package/doc/md041.md +49 -0
  45. package/doc/md042.md +32 -0
  46. package/doc/md043.md +72 -0
  47. package/doc/md044.md +35 -0
  48. package/doc/md045.md +34 -0
  49. package/doc/md046.md +40 -0
  50. package/doc/md047.md +34 -0
  51. package/doc/md048.md +41 -0
  52. package/doc/md049.md +32 -0
  53. package/doc/md050.md +32 -0
  54. package/doc/md051.md +50 -0
  55. package/doc/md052.md +33 -0
  56. package/doc/md053.md +38 -0
  57. package/helpers/README.md +35 -15
  58. package/helpers/helpers.js +204 -42
  59. package/helpers/package.json +2 -2
  60. package/lib/constants.js +8 -1
  61. package/lib/markdownlint.js +7 -7
  62. package/lib/md011.js +2 -2
  63. package/lib/md013.js +7 -6
  64. package/lib/md019.js +1 -1
  65. package/lib/md022.js +15 -3
  66. package/lib/md023.js +1 -1
  67. package/lib/md026.js +1 -1
  68. package/lib/md033.js +15 -4
  69. package/lib/md034.js +70 -45
  70. package/lib/md035.js +1 -1
  71. package/lib/md037.js +2 -2
  72. package/lib/md038.js +1 -1
  73. package/lib/md039.js +1 -1
  74. package/lib/md040.js +21 -2
  75. package/lib/md043.js +4 -2
  76. package/lib/md044.js +4 -3
  77. package/lib/md051.js +37 -5
  78. package/lib/rules.js +1 -1
  79. package/package.json +31 -21
  80. package/schema/.markdownlint.jsonc +10 -3
  81. package/schema/.markdownlint.yaml +8 -2
  82. package/schema/markdownlint-config-schema.json +27 -3
  83. package/style/prettier.json +26 -0
package/CONTRIBUTING.md CHANGED
@@ -1,63 +1,85 @@
1
1
  # Contributing
2
2
 
3
- Interested in contributing? Great! Here are some suggestions to make it a good experience:
4
-
5
- Start by [opening an issue](https://github.com/DavidAnson/markdownlint/issues), whether to identify a problem or outline a change.
6
- That issue should be used to discuss the situation and agree on a plan of action before writing code or sending a pull request.
7
- Maybe the problem isn't really a problem, or maybe there are more things to consider.
8
- If so, it's best to realize that before spending time and effort writing code that may not get used.
9
-
10
- Match the coding style of the files you edit.
11
- Although everyone has their own preferences and opinions, a pull request is not the right forum to debate them.
12
-
13
- Do not add new [`dependencies` to `package.json`](https://docs.npmjs.com/files/package.json#dependencies).
14
- The excellent Markdown parser [markdown-it](https://www.npmjs.com/package/markdown-it) is this project's one and only dependency.
15
-
16
- If developing a new rule, start by creating a [custom rule](doc/CustomRules.md) in its own project.
17
- Once written, published, and tested in real world scenarios, open an issue to consider adding it to this project.
18
- For rule ideas, see [issues tagged with the `new rule` label](https://github.com/DavidAnson/markdownlint/labels/new%20rule).
19
-
20
- Add tests for all new/changed functionality.
21
- Test positive and negative scenarios.
22
- Try to break the new code now, or else it will get broken later.
23
-
24
- Run tests before sending a pull request via `npm test` in the [usual manner](https://docs.npmjs.com/misc/scripts).
25
- Tests should all pass on all platforms.
26
- The test runner is [AVA](https://github.com/avajs/ava) and test cases are located in `test/markdownlint-test*.js`.
27
- When running tests, `test/*.md` files are enumerated, linted, and fail if any violations are missing a corresponding `{MD###}` marker in the test file.
28
- For example, the line `### Heading {MD001}` is expected to trigger the rule `MD001`.
29
- For cases where the marker text can not be present on the same line, the syntax `{MD###:#}` can be used to include a line number.
30
- If `some-test.md` needs custom configuration, a `some-test.json` is used to provide a custom `options.config` for that scenario.
31
- Tests run by `markdownlint-test-scenarios.js` use [AVA's snapshot feature](https://github.com/avajs/ava/blob/main/docs/04-snapshot-testing.md).
32
- To update snapshots (for example, after modifying a test file), run `npm run update-snapshots` and include the updated files with the pull request.
33
-
34
- Lint before sending a pull request by running `npm run lint`.
35
- There should be no issues.
36
-
37
- Run a full continuous integration pass before sending a pull request via `npm run ci`.
38
- Code coverage should always be 100%.
39
- As part of a continuous integration run, generated files may get updated and fail the run - commit them to the repository and rerun continuous integration.
40
-
41
- Pull requests should contain a single commit.
42
- If necessary, squash multiple commits before creating the pull request and when making changes.
43
- (See [Git Tools - Rewriting History](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) for details.)
44
-
45
- Open pull requests against the `next` branch.
46
- That's where the latest changes are staged for the next release.
47
- Include the text "(fixes #??)" at the end of the commit message so the pull request will be associated with the relevant issue.
48
- End commit messages with a period (`.`).
49
- Once accepted, the tag `fixed in next` will be added to the issue.
50
- When the commit is merged to the main branch during the release process, the issue will be closed automatically.
51
- (See [Closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/) for details.)
52
-
53
- Please refrain from using slang or meaningless placeholder words.
54
- Sample content can be "text", "code", "heading", or the like.
55
- Sample URLs should use [example.com](https://en.wikipedia.org/wiki/Example.com) which is safe for this purpose.
56
- Profanity is not allowed.
57
-
58
- In order to maintain the permissive MIT license this project uses, all contributions must be your own and released under that license.
59
- Code you add should be an original work and should not be copied from elsewhere.
60
- Taking code from a different project, Stack Overflow, or the like is not allowed.
61
- The use of tools such as GitHub Copilot that generate code from other projects is not allowed.
3
+ Interested in contributing? Great! Here are some suggestions to make it a good
4
+ experience:
5
+
6
+ Start by [opening an issue](https://github.com/DavidAnson/markdownlint/issues),
7
+ whether to identify a problem or outline a change. That issue should be used to
8
+ discuss the situation and agree on a plan of action before writing code or
9
+ sending a pull request. Maybe the problem isn't really a problem, or maybe there
10
+ are more things to consider. If so, it's best to realize that before spending
11
+ time and effort writing code that may not get used.
12
+
13
+ Match the coding style of the files you edit. Although everyone has their own
14
+ preferences and opinions, a pull request is not the right forum to debate them.
15
+
16
+ Do not add new [`dependencies` to `package.json`][dependencies]. The excellent
17
+ Markdown parser [markdown-it][markdown-it] is this project's one and only
18
+ dependency.
19
+
20
+ If developing a new rule, start by creating a [custom rule][custom-rules] in its
21
+ own project. Once written, published, and tested in real world scenarios, open
22
+ an issue to consider adding it to this project. For rule ideas, see [issues
23
+ tagged with the `new rule` label][new-rule].
24
+
25
+ Add tests for all new/changed functionality. Test positive and negative
26
+ scenarios. Try to break the new code now, or else it will get broken later.
27
+
28
+ Run tests before sending a pull request via `npm test` in the [usual
29
+ manner][npm-scripts]. Tests should all pass on all platforms. The test runner is
30
+ [AVA][ava] and test cases are located in `test/markdownlint-test*.js`. When
31
+ running tests, `test/*.md` files are enumerated, linted, and fail if any
32
+ violations are missing a corresponding `{MD###}` marker in the test file. For
33
+ example, the line `### Heading {MD001}` is expected to trigger the rule `MD001`.
34
+ For cases where the marker text can not be present on the same line, the syntax
35
+ `{MD###:#}` can be used to include a line number. If `some-test.md` needs custom
36
+ configuration, a `some-test.json` is used to provide a custom `options.config`
37
+ for that scenario. Tests run by `markdownlint-test-scenarios.js` use [AVA's
38
+ snapshot feature][ava-snapshots]. To update snapshots (for example, after
39
+ modifying a test file), run `npm run update-snapshots` and include the updated
40
+ files with the pull request.
41
+
42
+ Lint before sending a pull request by running `npm run lint`. There should be no
43
+ issues.
44
+
45
+ Run a full continuous integration pass before sending a pull request via `npm
46
+ run ci`. Code coverage should always be 100%. As part of a continuous
47
+ integration run, generated files may get updated and fail the run - commit them
48
+ to the repository and rerun continuous integration.
49
+
50
+ Pull requests should contain a single commit. If necessary, squash multiple
51
+ commits before creating the pull request and when making changes. (See [Git
52
+ Tools - Rewriting History][rewriting-history] for details.)
53
+
54
+ Open pull requests against the `next` branch. That's where the latest changes
55
+ are staged for the next release. Include the text "(fixes #??)" at the end of
56
+ the commit message so the pull request will be associated with the relevant
57
+ issue. End commit messages with a period (`.`). Once accepted, the tag `fixed in
58
+ next` will be added to the issue. When the commit is merged to the main branch
59
+ during the release process, the issue will be closed automatically. (See
60
+ [Closing issues using keywords][closing-keywords] for details.)
61
+
62
+ Please refrain from using slang or meaningless placeholder words. Sample content
63
+ can be "text", "code", "heading", or the like. Sample URLs should use
64
+ [example.com][example-com] which is safe for this purpose. Profanity is not
65
+ allowed.
66
+
67
+ In order to maintain the permissive MIT license this project uses, all
68
+ contributions must be your own and released under that license. Code you add
69
+ should be an original work and should not be copied from elsewhere. Taking code
70
+ from a different project, Stack Overflow, or the like is not allowed. The use of
71
+ tools such as GitHub Copilot that generate code from other projects is not
72
+ allowed.
62
73
 
63
74
  Thank you!
75
+
76
+ [ava]: https://github.com/avajs/ava
77
+ [ava-snapshots]: https://github.com/avajs/ava/blob/main/docs/04-snapshot-testing.md
78
+ [closing-keywords]: https://help.github.com/articles/closing-issues-using-keywords/
79
+ [custom-rules]: doc/CustomRules.md
80
+ [dependencies]: https://docs.npmjs.com/files/package.json#dependencies
81
+ [example-com]: https://en.wikipedia.org/wiki/Example.com
82
+ [markdown-it]: https://www.npmjs.com/package/markdown-it
83
+ [new-rule]: https://github.com/DavidAnson/markdownlint/labels/new%20rule
84
+ [npm-scripts]: https://docs.npmjs.com/misc/scripts
85
+ [rewriting-history]: https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History