From 5fd45f7e3f8e31b43d182844f57d0d1ae9fe0ea3 Mon Sep 17 00:00:00 2001 From: Brody McKee Date: Sun, 11 Feb 2024 18:44:03 +1100 Subject: [PATCH] docs: update README regexp Closes #237 --- README.md | 28 ++++++++++++++-------------- src/helpers/cssExtensions.ts | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9ee3c38..f6cdff1 100644 --- a/README.md +++ b/README.md @@ -97,20 +97,20 @@ const b = styles['my_other-class']; Please note that no options are required. However, depending on your configuration, you may need to customise these options. -| Option | Default value | Description | -| -------------------------- | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -| `additionalData` | `undefined` | An optional string to append to the top of source files. | -| `allowUnknownClassnames` | `false` | Disables TypeScript warnings on unknown classnames (for default imports only). | -| `classnameTransform` | `"asIs"` | See [`classnameTransform`](#classnameTransform) below. | -| `customMatcher` | `"\\.module\\.(c\|le\|sa\|sc)ss$"` | Changes the file extensions that this plugin processes. | -| `customRenderer` | `false` | See [`customRenderer`](#customRenderer) below. | -| `customTemplate` | `false` | See [`customTemplate`](#customTemplate) below. | -| `goToDefinition` | `false` | Enables jump to definition. See [`goToDefinition`](#goToDefinition) below. | -| `noUncheckedIndexedAccess` | `false` | Enable for compatibility with TypeScript's `noUncheckedIndexedAccess`. | -| `namedExports` | `true` | Enables named exports for compatible classnames. | -| `dotenvOptions` | `{}` | Provides options for [`dotenv`](https://github.com/motdotla/dotenv#options). Note that this plugin only accepts a `string` value for `path`. | -| `postcssOptions` | `{}` | See [`postcssOptions`](#postcssOptions) below. | -| `rendererOptions` | `{}` | See [`rendererOptions`](#rendererOptions) below. | +| Option | Default value | Description | +| -------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `additionalData` | `undefined` | An optional string to append to the top of source files. | +| `allowUnknownClassnames` | `false` | Disables TypeScript warnings on unknown classnames (for default imports only). | +| `classnameTransform` | `"asIs"` | See [`classnameTransform`](#classnameTransform) below. | +| `customMatcher` | `"\\.module\\.((c\|le\|sa\|sc)ss\|styl)$"` | Changes the file extensions that this plugin processes. | +| `customRenderer` | `false` | See [`customRenderer`](#customRenderer) below. | +| `customTemplate` | `false` | See [`customTemplate`](#customTemplate) below. | +| `goToDefinition` | `false` | Enables jump to definition. See [`goToDefinition`](#goToDefinition) below. | +| `noUncheckedIndexedAccess` | `false` | Enable for compatibility with TypeScript's `noUncheckedIndexedAccess`. | +| `namedExports` | `true` | Enables named exports for compatible classnames. | +| `dotenvOptions` | `{}` | Provides options for [`dotenv`](https://github.com/motdotla/dotenv#options). Note that this plugin only accepts a `string` value for `path`. | +| `postcssOptions` | `{}` | See [`postcssOptions`](#postcssOptions) below. | +| `rendererOptions` | `{}` | See [`rendererOptions`](#rendererOptions) below. | ```json { diff --git a/src/helpers/cssExtensions.ts b/src/helpers/cssExtensions.ts index c832352..92fa166 100644 --- a/src/helpers/cssExtensions.ts +++ b/src/helpers/cssExtensions.ts @@ -1,7 +1,7 @@ export type isCSSFn = (fileName: string) => boolean; export type isRelativeCSSFn = (fileName: string) => boolean; -const DEFAULT_REGEXP = /\.module\.(((c|le|sa|sc)ss)|styl)$/; +const DEFAULT_REGEXP = /\.module\.((c|le|sa|sc)ss|styl)$/; const isRelative = (fileName: string) => /^\.\.?($|[\\/])/.test(fileName);