[Docs] Add config types to all examples (#40083)

<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Summary

- Added jsdoc typing for all examples using `next.config.js`
- Added jsdoc typing for all examples using `tailwind.config.js`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
This commit is contained in:
Henrik Wenz 2022-08-31 23:41:22 +02:00 committed by GitHub
parent e7e567b1fc
commit 92aafcbcf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 71 additions and 5 deletions

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
async rewrites() {
return [

View file

@ -1,8 +1,8 @@
/** @type {import('next').NextConfig} */
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
})
/** @type {import('next').NextConfig} */
const nextConfig = {
// any configs you need
}

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./components/**/*.tsx', './pages/**/*.tsx'],
theme: {

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
mode: 'jit',
purge: ['./pages/**/*.js', './components/**/*.js'],

View file

@ -1,10 +1,10 @@
/** @type {import('next').NextConfig} */
const withNextra = require('nextra')({
theme: 'nextra-theme-blog',
themeConfig: './theme.config.js',
// optional: add `unstable_staticImage: true` to enable Nextra's auto image import
})
/** @type {import('next').NextConfig} */
const nextConfig = {
// any configs you need
}

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['cdn.builder.io'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./components/**/*.js', './pages/**/*.js'],
theme: {

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
async rewrites() {

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
loader: 'custom',

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['imgix.cosmicjs.com'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['www.datocms-assets.com'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: [process.env.NEXT_IMAGE_DOMAIN],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['static.ghost.org'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['media.graphcms.com'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['b-cdn.net'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['images.prismic.io'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
images: {

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['localhost'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./components/**/*.js', './pages/**/*.js'],
theme: {

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['media.umbraco.io'],

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -5,6 +5,7 @@ if (!process.env.WORDPRESS_API_URL) {
`)
}
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: [

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
basePath: '/gh-pages-test',
}

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
async headers() {
return [

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
i18n: {
locales: ['en', 'fr', 'nl'],

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
images: {
domains: ['assets.vercel.com'],

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
modularizeImports: {

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
reactRemoveProperties: true,

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
// Uncomment the line below to enable basePath, pages and
// redirects will then have a path prefix (`/app` in this case)

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
experimental: {
removeConsole: {

View file

@ -1,6 +1,4 @@
/** @type {import("next").NextConfig} */
const config = {
module.exports = {
reactStrictMode: true,
}
module.exports = config

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
async rewrites() {
return [

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (config) => {
config.module.rules.push({

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'standalone',
}

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
output: 'standalone',
}

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
distDir: '../.next',
}

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
/* this needs to be set to false until a bug in the compression npm module gets fixed.
reference: https://github.com/expressjs/compression/issues/122

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
i18n: {
locales: ['en', 'de'],

View file

@ -1,5 +1,7 @@
const path = require('path')
const CopyPlugin = require('copy-webpack-plugin')
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (config) => {
config.plugins.push(

View file

@ -1,5 +1,6 @@
const { locales, sourceLocale } = require('./lingui.config.js')
/** @type {import('next').NextConfig} */
module.exports = {
i18n: {
locales,

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
}

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./pages/**/*.{js,ts,jsx,tsx}',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (configuration) => {
configuration.module.rules.push({

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (config) => {
config.resolve.alias = {

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
mode: 'jit',
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: (config, { isServer }) => {
if (isServer) {

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
}

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack: function (config) {
config.externals = config.externals || {}

View file

@ -1,5 +1,6 @@
const colors = require('tailwindcss/colors')
/** @type {import('tailwindcss').Config} */
module.exports = {
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
darkMode: 'class',

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack(config, options) {
config.module.rules.push({

View file

@ -1,3 +1,4 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
mode: 'jit',
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
webpack(config) {
config.output.webassemblyModuleFilename = 'static/wasm/[modulehash].wasm'

View file

@ -1,5 +1,6 @@
const path = require('path')
/** @type {import('next').NextConfig} */
module.exports = {
webpack(config, { dev, isServer }) {
if (dev && !isServer) {

View file

@ -1,3 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
basePath: '/blog',
}

View file

@ -1,5 +1,6 @@
const { BLOG_URL } = process.env
/** @type {import('next').NextConfig} */
module.exports = {
async rewrites() {
return [