@@ -54,10 +54,6 @@ describe('utils', () => {
54
54
'export default foo.bar(123);' ,
55
55
'export default foo.bar()(123);' ,
56
56
57
- // Correct TypeScript helper structure but missing parameterized types:
58
- 'export default createESLintRule({ create() {}, meta: {} });' ,
59
- 'export default util.createRule({ create() {}, meta: {} });' ,
60
- 'export default ESLintUtils.RuleCreator(docsUrl)({ create() {}, meta: {} });' ,
61
57
] . forEach ( noRuleCase => {
62
58
it ( `returns null for ${ noRuleCase } ` , ( ) => {
63
59
const ast = espree . parse ( noRuleCase , { ecmaVersion : 8 , range : true , sourceType : 'module' } ) ;
@@ -75,13 +71,6 @@ describe('utils', () => {
75
71
'export default foo<Options, MessageIds>(123);' ,
76
72
'export default foo.bar<Options, MessageIds>(123);' ,
77
73
'export default foo.bar()<Options, MessageIds>(123);' ,
78
-
79
- // Correct TypeScript helper structure but missing parameterized types:
80
- 'export default createESLintRule({ create() {}, meta: {} });' ,
81
- 'export default createESLintRule<>({ create() {}, meta: {} });' ,
82
- 'export default createESLintRule<OnlyOneType>({ create() {}, meta: {} });' ,
83
- 'export default util.createRule({ create() {}, meta: {} });' ,
84
- 'export default ESLintUtils.RuleCreator(docsUrl)({ create() {}, meta: {} });' ,
85
74
] . forEach ( noRuleCase => {
86
75
it ( `returns null for ${ noRuleCase } ` , ( ) => {
87
76
const ast = typescriptEslintParser . parse ( noRuleCase , { ecmaVersion : 8 , range : true , sourceType : 'module' } ) ;
@@ -112,18 +101,40 @@ describe('utils', () => {
112
101
meta : { type : 'ObjectExpression' } ,
113
102
isNewStyle : true ,
114
103
} ,
104
+ 'export default createESLintRule<>({ create() {}, meta: {} });' : {
105
+ create : { type : 'FunctionExpression' } ,
106
+ meta : { type : 'ObjectExpression' } ,
107
+ isNewStyle : true ,
108
+ } ,
109
+ 'export default createESLintRule({ create() {}, meta: {} });' : {
110
+ create : { type : 'FunctionExpression' } ,
111
+ meta : { type : 'ObjectExpression' } ,
112
+ isNewStyle : true ,
113
+ } ,
114
+
115
115
// Util function from util object
116
116
'export default util.createRule<Options, MessageIds>({ create() {}, meta: {} });' : {
117
117
create : { type : 'FunctionExpression' } ,
118
118
meta : { type : 'ObjectExpression' } ,
119
119
isNewStyle : true ,
120
120
} ,
121
+ 'export default util.createRule({ create() {}, meta: {} });' : {
122
+ create : { type : 'FunctionExpression' } ,
123
+ meta : { type : 'ObjectExpression' } ,
124
+ isNewStyle : true ,
125
+ } ,
126
+
121
127
// Util function from util object with additional doc URL argument
122
128
'export default ESLintUtils.RuleCreator(docsUrl)<Options, MessageIds>({ create() {}, meta: {} });' : {
123
129
create : { type : 'FunctionExpression' } ,
124
130
meta : { type : 'ObjectExpression' } ,
125
131
isNewStyle : true ,
126
132
} ,
133
+ 'export default ESLintUtils.RuleCreator(docsUrl)({ create() {}, meta: {} });' : {
134
+ create : { type : 'FunctionExpression' } ,
135
+ meta : { type : 'ObjectExpression' } ,
136
+ isNewStyle : true ,
137
+ } ,
127
138
} ;
128
139
129
140
Object . keys ( CASES ) . forEach ( ruleSource => {
0 commit comments