Skip to content

Commit 8606a13

Browse files
authored
no-keyword-prefix: Add some test (#1023)
1 parent 0520f31 commit 8606a13

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/no-keyword-prefix.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {outdent} from 'outdent';
12
import {test} from './utils/test.js';
23

34
const errorNew = {
@@ -85,6 +86,23 @@ test({
8586
{
8687
code: 'const newFoo = "foo"',
8788
options: [{blacklist: ['old']}]
89+
},
90+
outdent`
91+
function Foo() {
92+
console.log(new.target, new.target.name);
93+
}
94+
`,
95+
outdent`
96+
class Foo {
97+
constructor() {
98+
console.log(new.target, new.target.name);
99+
}
100+
}
101+
`,
102+
'const foo = {new: 1};',
103+
{
104+
code: 'var foo = {new: 1}',
105+
options: [{checkProperties: false}]
88106
}
89107
],
90108
invalid: [

0 commit comments

Comments
 (0)