Skip to content

Commit

Permalink
Merge branch 'next' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Dec 28, 2021
2 parents 8849e84 + 4ff4cbc commit 02707cf
Show file tree
Hide file tree
Showing 91 changed files with 3,617 additions and 1,479 deletions.
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

102 changes: 59 additions & 43 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,68 @@
{
"parserOptions": {
"ecmaVersion": 2019
},
"env": {
"node": true,
"es6": true
},
"plugins": [
"jsdoc",
"node",
"unicorn"
],
"extends": [
"eslint:all",
"plugin:jsdoc/recommended"
],
"settings": {
"jsdoc": {
"preferredTypes": {
"object": "Object"
"ignorePatterns": [
"demo/markdown-it.min.js",
"demo/markdownlint-browser.js",
"demo/markdownlint-browser.min.js",
"demo/markdownlint-rule-helpers-browser.js",
"demo/markdownlint-rule-helpers-browser.min.js",
"example/typescript/type-check.js",
"test-repos/"
],
"overrides": [
{
"files": [
"demo/*.js"
],
"env": {
"browser": true
},
"rules": {
"jsdoc/require-jsdoc": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-add-event-listener": "off",
"no-console": "off",
"no-shadow": "off",
"no-var": "off"
}
},
{
"files": [
"example/*.js"
],
"rules": {
"node/no-missing-require": "off",
"node/no-extraneous-require": "off",
"no-console": "off",
"no-invalid-this": "off",
"no-shadow": "off",
"object-property-newline": "off"
}
}
],
"parserOptions": {
"ecmaVersion": 2020
},
"plugins": [
"jsdoc",
"node",
"unicorn"
],
"reportUnusedDisableDirectives": true,
"rules": {
"array-bracket-spacing": ["error", "always"],
"array-element-newline": "off",
"capitalized-comments": "off",
"complexity": "off",
"dot-location": ["error", "property"],
"func-style": ["error", "declaration"],
"func-style": "off",
"function-call-argument-newline": "off",
"function-paren-newline": "off",
"global-require": "off",
Expand Down Expand Up @@ -72,7 +105,7 @@

"jsdoc/check-access": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-examples": "error",
"jsdoc/check-examples": "off",
"jsdoc/check-indentation": "error",
"jsdoc/check-line-alignment": "error",
"jsdoc/check-param-names": "error",
Expand Down Expand Up @@ -174,11 +207,14 @@
"unicorn/no-array-method-this-argument": "error",
"unicorn/no-array-push-push": "error",
"unicorn/no-array-reduce": "error",
"unicorn/no-await-expression-member": "error",
"unicorn/no-console-spaces": "error",
"unicorn/no-document-cookie": "error",
"unicorn/no-empty-file": "error",
"unicorn/no-for-loop": "error",
"unicorn/no-hex-escape": "error",
"unicorn/no-instanceof-array": "error",
"unicorn/no-invalid-remove-event-listener": "error",
"unicorn/no-keyword-prefix": "off",
"unicorn/no-lonely-if": "error",
"unicorn/no-nested-ternary": "error",
Expand All @@ -192,6 +228,7 @@
"unicorn/no-unreadable-array-destructuring": "error",
"unicorn/no-unsafe-regex": "off",
"unicorn/no-unused-properties": "error",
"unicorn/no-useless-fallback-in-spread": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-undefined": "error",
Expand All @@ -205,12 +242,14 @@
"unicorn/prefer-array-index-of": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-at": "off",
"unicorn/prefer-code-point": "error",
"unicorn/prefer-date-now": "error",
"unicorn/prefer-default-parameters": "error",
"unicorn/prefer-dom-node-append": "error",
"unicorn/prefer-dom-node-dataset": "error",
"unicorn/prefer-dom-node-remove": "error",
"unicorn/prefer-dom-node-text-content": "error",
"unicorn/prefer-export-from": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-keyboard-event-key": "error",
"unicorn/prefer-math-trunc": "error",
Expand Down Expand Up @@ -241,37 +280,14 @@
"unicorn/require-number-to-fixed-digits-argument": "error",
"unicorn/require-post-message-target-origin": "error",
"unicorn/string-content": "error",
"unicorn/template-indent": "error",
"unicorn/throw-new-error": "error"
},
"overrides": [
{
"files": [
"demo/*.js"
],
"env": {
"browser": true
},
"rules": {
"jsdoc/require-jsdoc": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-add-event-listener": "off",
"no-console": "off",
"no-shadow": "off",
"no-var": "off"
}
},
{
"files": [
"example/*.js"
],
"rules": {
"node/no-missing-require": "off",
"node/no-extraneous-require": "off",
"no-console": "off",
"no-invalid-this": "off",
"no-shadow": "off",
"object-property-newline": "off"
"settings": {
"jsdoc": {
"preferredTypes": {
"object": "Object"
}
}
]
}
}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
- name: Install Dependencies
run: npm install --no-package-lock
- name: Run All Validations
if: ${{ matrix.node-version != '10.x' && matrix.node-version != '12.x' }}
if: ${{ matrix.node-version != '12.x' }}
run: npm run ci
- name: Run Tests Only
if: ${{ matrix.node-version == '10.x' || matrix.node-version == '12.x' }}
if: ${{ matrix.node-version == '12.x' }}
run: npm run test
2 changes: 1 addition & 1 deletion .github/workflows/test-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [12.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v2
Expand Down
16 changes: 13 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Try to break the new code now, or else it will get broken later.

Run tests before sending a pull request via `npm test` in the [usual manner](https://docs.npmjs.com/misc/scripts).
Tests should all pass on all platforms.
The test runner is [tape](https://www.npmjs.com/package/tape) and test cases are located in `test/markdownlint-test*.js`.
The test runner is [AVA](https://github.com/avajs/ava) and test cases are located in `test/markdownlint-test*.js`.
When running tests, `test/*.md` files are enumerated, linted, and fail if any violations are missing a corresponding `{MD###}` marker in the test file.
For example, the line `### Heading {MD001}` is expected to trigger the rule `MD001`.
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.
Expand All @@ -33,7 +33,8 @@ Lint before sending a pull request by running `npm run lint`.
There should be no issues.

Run a full continuous integration pass before sending a pull request via `npm run ci`.
Code coverage should remain at 100%.
Code coverage should always be 100%.
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.

Pull requests should contain a single commit.
If necessary, squash multiple commits before creating the pull request and when making changes.
Expand All @@ -43,9 +44,18 @@ Open pull requests against the `next` branch.
That's where the latest changes are staged for the next release.
Include the text "(fixes #??)" at the end of the commit message so the pull request will be associated with the relevant issue.
End commit messages with a period (`.`).
Do not include `package-lock.json` in the pull request.
Once accepted, the tag `fixed in next` will be added to the issue.
When the commit is merged to the main branch during the release process, the issue will be closed automatically.
(See [Closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/) for details.)

Please refrain from using slang or meaningless placeholder words.
Sample content can be "text", "code", "heading", or the like.
Sample URLs should use [example.com](https://en.wikipedia.org/wiki/Example.com) which is safe for this purpose.
Profanity is not allowed.

In order to maintain the permissive MIT license this project uses, all contributions must be your own and released under that license.
Code you add should be an original work and should not be copied from elsewhere.
Taking code from a different project, Stack Overflow, or the like is not allowed.
The use of tools such as GitHub Copilot that generate code from other projects is not allowed.

Thank you!
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ and test cases came directly from that project.
### Related

* CLI
* [markdownlint-cli command-line interface for Node.js](https://github.com/igorshubovych/markdownlint-cli)
* [markdownlint-cli2 command-line interface for Node.js](https://github.com/DavidAnson/markdownlint-cli2)
* [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli)
command-line interface for Node.js ([works with pre-commit](https://github.com/igorshubovych/markdownlint-cli#use-with-pre-commit))
* [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2)
command-line interface for Node.js ([works with pre-commit](https://github.com/DavidAnson/markdownlint-cli2#pre-commit))
* GitHub
* [GitHub Super-Linter Action](https://github.com/github/super-linter)
* [GitHub Actions problem matcher for markdownlint-cli](https://github.com/xt0rted/markdownlint-problem-matcher)
Expand Down Expand Up @@ -102,6 +104,8 @@ playground for learning and exploring.
* **[MD046](doc/Rules.md#md046)** *code-block-style* - Code block style
* **[MD047](doc/Rules.md#md047)** *single-trailing-newline* - Files should end with a single newline character
* **[MD048](doc/Rules.md#md048)** *code-fence-style* - Code fence style
* **[MD049](doc/Rules.md#md049)** *emphasis-style* - Emphasis style should be consistent
* **[MD050](doc/Rules.md#md050)** *strong-style* - Strong style should be consistent

<!-- markdownlint-restore -->

Expand All @@ -125,7 +129,7 @@ rules at once.
* **blockquote** - MD027, MD028
* **bullet** - MD004, MD005, MD006, MD007, MD032
* **code** - MD014, MD031, MD038, MD040, MD046, MD048
* **emphasis** - MD036, MD037
* **emphasis** - MD036, MD037, MD049, MD050
* **hard_tab** - MD010
* **headers** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022,
MD023, MD024, MD025, MD026, MD036, MD041, MD043
Expand Down Expand Up @@ -163,10 +167,12 @@ appear in the final markup):

* Disable all rules: `<!-- markdownlint-disable -->`
* Enable all rules: `<!-- markdownlint-enable -->`
* Disable all rules for the next line only: `<!-- markdownlint-disable-next-line -->`
* Disable all rules for the next line only:
`<!-- markdownlint-disable-next-line -->`
* Disable one or more rules by name: `<!-- markdownlint-disable MD001 MD005 -->`
* Enable one or more rules by name: `<!-- markdownlint-enable MD001 MD005 -->`
* Disable one or more rules by name for the next line only: `<!-- markdownlint-disable-next-line MD001 MD005 -->`
* Disable one or more rules by name for the next line only:
`<!-- markdownlint-disable-next-line MD001 MD005 -->`
* Capture the current rule configuration: `<!-- markdownlint-capture -->`
* Restore the captured rule configuration: `<!-- markdownlint-restore -->`

Expand Down Expand Up @@ -229,7 +235,7 @@ more rules for a file, the following more advanced syntax is supported:
For example:

```markdown
<!-- markdownlint-configure-file { "MD013": { "line_length": 70 } } -->
<!-- markdownlint-configure-file { "MD013": { "code_blocks": false } } -->
```

or
Expand Down Expand Up @@ -859,7 +865,7 @@ const results = window.markdownlint.sync(options).toString();
## Examples

For ideas how to integrate `markdownlint` into your workflow, refer to the
following projects or one of the tools in the [Related section](#Related):
following projects or one of the tools in the [Related section](#related):

* [.NET Documentation](https://docs.microsoft.com/en-us/dotnet/) ([Search repository](https://github.com/dotnet/docs/search?q=markdownlint))
* [ally.js](https://allyjs.io/) ([Search repository](https://github.com/medialize/ally.js/search?q=markdownlint))
Expand All @@ -870,6 +876,7 @@ following projects or one of the tools in the [Related section](#Related):
* [MDN Web Docs](https://developer.mozilla.org/) ([Search repository](https://github.com/mdn/content/search?q=markdownlint))
* [MkDocs](https://www.mkdocs.org/) ([Search repository](https://github.com/mkdocs/mkdocs/search?q=markdownlint))
* [Mocha](https://mochajs.org/) ([Search repository](https://github.com/mochajs/mocha/search?q=markdownlint))
* [Pi-hole documentation](https://docs.pi-hole.net) ([Search repository](https://github.com/pi-hole/docs/search?q=markdownlint))
* [Reactable](https://glittershark.github.io/reactable/) ([Search repository](https://github.com/glittershark/reactable/search?q=markdownlint))
* [Sinon.JS](https://sinonjs.org/) ([Search repository](https://github.com/sinonjs/sinon/search?q=markdownlint))
* [TestCafe](https://devexpress.github.io/testcafe/) ([Search repository](https://github.com/DevExpress/testcafe/search?q=markdownlint))
Expand Down Expand Up @@ -968,6 +975,9 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
* 0.24.0 - Remove support for end-of-life Node version 10, add support for custom file system
module, improve MD010/MD011/MD037/MD043/MD044, improve TypeScript declaration file
and JSON schema, update dependencies.
* 0.25.0 - Add MD049/MD050 for consistent emphasis/strong style (both auto-fixable), improve
MD007/MD010/MD032/MD033/MD035/MD037/MD039, support asynchronous custom rules,
improve performance, improve CI process, reduce dependencies, update dependencies.

[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
[npm-url]: https://www.npmjs.com/package/markdownlint
Expand Down

0 comments on commit 02707cf

Please sign in to comment.