From 8800a383e83aaf936362bca4acfa427c4fccaf07 Mon Sep 17 00:00:00 2001 From: rtrembecky Date: Sat, 23 Nov 2024 15:14:28 +0100 Subject: [PATCH] migrate to next.config.ts --- .eslintrc.js | 1 + next.config.js => next.config.ts | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) rename next.config.js => next.config.ts (83%) diff --git a/.eslintrc.js b/.eslintrc.js index e80c3e0b..51dfe5c2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -76,6 +76,7 @@ module.exports = { '@typescript-eslint/ban-ts-comment': 'warn', '@typescript-eslint/no-unused-vars': ['warn', {argsIgnorePattern: '^_', ignoreRestSiblings: true}], + '@typescript-eslint/no-explicit-any': 'warn', // Use === instead of == for everything, except for comparison with null and other special // cases. diff --git a/next.config.js b/next.config.ts similarity index 83% rename from next.config.js rename to next.config.ts index 132a2924..99613e6e 100644 --- a/next.config.js +++ b/next.config.ts @@ -1,5 +1,6 @@ -/** @type import('next').NextConfig */ -module.exports = { +import type {NextConfig} from 'next' + +const nextConfig: NextConfig = { // docs: https://nextjs.org/docs/api-reference/next.config.js/redirects async redirects() { return [ @@ -24,7 +25,10 @@ module.exports = { images: { remotePatterns: [ { + // TODO: neviem, preco to krici, treba overit, ci funguju obrazky pri ulohach + // @ts-ignore protocol: process.env.NEXT_PUBLIC_BE_PROTOCOL, + // @ts-ignore hostname: process.env.NEXT_PUBLIC_BE_HOSTNAME, port: process.env.NEXT_PUBLIC_BE_PORT, pathname: '/media/**', @@ -40,7 +44,7 @@ module.exports = { // https://react-svgr.com/docs/next/ webpack(config) { // Grab the existing rule that handles SVG imports - const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg')) + const fileLoaderRule = config.module.rules.find((rule: any) => rule.test?.test?.('.svg')) config.module.rules.push( // Reapply the existing rule, but only for svg imports ending in ?url @@ -74,3 +78,6 @@ module.exports = { }, }, } + +// eslint-disable-next-line import/no-default-export +export default nextConfig