Skip to content

Commit d936661

Browse files
committed
refactor: code improvements
1 parent edb22df commit d936661

File tree

5 files changed

+53
-54
lines changed

5 files changed

+53
-54
lines changed

eslint.config.mjs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import tsPlugin from '@typescript-eslint/eslint-plugin'
66
import globals from 'globals'
77

88
export default [
9-
// Ignore patterns (Flat Config ersetzt .eslintignore)
109
{
1110
ignores: [
1211
'.next/**',
@@ -19,22 +18,19 @@ export default [
1918
],
2019
},
2120

22-
// JavaScript/TypeScript Standardempfehlungen
2321
js.configs.recommended,
2422

25-
// Next.js Core Web Vitals Regeln (teilweise entschärft für Migration)
2623
{
2724
name: 'next/core-web-vitals',
2825
plugins: {
2926
'@next/next': nextPlugin,
3027
},
3128
rules: {
3229
...nextPlugin.configs['core-web-vitals'].rules,
33-
'@next/next/no-html-link-for-pages': 'off',
30+
'@next/next/no-html-link-for-pages': 'error',
3431
},
3532
},
3633

37-
// TypeScript Setup + empfohlene Regeln
3834
{
3935
files: ['**/*.{ts,tsx}'],
4036
languageOptions: {
@@ -54,13 +50,9 @@ export default [
5450
},
5551
rules: {
5652
...tsPlugin.configs.recommended.rules,
57-
// TS übernimmt Undef-Prüfung
5853
'no-undef': 'off',
59-
// Migrationserleichterung
6054
'no-useless-escape': 'warn',
61-
// Verbot von triple-slash references (außer next-env.d.ts, die ignoriert wird)
6255
'@typescript-eslint/triple-slash-reference': ['error', { types: 'never', lib: 'never', path: 'never' }],
63-
// Häufige kleine Verstöße sanfter behandeln
6456
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', ignoreRestSiblings: true, caughtErrors: 'none' }],
6557
'@typescript-eslint/no-explicit-any': 'warn',
6658
},

src/app/documentation/page.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import PageLayout from '@/components/PageLayout'
22
import { generatePageMetadata } from '@/components/PageLayout'
3+
import Link from 'next/link'
4+
import { Metadata } from 'next';
35

4-
export const metadata = generatePageMetadata(
6+
export const metadata: Metadata = generatePageMetadata(
57
'Documentation',
68
'Documentation for phpMyFAQ administrator, end-users and developers.'
79
)
@@ -26,37 +28,37 @@ export default function DocumentationPage() {
2628
<li>
2729
<h3>
2830
<i className="fa fa-caret-right"></i>{' '}
29-
<a target="_blank" href="/docs/4.1">Documentation for phpMyFAQ 4.1</a>
31+
<Link target="_blank" href="/docs/4.1">Documentation for phpMyFAQ 4.1</Link>
3032
</h3>
3133
This guide contains detailed documentation for those using phpMyFAQ 4.1, whether they be
3234
administrators or end-users.
3335
</li>
3436
<li>
3537
<h3>
3638
<i className="fa fa-caret-right"></i>{' '}
37-
<a target="_blank" href="/docs/4.0">Documentation for phpMyFAQ 4.0</a>
39+
<Link target="_blank" href="/docs/4.0">Documentation for phpMyFAQ 4.0</Link>
3840
</h3>
3941
This guide contains detailed documentation for those using phpMyFAQ 4.0, whether they be
4042
administrators or end-users.
4143
</li>
4244
<li>
4345
<h3>
4446
<i className="fa fa-caret-right"></i>{' '}
45-
<a href="/requirements">Requirements</a>
47+
<Link href="/requirements">Requirements</Link>
4648
</h3>
4749
All requirements like e.g. the minimum PHP version to install the latest version of phpMyFAQ
4850
</li>
4951
<li>
5052
<h3>
5153
<i className="fa fa-caret-right"></i>{' '}
52-
<a href="/changelog">Changelog</a>
54+
<Link href="/changelog">Changelog</Link>
5355
</h3>
5456
The list of user-visible changes of phpMyFAQ releases since 2001.
5557
</li>
5658
<li>
5759
<h3>
5860
<i className="fa fa-caret-right"></i>{' '}
59-
<a href="/translations">Translations</a>
61+
<Link href="/translations">Translations</Link>
6062
</h3>
6163
The list of supported languages in phpMyFAQ and a guide how to fix existing or add new
6264
translations.
@@ -69,7 +71,7 @@ export default function DocumentationPage() {
6971
<li>
7072
<h3>
7173
<i className="fa fa-caret-right"></i>{' '}
72-
<a href="/docs/standards">Coding standards</a>
74+
<Link href="/docs/standards">Coding standards</Link>
7375
</h3>
7476
Coding styles for PHP code, HTML, and LESS/CSS. Please take care you follow these coding
7577
standards.
@@ -101,7 +103,7 @@ export default function DocumentationPage() {
101103
<li>
102104
<h3>
103105
<i className="fa fa-caret-right"></i>{' '}
104-
<a href="/docs/codenames">Codenames</a>
106+
<Link href="/docs/codenames">Codenames</Link>
105107
</h3>
106108
phpMyFAQ uses codenames for every major release, if you&apos;re curious about them, take a look
107109
at this page.
@@ -112,7 +114,7 @@ export default function DocumentationPage() {
112114
<h2>Outdated documentations</h2>
113115
<p className="outro">
114116
Looking for an old version of documentation?
115-
We have an overview of <a href="/docs/">old, unmaintained versions</a> online.
117+
We have an overview of <Link href="/docs/">old, unmaintained versions</Link> online.
116118
</p>
117119
</PageLayout>
118120
)

src/app/news/page.tsx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import PageLayout from '@/components/PageLayout'
22
import { generatePageMetadata } from '@/components/PageLayout'
3+
import Link from 'next/link'
34

45
export const metadata = generatePageMetadata(
56
'News archive',
@@ -14,47 +15,47 @@ export default function NewsPage() {
1415
<ul className="list-unstyled">
1516
<li className="mb-4">
1617
<h2>
17-
<a href="/news/2025">2025</a>
18+
<Link href="/news/2025">2025</Link>
1819
</h2>
1920
<h3 className="text-muted">
2021
Working hard on phpMyFAQ 4.1, getting all ready for PHP 8.5
2122
</h3>
2223
</li>
2324
<li className="mb-4">
2425
<h2>
25-
<a href="/news/2024">2024</a>
26+
<Link href="/news/2024">2024</Link>
2627
</h2>
2728
<h3 className="text-muted">
2829
Finally, releasing phpMyFAQ 4.0, getting all ready for PHP 8.4, started working on phpMyFAQ 4.1
2930
</h3>
3031
</li>
3132
<li className="mb-4">
3233
<h2>
33-
<a href="/news/2023">2023</a>
34+
<Link href="/news/2023">2023</Link>
3435
</h2>
3536
<h3 className="text-muted">
3637
Finally, releasing phpMyFAQ 3.2, getting all ready for PHP 8.3, started working on phpMyFAQ 4.0
3738
</h3>
3839
</li>
3940
<li className="mb-4">
4041
<h2>
41-
<a href="/news/2022">2022</a>
42+
<Link href="/news/2022">2022</Link>
4243
</h2>
4344
<h3 className="text-muted">
4445
Finally, releasing phpMyFAQ 3.1, getting all ready for PHP 8.2, working hard on phpMyFAQ 3.2
4546
</h3>
4647
</li>
4748
<li className="mb-4">
4849
<h2>
49-
<a href="/news/2021">2021</a>
50+
<Link href="/news/2021">2021</Link>
5051
</h2>
5152
<h3 className="text-muted">
5253
Still struggling with the Corona pandemic, getting all ready for PHP 8.1, working hard on phpMyFAQ 3.1
5354
</h3>
5455
</li>
5556
<li className="mb-4">
5657
<h2>
57-
<a href="/news/2020">2020</a>
58+
<Link href="/news/2020">2020</Link>
5859
</h2>
5960
<h3 className="text-muted">
6061
Finally releasing phpMyFAQ 3.0, struggling with the Corona pandemic, getting all ready for PHP 8.0 and working
@@ -63,123 +64,123 @@ export default function NewsPage() {
6364
</li>
6465
<li className="mb-4">
6566
<h2>
66-
<a href="/news/2019">2019</a>
67+
<Link href="/news/2019">2019</Link>
6768
</h2>
6869
<h3 className="text-muted">
6970
Working hard on phpMyFAQ 3.0 and dropped support for PHP 5.
7071
</h3>
7172
</li>
7273
<li className="mb-4">
7374
<h2>
74-
<a href="/news/2018">2018</a>
75+
<Link href="/news/2018">2018</Link>
7576
</h2>
7677
<h3 className="text-muted">
7778
Finally, added PHP namespaces and Docker support for the upcoming phpMyFAQ 3.0 milestone
7879
</h3>
7980
</li>
8081
<li className="mb-4">
8182
<h2>
82-
<a href="/news/2017">2017</a>
83+
<Link href="/news/2017">2017</Link>
8384
</h2>
8485
<h3 className="text-muted">
8586
Improving the 2.9 version and working hard on phpMyFAQ 3.0
8687
</h3>
8788
</li>
8889
<li className="mb-4">
8990
<h2>
90-
<a href="/news/2016">2016</a>
91+
<Link href="/news/2016">2016</Link>
9192
</h2>
9293
<h3 className="text-muted">
9394
Celebrated 15 years of phpMyFAQ and released phpMyFAQ 2.9
9495
</h3>
9596
</li>
9697
<li className="mb-4">
9798
<h2>
98-
<a href="/news/2015">2015</a>
99+
<Link href="/news/2015">2015</Link>
99100
</h2>
100101
<h3 className="text-muted">Working on 2.8 and 2.9, getting everything ready for PHP 7 and HHVM</h3>
101102
</li>
102103
<li className="mb-4">
103104
<h2>
104-
<a href="/news/2014">2014</a>
105+
<Link href="/news/2014">2014</Link>
105106
</h2>
106107
<h3 className="text-muted">Improving the 2.8 version and working hard on phpMyFAQ 2.9</h3>
107108
</li>
108109
<li className="mb-4">
109110
<h2>
110-
<a href="/news/2013">2013</a>
111+
<Link href="/news/2013">2013</Link>
111112
</h2>
112113
<h3 className="text-muted">Using PHP 5.3 and Bootstrap for phpMyFAQ 2.8</h3>
113114
</li>
114115
<li className="mb-4">
115116
<h2>
116-
<a href="/news/2012">2012</a>
117+
<Link href="/news/2012">2012</Link>
117118
</h2>
118119
<h3 className="text-muted">Improving the 2.7 version and working on phpMyFAQ 2.8</h3>
119120
</li>
120121
<li className="mb-4">
121122
<h2>
122-
<a href="/news/2011">2011</a>
123+
<Link href="/news/2011">2011</Link>
123124
</h2>
124125
<h3 className="text-muted">Celebrated 10 years of phpMyFAQ, worked on better usability and HTML5 support with phpMyFAQ 2.7</h3>
125126
</li>
126127
<li className="mb-4">
127128
<h2>
128-
<a href="/news/2010">2010</a>
129+
<Link href="/news/2010">2010</Link>
129130
</h2>
130131
<h3 className="text-muted">Everything&apos;s UTF-8 encoded now with phpMyFAQ 2.6</h3>
131132
</li>
132133
<li className="mb-4">
133134
<h2>
134-
<a href="/news/2009">2009</a>
135+
<Link href="/news/2009">2009</Link>
135136
</h2>
136137
<h3 className="text-muted">Using PHP 5.2 with phpMyFAQ 2.5</h3>
137138
</li>
138139
<li className="mb-4">
139140
<h2>
140-
<a href="/news/2008">2008</a>
141+
<Link href="/news/2008">2008</Link>
141142
</h2>
142143
<h3 className="text-muted">Improving the 2.0 version and working on phpMyFAQ 2.5</h3>
143144
</li>
144145
<li className="mb-4">
145146
<h2>
146-
<a href="/news/2007">2007</a>
147+
<Link href="/news/2007">2007</Link>
147148
</h2>
148149
<h3 className="text-muted">Better user management and permissions with phpMyFAQ 2.0</h3>
149150
</li>
150151
<li className="mb-4">
151152
<h2>
152-
<a href="/news/2006">2006</a>
153+
<Link href="/news/2006">2006</Link>
153154
</h2>
154155
<h3 className="text-muted">Revisions and better spam protection with phpMyFAQ 1.6</h3>
155156
</li>
156157
<li className="mb-4">
157158
<h2>
158-
<a href="/news/2005">2005</a>
159+
<Link href="/news/2005">2005</Link>
159160
</h2>
160161
<h3 className="text-muted">Support for PHP 5, PostgreSQL, MS SQL and SEO optimized URLs with 1.5</h3>
161162
</li>
162163
<li className="mb-4">
163164
<h2>
164-
<a href="/news/2004">2004</a>
165+
<Link href="/news/2004">2004</Link>
165166
</h2>
166167
<h3 className="text-muted">Now with a WYSIWYG editor and XHTML support with phpMyFAQ 1.4</h3>
167168
</li>
168169
<li className="mb-4">
169170
<h2>
170-
<a href="/news/2003">2003</a>
171+
<Link href="/news/2003">2003</Link>
171172
</h2>
172173
<h3 className="text-muted">Adding simple multi-language and PDF support in phpMyFAQ 1.3</h3>
173174
</li>
174175
<li className="mb-4">
175176
<h2>
176-
<a href="/news/2002">2002</a>
177+
<Link href="/news/2002">2002</Link>
177178
</h2>
178179
<h3 className="text-muted">New features and PHP 4 support with phpMyFAQ 1.1 and going open source with phpMyFAQ 1.2</h3>
179180
</li>
180181
<li className="mb-4">
181182
<h2>
182-
<a href="/news/2001">2001</a>
183+
<Link href="/news/2001">2001</Link>
183184
</h2>
184185
<h3 className="text-muted">The PHP3 beginnings with phpMyFAQ 0.x and the final 1.0 release</h3>
185186
</li>

src/app/support/page.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { generatePageMetadata } from '@/components/PageLayout'
21
import styles from './support.module.scss'
2+
import { generatePageMetadata } from '@/components/PageLayout'
3+
import Link from 'next/link'
4+
import { Metadata } from 'next';
35

4-
export const metadata = generatePageMetadata(
6+
export const metadata: Metadata = generatePageMetadata(
57
'Support',
68
'Get support for phpMyFAQ through our community, documentation, and professional services'
79
)
@@ -73,15 +75,15 @@ export default function SupportPage() {
7375
<p>Comprehensive guides and resources to help you master phpMyFAQ.</p>
7476
<ul>
7577
<li>
76-
<a href="/documentation" rel="noopener noreferrer">
78+
<Link href="/documentation" rel="noopener noreferrer">
7779
User Documentation
78-
</a>
80+
</Link>
7981
<span className={"ms-2"}> Complete guides</span>
8082
</li>
8183
<li>
82-
<a href="/docs/standards" rel="noopener noreferrer">
84+
<Link href="/docs/standards" rel="noopener noreferrer">
8385
Developer Docs
84-
</a>
86+
</Link>
8587
<span className={"ms-2"}> Coding standards</span>
8688
</li>
8789
<li>
@@ -99,19 +101,19 @@ export default function SupportPage() {
99101
<div className={styles.resourceGrid}>
100102
<div className={styles.resourceItem}>
101103
<div className={styles.resourceIcon}>📖</div>
102-
<a href="/changelog">Changelog</a>
104+
<Link href="/changelog">Changelog</Link>
103105
</div>
104106
<div className={styles.resourceItem}>
105107
<div className={styles.resourceIcon}>🔒</div>
106-
<a href="/security">Security Advisories</a>
108+
<Link href="/security">Security Advisories</Link>
107109
</div>
108110
<div className={styles.resourceItem}>
109111
<div className={styles.resourceIcon}>🌍</div>
110-
<a href="/translations">Translations</a>
112+
<Link href="/translations">Translations</Link>
111113
</div>
112114
<div className={styles.resourceItem}>
113115
<div className={styles.resourceIcon}>⚙️</div>
114-
<a href="/requirements">Requirements</a>
116+
<Link href="/requirements">Requirements</Link>
115117
</div>
116118
</div>
117119
</div>

0 commit comments

Comments
 (0)