import { RuleTester } from 'eslint'
import { describe, it } from 'vitest'
import noCrossZoneLink from './no-cross-zone-link.cjs'
RuleTester.describe = describe
RuleTester.it = it
const ruleTester = new RuleTester({
languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
})
ruleTester.run('no-cross-zone-link', noCrossZoneLink, {
valid: [
'import Link from \'next/link\'; ',
'import Link from \'next/link\'; ',
"import Link from 'next/link'; ",
'',
'import Link from \'somewhere-else\'; ',
'import Link from \'next/link\'; ',
'import Link from \'next/link\'; ',
],
invalid: [
{
code: 'import Link from \'next/link\'; ',
errors: [{ messageId: 'crossZone' }],
},
{
code: 'import Link from \'next/link\'; ',
errors: [{ messageId: 'crossZone' }],
},
{
code: "import Link from 'next/link'; ",
errors: [{ messageId: 'crossZone' }],
},
{
code: 'import NextLink from \'next/link\'; ',
errors: [{ messageId: 'crossZone' }],
},
{
code: 'import Link from \'next/link\'; ',
errors: [{ messageId: 'crossZone' }],
},
{
code: 'import Link from \'next/link\'; ',
errors: [{ messageId: 'crossZone' }],
},
],
})