Skip to content

Commit 99b6282

Browse files
committed
chore(eslint-plugin-next): Adapt tests to updated rule output
1 parent dc3e25c commit 99b6282

16 files changed

+38
-38
lines changed

test/unit/eslint-plugin-next/google-font-display.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ ruleTester.run('google-font-display', rule, {
7676
errors: [
7777
{
7878
message:
79-
'Display parameter is missing. See https://nextjs.org/docs/messages/google-font-display.',
79+
'Display parameter is missing. See: https://nextjs.org/docs/messages/google-font-display',
8080
type: 'JSXOpeningElement',
8181
},
8282
],
@@ -98,7 +98,7 @@ ruleTester.run('google-font-display', rule, {
9898
errors: [
9999
{
100100
message:
101-
'Block behavior is not recommended. See https://nextjs.org/docs/messages/google-font-display.',
101+
'Block behavior is not recommended. See: https://nextjs.org/docs/messages/google-font-display',
102102
type: 'JSXOpeningElement',
103103
},
104104
],
@@ -120,7 +120,7 @@ ruleTester.run('google-font-display', rule, {
120120
errors: [
121121
{
122122
message:
123-
'Auto behavior is not recommended. See https://nextjs.org/docs/messages/google-font-display.',
123+
'Auto behavior is not recommended. See: https://nextjs.org/docs/messages/google-font-display',
124124
type: 'JSXOpeningElement',
125125
},
126126
],
@@ -142,7 +142,7 @@ ruleTester.run('google-font-display', rule, {
142142
errors: [
143143
{
144144
message:
145-
'Fallback behavior is not recommended. See https://nextjs.org/docs/messages/google-font-display.',
145+
'Fallback behavior is not recommended. See: https://nextjs.org/docs/messages/google-font-display',
146146
type: 'JSXOpeningElement',
147147
},
148148
],

test/unit/eslint-plugin-next/google-font-preconnect.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ ruleTester.run('google-font-preconnect', rule, {
4242
errors: [
4343
{
4444
message:
45-
'Preconnect is missing. See https://nextjs.org/docs/messages/google-font-preconnect.',
45+
'Preconnect is missing. See: https://nextjs.org/docs/messages/google-font-preconnect',
4646
type: 'JSXOpeningElement',
4747
},
4848
],
@@ -58,7 +58,7 @@ ruleTester.run('google-font-preconnect', rule, {
5858
errors: [
5959
{
6060
message:
61-
'Preconnect is missing. See https://nextjs.org/docs/messages/google-font-preconnect.',
61+
'Preconnect is missing. See: https://nextjs.org/docs/messages/google-font-preconnect',
6262
type: 'JSXOpeningElement',
6363
},
6464
],

test/unit/eslint-plugin-next/link-passhref.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ruleTester.run('link-passhref', rule, {
5252
errors: [
5353
{
5454
message:
55-
'passHref is missing. See https://nextjs.org/docs/messages/link-passhref',
55+
'passHref is missing. See: https://nextjs.org/docs/messages/link-passhref',
5656
type: 'JSXOpeningElement',
5757
},
5858
],
@@ -69,7 +69,7 @@ ruleTester.run('link-passhref', rule, {
6969
errors: [
7070
{
7171
message:
72-
'passHref must be set to true. See https://nextjs.org/docs/messages/link-passhref',
72+
'passHref must be set to true. See: https://nextjs.org/docs/messages/link-passhref',
7373
type: 'JSXOpeningElement',
7474
},
7575
],

test/unit/eslint-plugin-next/next-script-for-ga.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { RuleTester } from 'eslint'
1212
})
1313

1414
const ERROR_MSG =
15-
'Use the `next/script` component for loading third party scripts. See: https://nextjs.org/docs/messages/next-script-for-ga.'
15+
'Use the `next/script` component for loading third party scripts. See: https://nextjs.org/docs/messages/next-script-for-ga'
1616

1717
const ruleTester = new RuleTester()
1818

test/unit/eslint-plugin-next/no-css-tags.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ ruleTester.run('no-css-tags', rule, {
8181
errors: [
8282
{
8383
message:
84-
'Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags.',
84+
'Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags',
8585
type: 'JSXOpeningElement',
8686
},
8787
],
@@ -94,7 +94,7 @@ ruleTester.run('no-css-tags', rule, {
9494
errors: [
9595
{
9696
message:
97-
'Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags.',
97+
'Do not include stylesheets manually. See: https://nextjs.org/docs/messages/no-css-tags',
9898
type: 'JSXOpeningElement',
9999
},
100100
],

test/unit/eslint-plugin-next/no-document-import-in-page.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ruleTester.run('no-document-import-in-page', rule, {
125125
errors: [
126126
{
127127
message:
128-
'next/document should not be imported outside of pages/_document.js. See https://nextjs.org/docs/messages/no-document-import-in-page.',
128+
'next/document should not be imported outside of pages/_document.js. See: https://nextjs.org/docs/messages/no-document-import-in-page',
129129
type: 'ImportDeclaration',
130130
},
131131
],
@@ -139,7 +139,7 @@ ruleTester.run('no-document-import-in-page', rule, {
139139
errors: [
140140
{
141141
message:
142-
'next/document should not be imported outside of pages/_document.js. See https://nextjs.org/docs/messages/no-document-import-in-page.',
142+
'next/document should not be imported outside of pages/_document.js. See: https://nextjs.org/docs/messages/no-document-import-in-page',
143143
type: 'ImportDeclaration',
144144
},
145145
],
@@ -153,7 +153,7 @@ ruleTester.run('no-document-import-in-page', rule, {
153153
errors: [
154154
{
155155
message:
156-
'next/document should not be imported outside of pages/_document.js. See https://nextjs.org/docs/messages/no-document-import-in-page.',
156+
'next/document should not be imported outside of pages/_document.js. See: https://nextjs.org/docs/messages/no-document-import-in-page',
157157
type: 'ImportDeclaration',
158158
},
159159
],

test/unit/eslint-plugin-next/no-head-import-in-document.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ruleTester.run('no-head-import-in-document', rule, {
7777
errors: [
7878
{
7979
message:
80-
'next/head should not be imported in pages/_document.js. Import Head from next/document instead. See https://nextjs.org/docs/messages/no-head-import-in-document.',
80+
'next/head should not be imported in pages/_document.js. Import Head from next/document instead. See: https://nextjs.org/docs/messages/no-head-import-in-document',
8181
type: 'ImportDeclaration',
8282
},
8383
],
@@ -107,7 +107,7 @@ ruleTester.run('no-head-import-in-document', rule, {
107107
errors: [
108108
{
109109
message:
110-
'next/head should not be imported in pages/_document.page.tsx. Import Head from next/document instead. See https://nextjs.org/docs/messages/no-head-import-in-document.',
110+
'next/head should not be imported in pages/_document.page.tsx. Import Head from next/document instead. See: https://nextjs.org/docs/messages/no-head-import-in-document',
111111
type: 'ImportDeclaration',
112112
},
113113
],
@@ -137,7 +137,7 @@ ruleTester.run('no-head-import-in-document', rule, {
137137
errors: [
138138
{
139139
message:
140-
'next/head should not be imported in pages/_document/index.js. Import Head from next/document instead. See https://nextjs.org/docs/messages/no-head-import-in-document.',
140+
'next/head should not be imported in pages/_document/index.js. Import Head from next/document instead. See: https://nextjs.org/docs/messages/no-head-import-in-document',
141141
type: 'ImportDeclaration',
142142
},
143143
],
@@ -167,7 +167,7 @@ ruleTester.run('no-head-import-in-document', rule, {
167167
errors: [
168168
{
169169
message:
170-
'next/head should not be imported in pages/_document/index.tsx. Import Head from next/document instead. See https://nextjs.org/docs/messages/no-head-import-in-document.',
170+
'next/head should not be imported in pages/_document/index.tsx. Import Head from next/document instead. See: https://nextjs.org/docs/messages/no-head-import-in-document',
171171
type: 'ImportDeclaration',
172172
},
173173
],

test/unit/eslint-plugin-next/no-html-link-for-pages.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ describe('no-html-link-for-pages', function () {
246246
assert.notEqual(report, undefined, 'No lint errors found.')
247247
assert.equal(
248248
report.message,
249-
"Do not use the HTML <a> tag to navigate to /. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages."
249+
"Do not use the HTML <a> tag to navigate to /. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages"
250250
)
251251
})
252252

@@ -257,7 +257,7 @@ describe('no-html-link-for-pages', function () {
257257
assert.notEqual(report, undefined, 'No lint errors found.')
258258
assert.equal(
259259
report.message,
260-
"Do not use the HTML <a> tag to navigate to /list/foo/bar/. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages."
260+
"Do not use the HTML <a> tag to navigate to /list/foo/bar/. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages"
261261
)
262262
const [secondReport] = linter.verify(
263263
secondInvalidDynamicCode,
@@ -269,15 +269,15 @@ describe('no-html-link-for-pages', function () {
269269
assert.notEqual(secondReport, undefined, 'No lint errors found.')
270270
assert.equal(
271271
secondReport.message,
272-
"Do not use the HTML <a> tag to navigate to /list/foo/. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages."
272+
"Do not use the HTML <a> tag to navigate to /list/foo/. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages"
273273
)
274274
const [thirdReport] = linter.verify(thirdInvalidDynamicCode, linterConfig, {
275275
filename: 'foo.js',
276276
})
277277
assert.notEqual(thirdReport, undefined, 'No lint errors found.')
278278
assert.equal(
279279
thirdReport.message,
280-
"Do not use the HTML <a> tag to navigate to /list/lorem-ipsum/. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages."
280+
"Do not use the HTML <a> tag to navigate to /list/lorem-ipsum/. Use Link from 'next/link' instead. See: https://nextjs.org/docs/messages/no-html-link-for-pages"
281281
)
282282
})
283283
})

test/unit/eslint-plugin-next/no-img-element.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ ruleTester.run('no-img-element', rule, {
5151
errors: [
5252
{
5353
message:
54-
"Do not use <img>. Use Image from 'next/image' instead. See https://nextjs.org/docs/messages/no-img-element.",
54+
"Do not use <img>. Use Image from 'next/image' instead. See: https://nextjs.org/docs/messages/no-img-element",
5555
type: 'JSXOpeningElement',
5656
},
5757
],

test/unit/eslint-plugin-next/no-page-custom-font.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ruleTester.run('no-page-custom-font', rule, {
148148
errors: [
149149
{
150150
message:
151-
'Custom fonts not added at the document level will only load for a single page. This is discouraged. See https://nextjs.org/docs/messages/no-page-custom-font.',
151+
'Custom fonts not added at the document level will only load for a single page. This is discouraged. See: https://nextjs.org/docs/messages/no-page-custom-font',
152152
type: 'JSXOpeningElement',
153153
},
154154
],
@@ -188,11 +188,11 @@ ruleTester.run('no-page-custom-font', rule, {
188188
errors: [
189189
{
190190
message:
191-
'Rendering this <link /> not inline within <Head> of Document disables font optimization. This is discouraged. See https://nextjs.org/docs/messages/no-page-custom-font.',
191+
'Rendering this <link /> not inline within <Head> of Document disables font optimization. This is discouraged. See: https://nextjs.org/docs/messages/no-page-custom-font',
192192
},
193193
{
194194
message:
195-
'Rendering this <link /> not inline within <Head> of Document disables font optimization. This is discouraged. See https://nextjs.org/docs/messages/no-page-custom-font.',
195+
'Rendering this <link /> not inline within <Head> of Document disables font optimization. This is discouraged. See: https://nextjs.org/docs/messages/no-page-custom-font',
196196
},
197197
],
198198
},

0 commit comments

Comments
 (0)