Skip to content

Commit

Permalink
chore: add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonjuan committed Feb 18, 2024
1 parent a0e750c commit 5e109a1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/eslint-plugin/tests/rules/no-use-before-define.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,18 @@ const obj = {
`,
options: [{ ignoreTypeReferences: false }],
},
{
code: `
const foo = {
bar: 'bar',
} satisfies {
bar: typeof baz;
};
const baz = '';
`,
options: [{ ignoreTypeReferences: true }],
},
],
invalid: [
{
Expand Down Expand Up @@ -1138,6 +1150,25 @@ const Foo = {
},
],
},
{
code: `
const foo = {
bar: 'bar',
} satisfies {
bar: typeof baz;
};
const baz = '';
`,
options: [{ ignoreTypeReferences: false }],
errors: [
{
messageId: 'noUseBeforeDefine',
data: { name: 'baz' },
type: AST_NODE_TYPES.Identifier,
},
],
},

// "variables" option
{
Expand Down

0 comments on commit 5e109a1

Please sign in to comment.