Skip to content

Commit

Permalink
Remove references to ESM/.mjs because VS Code only supports it during…
Browse files Browse the repository at this point in the history
… development (refs #248).
  • Loading branch information
DavidAnson committed Aug 27, 2022
1 parent 4305c0c commit 888fc7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes

* 0.48.0 - New rules, module support, better linting in browser
* 0.48.0 - New rules, better linting in browser
* 0.47.0 - Miscellaneous improvements
* 0.46.0 - New rules, document formatting, better path handling
* 0.45.0 - Add linting for workspace
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ The default rule configuration disables [`MD013`/`line-length`](https://github.c

> **Note**: `MD002`/`first-heading-h1` and `MD006`/`ul-start-left` are also disabled because they have been deprecated in the `markdownlint` library.
Rules can be enabled, disabled, and customized by creating a [JSON](https://en.wikipedia.org/wiki/JSON) file named `.markdownlint.jsonc`/`.markdownlint.json` or a [YAML](https://en.wikipedia.org/wiki/YAML) file named `.markdownlint.yaml`/`.markdownlint.yml` or a [JavaScript](https://en.wikipedia.org/wiki/JavaScript) file named `.markdownlint.cjs`/`.markdownlint.mjs` in any directory of a project.
Additionally, options (which include rules and things like [`markdown-it` plugins](https://www.npmjs.com/search?q=keywords:markdown-it-plugin) and other settings) can be configured by creating a JSON file named `.markdownlint-cli2.jsonc` or a YAML file named `.markdownlint-cli2.yaml` or a JavaScript file named `.markdownlint-cli2.cjs`/`.markdownlint-cli2.mjs` in any directory of a project. For more information about configuration file precedence and complete examples, see the [Configuration section of the markdownlint-cli2 README.md](https://github.com/DavidAnson/markdownlint-cli2#configuration).
Rules can be enabled, disabled, and customized by creating a [JSON](https://en.wikipedia.org/wiki/JSON) file named `.markdownlint.jsonc`/`.markdownlint.json` or a [YAML](https://en.wikipedia.org/wiki/YAML) file named `.markdownlint.yaml`/`.markdownlint.yml` or a [JavaScript](https://en.wikipedia.org/wiki/JavaScript) file named `.markdownlint.cjs` in any directory of a project.
Additionally, options (which include rules and things like [`markdown-it` plugins](https://www.npmjs.com/search?q=keywords:markdown-it-plugin) and other settings) can be configured by creating a JSON file named `.markdownlint-cli2.jsonc` or a YAML file named `.markdownlint-cli2.yaml` or a JavaScript file named `.markdownlint-cli2.cjs` in any directory of a project. For more information about configuration file precedence and complete examples, see the [Configuration section of the markdownlint-cli2 README.md](https://github.com/DavidAnson/markdownlint-cli2#configuration).

> **Note**: When no folder is open, configuration and options are loaded from the user's home directory (e.g., `%USERPROFILE%` on Windows or `$HOME` on macOS/Linux).
> Because JavaScript code is cached after being loaded, edits to `.markdownlint.cjs`, `.markdownlint.mjs`, `.markdownlint-cli2.cjs`, and `.markdownlint-cli2.mjs` require a restart of VS Code.
> Because JavaScript code is cached after being loaded, edits to `.markdownlint.cjs` and `.markdownlint-cli2.cjs` require a restart of VS Code.
A custom configuration is often defined by a `.markdownlint.json` file in the root of the project:

Expand Down Expand Up @@ -383,7 +383,7 @@ The following snippets are available when editing a Markdown document (press `Ct

## Security

Running JavaScript from custom rules, `markdown-it` plugins, or configuration files (such as `.markdownlint.cjs`, `.markdownlint.mjs`, `.markdownlint-cli2.cjs`, and `.markdownlint-cli2.mjs`) could be a security risk, so VS Code's [Workspace Trust setting](https://code.visualstudio.com/docs/editor/workspace-trust) is honored to block JavaScript for untrusted workspaces.
Running JavaScript from custom rules, `markdown-it` plugins, or configuration files (such as `.markdownlint.cjs` and `.markdownlint-cli2.cjs`) could be a security risk, so VS Code's [Workspace Trust setting](https://code.visualstudio.com/docs/editor/workspace-trust) is honored to block JavaScript for untrusted workspaces.

## History

Expand Down
7 changes: 3 additions & 4 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ const {promisify} = require("node:util");

// Constants
const extensionDisplayName = "markdownlint";
const configFileGlob = ".markdownlint.{jsonc,json,yaml,yml,cjs,mjs}";
const optionsFileGlob = ".markdownlint-cli2.{jsonc,yaml,cjs,mjs}";
const configFileGlob = ".markdownlint.{jsonc,json,yaml,yml,cjs}";
const optionsFileGlob = ".markdownlint-cli2.{jsonc,yaml,cjs}";
const markdownlintJson = ".markdownlint.json";
const configFileNames = [
".markdownlint.jsonc",
markdownlintJson,
".markdownlint.yaml",
".markdownlint.yml",
".markdownlint.cjs",
".markdownlint.mjs"
".markdownlint.cjs"
];
const ignoreFileName = ".markdownlintignore";
const markdownLanguageId = "markdown";
Expand Down

0 comments on commit 888fc7a

Please sign in to comment.