From 54976dbbd9b8cc28afb0c65cd1b85dad0b992def Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Mon, 27 Mar 2023 18:47:09 +0200 Subject: [PATCH 1/2] Add JSDoc type for config --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 061e57c8f..b7653db4d 100644 --- a/README.md +++ b/README.md @@ -241,12 +241,15 @@ module.exports = { Then create `postcss.config.js`: ```js -module.exports = { +/** @type {import('postcss-load-config').Config} */ +const config = { plugins: [ require('autoprefixer'), require('postcss-nested') ] } + +module.exports = config ``` [`astroturf`]: https://github.com/4Catalyzer/astroturf From 8f237bf3d96718bef367135aff17e53c2234ab1d Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Mon, 27 Mar 2023 18:58:25 +0200 Subject: [PATCH 2/2] Add JSDoc types to other examples --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b7653db4d..f1851871f 100644 --- a/README.md +++ b/README.md @@ -262,12 +262,15 @@ and cssnano. If you want to change plugins, create `postcss.config.js` in project’s root: ```js -module.exports = { +/** @type {import('postcss-load-config').Config} */ +const config = { plugins: [ require('autoprefixer'), require('postcss-nested') ] } + +module.exports = config ``` Parcel will even automatically install these plugins for you. @@ -311,12 +314,15 @@ module.exports = { Then create `postcss.config.js`: ```js -module.exports = { +/** @type {import('postcss-load-config').Config} */ +const config = { plugins: [ require('autoprefixer'), require('postcss-nested') ] } + +module.exports = config ``` [`postcss-loader`]: https://github.com/postcss/postcss-loader