Skip to content

Commit ad7a77e

Browse files
authored
Move to lowecaser postcss (#133)
1 parent 4c94ca8 commit ad7a77e

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for [CSS Modules](https://github.com/css-modules/css-modules).
2020
- [`classnameTransform`](#classnametransform)
2121
- [`customRenderer`](#customrenderer)
2222
- [`customTemplate`](#customtemplate)
23-
- [`postCssOptions`](#postcssoptions)
23+
- [`postcssOptions`](#postcssoptions)
2424
- [`rendererOptions`](#rendereroptions)
2525
- [Visual Studio Code](#visual-studio-code)
2626
- [Recommended usage](#recommended-usage)
@@ -105,7 +105,7 @@ Please note that no options are required. However, depending on your configurati
105105
| `customTemplate` | `false` | See [`customTemplate`](#customTemplate) below. |
106106
| `namedExports` | `true` | Enables named exports for compatible classnames. |
107107
| `dotenvOptions` | `{}` | Provides options for [`dotenv`](https://github.com/motdotla/dotenv#options). |
108-
| `postCssOptions` | `{}` | See [`postCssOptions`](#postCssOptions) below. |
108+
| `postcssOptions` | `{}` | See [`postcssOptions`](#postcssOptions) below. |
109109
| `rendererOptions` | `{}` | See [`rendererOptions`](#rendererOptions) below. |
110110

111111
```json
@@ -119,7 +119,7 @@ Please note that no options are required. However, depending on your configurati
119119
"customMatcher": "\\.m\\.css$",
120120
"customRenderer": "./myRenderer.js",
121121
"dotenvOptions": {},
122-
"postCssOptions": {},
122+
"postcssOptions": {},
123123
"rendererOptions": {}
124124
}
125125
}
@@ -192,7 +192,7 @@ The [internal `logger`](https://github.com/mrmckeb/typescript-plugin-css-modules
192192

193193
The `classes` object represents all the classnames extracted from the CSS Module. They are available if you want to add a custom representation of the CSS classes.
194194

195-
#### `postCssOptions`
195+
#### `postcssOptions`
196196

197197
| Option | Default value | Description |
198198
| ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------- |

src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,15 @@ function init({ typescript: ts }: { typescript: typeof tsModule }) {
6060
}
6161

6262
// Add postCSS config if enabled.
63-
const postCssOptions = options.postCssOptions || {};
63+
const postcssOptions =
64+
options.postcssOptions || options.postCssOptions || {};
6465

6566
let userPlugins: AcceptedPlugin[] = [];
66-
if (postCssOptions.useConfig) {
67+
if (postcssOptions.useConfig) {
6768
const postcssConfig = getPostCssConfigPlugins(directory);
6869
userPlugins = [
6970
filter({
70-
exclude: postCssOptions.excludePlugins,
71+
exclude: postcssOptions.excludePlugins,
7172
silent: true,
7273
}),
7374
...postcssConfig,

src/options.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Logger } from './helpers/logger';
88
// NOTE: Stylus doesn't directly export RenderOptions.
99
type StylusRenderOptions = Parameters<typeof stylus>[1];
1010

11-
export interface PostCssOptions {
11+
export interface PostcssOptions {
1212
excludePlugins?: string[];
1313
useConfig?: boolean;
1414
}
@@ -26,7 +26,9 @@ export interface Options {
2626
customTemplate?: string;
2727
dotenvOptions?: DotenvConfigOptions;
2828
namedExports?: boolean;
29-
postCssOptions?: PostCssOptions;
29+
postcssOptions?: PostcssOptions;
30+
/** @deprecated To align with other projects. */
31+
postCssOptions?: PostcssOptions;
3032
rendererOptions?: RendererOptions;
3133
}
3234

0 commit comments

Comments
 (0)