Skip to content

Commit c2e94de

Browse files
authored
Merge pull request #1824 from karlhorky/patch-1
Add JSDoc type for config
2 parents 0de0e1e + 8f237bf commit c2e94de

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,15 @@ module.exports = {
241241
Then create `postcss.config.js`:
242242

243243
```js
244-
module.exports = {
244+
/** @type {import('postcss-load-config').Config} */
245+
const config = {
245246
plugins: [
246247
require('autoprefixer'),
247248
require('postcss-nested')
248249
]
249250
}
251+
252+
module.exports = config
250253
```
251254

252255
[`astroturf`]: https://github.com/4Catalyzer/astroturf
@@ -259,12 +262,15 @@ and cssnano. If you want to change plugins, create `postcss.config.js`
259262
in project’s root:
260263

261264
```js
262-
module.exports = {
265+
/** @type {import('postcss-load-config').Config} */
266+
const config = {
263267
plugins: [
264268
require('autoprefixer'),
265269
require('postcss-nested')
266270
]
267271
}
272+
273+
module.exports = config
268274
```
269275

270276
Parcel will even automatically install these plugins for you.
@@ -308,12 +314,15 @@ module.exports = {
308314
Then create `postcss.config.js`:
309315

310316
```js
311-
module.exports = {
317+
/** @type {import('postcss-load-config').Config} */
318+
const config = {
312319
plugins: [
313320
require('autoprefixer'),
314321
require('postcss-nested')
315322
]
316323
}
324+
325+
module.exports = config
317326
```
318327

319328
[`postcss-loader`]: https://github.com/postcss/postcss-loader

0 commit comments

Comments
 (0)