Skip to content

Commit

Permalink
Merge branch 'next'
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAnson committed Aug 23, 2021
2 parents dce5dd5 + e79e818 commit a852407
Show file tree
Hide file tree
Showing 73 changed files with 4,422 additions and 2,006 deletions.
51 changes: 50 additions & 1 deletion .eslintrc.json
Expand Up @@ -39,7 +39,7 @@
"max-depth": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-params": ["error", 10],
"max-params": ["off"],
"max-statements": "off",
"multiline-comment-style": ["error", "separate-lines"],
"multiline-ternary": "off",
Expand Down Expand Up @@ -70,15 +70,47 @@
"vars-on-top": "off",
"wrap-regex": "off",

"jsdoc/check-access": "error",
"jsdoc/check-alignment": "error",
"jsdoc/check-examples": "error",
"jsdoc/check-indentation": "error",
"jsdoc/check-line-alignment": "error",
"jsdoc/check-param-names": "error",
"jsdoc/check-property-names": "error",
"jsdoc/check-syntax": "error",
"jsdoc/check-tag-names": "error",
"jsdoc/check-types": "error",
"jsdoc/check-values": "error",
"jsdoc/empty-tags": "error",
"jsdoc/implements-on-classes": "error",
"jsdoc/match-description": "error",
"jsdoc/multiline-blocks": "error",
"jsdoc/newline-after-description": "error",
"jsdoc/no-bad-blocks": "error",
"jsdoc/no-defaults": "error",
"jsdoc/no-multi-asterisks": "error",
"jsdoc/no-undefined-types": "error",
"jsdoc/require-asterisk-prefix": "error",
"jsdoc/require-description": "error",
"jsdoc/require-description-complete-sentence": "error",
"jsdoc/require-jsdoc": "error",
"jsdoc/require-param": "error",
"jsdoc/require-param-description": "error",
"jsdoc/require-param-name": "error",
"jsdoc/require-param-type": "error",
"jsdoc/require-property": "error",
"jsdoc/require-property-description": "error",
"jsdoc/require-property-name": "error",
"jsdoc/require-property-type": "error",
"jsdoc/require-returns": "error",
"jsdoc/require-returns-check": "error",
"jsdoc/require-returns-description": "error",
"jsdoc/require-returns-type": "error",
"jsdoc/require-throws": "error",
"jsdoc/require-yields": "error",
"jsdoc/require-yields-check": "error",
"jsdoc/tag-lines": "error",
"jsdoc/valid-types": "error",

"node/handle-callback-err": "error",
"node/no-callback-literal": "error",
Expand Down Expand Up @@ -139,9 +171,11 @@
"unicorn/no-abusive-eslint-disable": "error",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-method-this-argument": "error",
"unicorn/no-array-push-push": "error",
"unicorn/no-array-reduce": "error",
"unicorn/no-console-spaces": "error",
"unicorn/no-document-cookie": "error",
"unicorn/no-for-loop": "error",
"unicorn/no-hex-escape": "error",
"unicorn/no-instanceof-array": "error",
Expand All @@ -153,19 +187,24 @@
"unicorn/no-null": "off",
"unicorn/no-object-as-default-parameter": "error",
"unicorn/no-process-exit": "error",
"unicorn/no-static-only-class": "error",
"unicorn/no-this-assignment": "error",
"unicorn/no-unreadable-array-destructuring": "error",
"unicorn/no-unsafe-regex": "off",
"unicorn/no-unused-properties": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-undefined": "error",
"unicorn/no-zero-fractions": "error",
"unicorn/number-literal-case": "error",
"unicorn/numeric-separators-style": "error",
"unicorn/prefer-add-event-listener": "error",
"unicorn/prefer-array-find": "error",
"unicorn/prefer-array-flat": "error",
"unicorn/prefer-array-flat-map": "error",
"unicorn/prefer-array-index-of": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-at": "off",
"unicorn/prefer-date-now": "error",
"unicorn/prefer-default-parameters": "error",
"unicorn/prefer-dom-node-append": "error",
Expand All @@ -176,9 +215,14 @@
"unicorn/prefer-keyboard-event-key": "error",
"unicorn/prefer-math-trunc": "error",
"unicorn/prefer-modern-dom-apis": "error",
"unicorn/prefer-module": "off",
"unicorn/prefer-negative-index": "error",
"unicorn/prefer-node-protocol": "error",
"unicorn/prefer-number-properties": "error",
"unicorn/prefer-object-from-entries": "error",
"unicorn/prefer-object-has-own": "error",
"unicorn/prefer-optional-catch-binding": "error",
"unicorn/prefer-prototype-methods": "error",
"unicorn/prefer-query-selector": "error",
"unicorn/prefer-reflect-apply": "error",
"unicorn/prefer-regexp-test": "error",
Expand All @@ -188,9 +232,14 @@
"unicorn/prefer-string-slice": "off",
"unicorn/prefer-string-starts-ends-with": "error",
"unicorn/prefer-string-trim-start-end": "error",
"unicorn/prefer-switch": "off",
"unicorn/prefer-ternary": "error",
"unicorn/prefer-top-level-await": "error",
"unicorn/prefer-type-error": "error",
"unicorn/prevent-abbreviations": "off",
"unicorn/require-array-join-separator": "error",
"unicorn/require-number-to-fixed-digits-argument": "error",
"unicorn/require-post-message-target-origin": "error",
"unicorn/string-content": "error",
"unicorn/throw-new-error": "error"
},
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -16,12 +16,12 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/codeql-analysis.yml
Expand Up @@ -20,11 +20,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2

- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-repos.yml
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
Expand Down
45 changes: 35 additions & 10 deletions README.md
Expand Up @@ -3,7 +3,6 @@
> A Node.js style checker and lint tool for Markdown/CommonMark files.
[![npm version][npm-image]][npm-url]
[![CI Status][ci-image]][ci-url]
[![License][license-image]][license-url]

## Install
Expand Down Expand Up @@ -295,7 +294,8 @@ function markdownlint(options) { ... }

Type: `Object`

Configures the function.
Configures the function. All properties are optional, but at least one
of `files` or `strings` should be set to provide input.

##### options.customRules

Expand Down Expand Up @@ -535,6 +535,16 @@ Each item in the top-level `Array` should be of the form:
[ require("markdown-it-plugin"), plugin_param_0, plugin_param_1, ... ]
```

##### options.fs

Type: `Object` implementing the [file system API](https://nodejs.org/api/fs.html)

In advanced scenarios, it may be desirable to bypass the default file system API.
If a custom file system implementation is provided, `markdownlint` will use that
instead of invoking `require("fs")`.

Note: The only methods called are `readFile` and `readFileSync`.

#### callback

Type: `Function` taking (`Error`, `Object`)
Expand Down Expand Up @@ -567,10 +577,11 @@ Asynchronous API:
*
* @param {string} file Configuration file name.
* @param {ConfigurationParser[] | ReadConfigCallback} parsers Parsing function(s).
* @param {Object} [fs] File system implementation.
* @param {ReadConfigCallback} [callback] Callback (err, result) function.
* @returns {void}
*/
function readConfig(file, parsers, callback) { ... }
function readConfig(file, parsers, fs, callback) { ... }
```

Synchronous API:
Expand All @@ -581,23 +592,25 @@ Synchronous API:
*
* @param {string} file Configuration file name.
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
* @param {Object} [fs] File system implementation.
* @returns {Configuration} Configuration object.
*/
function readConfigSync(file, parsers) { ... }
function readConfigSync(file, parsers, fs) { ... }
```

Promise API (in the `promises` namespace like Node.js's
[`fs` Promises API](https://nodejs.org/api/fs.html#fs_fs_promises_api)):
[`fs` Promises API](https://nodejs.org/api/fs.html#fs_promises_api)):

```js
/**
* Read specified configuration file.
*
* @param {string} file Configuration file name.
* @param {ConfigurationParser[]} [parsers] Parsing function(s).
* @param {Object} [fs] File system implementation.
* @returns {Promise<Configuration>} Configuration object.
*/
function readConfig(file, parsers) { ... }
function readConfig(file, parsers, fs) { ... }
```

#### file
Expand Down Expand Up @@ -628,6 +641,16 @@ For example:
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
```

#### fs

Type: *Optional* `Object` implementing the [file system API](https://nodejs.org/api/fs.html)

In advanced scenarios, it may be desirable to bypass the default file system API.
If a custom file system implementation is provided, `markdownlint` will use that
instead of invoking `require("fs")`.

Note: The only methods called are `readFile`, `readFileSync`, `access`, and `accessSync`.

#### callback

Type: `Function` taking (`Error`, `Object`)
Expand Down Expand Up @@ -835,20 +858,21 @@ const results = window.markdownlint.sync(options).toString();

## Examples

For ideas how to integrate `markdownlint` into your workflow, refer to the following projects:
For ideas how to integrate `markdownlint` into your workflow, refer to the
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))
* [Boostnote](https://boostnote.io/) ([Search repository](https://github.com/BoostIO/Boostnote/search?q=markdownlint))
* [CodiMD](https://github.com/hackmdio/codimd) ([Search repository](https://github.com/hackmdio/codimd/search?q=markdownlint))
* [ESLint](https://eslint.org/) ([Search repository](https://github.com/eslint/eslint/search?q=markdownlint))
* [Garden React Components](https://zendeskgarden.github.io/react-components/) ([Search repository](https://github.com/zendeskgarden/react-components/search?q=markdownlint))
* [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))
* [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))
* [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html) ([Search repository](https://github.com/Microsoft/TypeScript-Handbook/search?q=markdownlint))
* [V8](https://v8.dev/) ([Search repository](https://github.com/v8/v8.dev/search?q=markdownlint))
* [webhint](https://webhint.io/) ([Search repository](https://github.com/webhintio/hint/search?q=markdownlint))
* [webpack](https://webpack.js.org/) ([Search repository](https://github.com/webpack/webpack.js.org/search?q=markdownlint))
Expand Down Expand Up @@ -941,10 +965,11 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
information for MD004/ul-style, improve MD018/MD019/MD020/MD021/MD037/MD041, improve
HTML comment handling, update test runner and test suite, update dependencies.
* 0.23.1 - Work around lack of webpack support for dynamic calls to `require` (`.resolve`).
* 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.

[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
[npm-url]: https://www.npmjs.com/package/markdownlint
[ci-image]: https://github.com/DavidAnson/markdownlint/workflows/CI/badge.svg?branch=main
[ci-url]: https://github.com/DavidAnson/markdownlint/actions?query=branch%3Amain
[license-image]: https://img.shields.io/npm/l/markdownlint.svg
[license-url]: https://opensource.org/licenses/MIT

0 comments on commit a852407

Please sign in to comment.