From a10e24b2052047d431b6a44b0a202f605c39bc96 Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Sun, 13 Mar 2022 06:09:16 +0800 Subject: [PATCH] feat(nodejs): check for `.mts` and `.cts` files (#3734) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(nodejs): check for `.mts` and `.cts` files * Hmm * Tests * Update docs * Update table * Align * Remove tests * 🤷 * 🤷🤷 --- docs/config/README.md | 24 ++++++++++++------------ src/configs/nodejs.rs | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/config/README.md b/docs/config/README.md index 2cdf24b4..7a5617de 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -2289,21 +2289,21 @@ By default the module will be shown if any of the following conditions are met: - The current directory contains a `.nvmrc` file - The current directory contains a `node_modules` directory - The current directory contains a file with the `.js`, `.mjs` or `.cjs` extension -- The current directory contains a file with the `.ts` extension +- The current directory contains a file with the `.ts`, `.mts` or `.cts` extension ### Options -| Option | Default | Description | -| ------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------- | -| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | -| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `" "` | A format string representing the symbol of Node.js. | -| `detect_extensions` | `["js", "mjs", "cjs", "ts"]` | Which extensions should trigger this module. | -| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. | -| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. | -| `style` | `"bold green"` | The style for the module. | -| `disabled` | `false` | Disables the `nodejs` module. | -| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. | +| Option | Default | Description | +| ------------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------------- | +| `format` | `"via [$symbol($version )]($style)"` | The format for the module. | +| `version_format` | `"v${raw}"` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `" "` | A format string representing the symbol of Node.js. | +| `detect_extensions` | `["js", "mjs", "cjs", "ts", "mts", "cts"]` | Which extensions should trigger this module. | +| `detect_files` | `["package.json", ".node-version"]` | Which filenames should trigger this module. | +| `detect_folders` | `["node_modules"]` | Which folders should trigger this module. | +| `style` | `"bold green"` | The style for the module. | +| `disabled` | `false` | Disables the `nodejs` module. | +| `not_capable_style` | `bold red` | The style for the module when an engines property in package.json does not match the Node.js version. | ### Variables diff --git a/src/configs/nodejs.rs b/src/configs/nodejs.rs index 6d4a5911..a026a459 100644 --- a/src/configs/nodejs.rs +++ b/src/configs/nodejs.rs @@ -25,7 +25,7 @@ impl<'a> Default for NodejsConfig<'a> { style: "bold green", disabled: false, not_capable_style: "bold red", - detect_extensions: vec!["js", "mjs", "cjs", "ts"], + detect_extensions: vec!["js", "mjs", "cjs", "ts", "mts", "cts"], detect_files: vec!["package.json", ".node-version", ".nvmrc"], detect_folders: vec!["node_modules"], }