Skip to content

Commit

Permalink
migrate to next.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky committed Nov 23, 2024
1 parent a647855 commit 8800a38
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 10 additions & 3 deletions next.config.js → next.config.ts
Original file line number Diff line number Diff line change
@@ -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 [
Expand All @@ -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/**',
Expand All @@ -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
Expand Down Expand Up @@ -74,3 +78,6 @@ module.exports = {
},
},
}

// eslint-disable-next-line import/no-default-export
export default nextConfig

0 comments on commit 8800a38

Please sign in to comment.