@@ -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,35 @@ 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
+
115
110
// Util function from util object
116
111
'export default util.createRule<Options, MessageIds>({ create() {}, meta: {} });' : {
117
112
create : { type : 'FunctionExpression' } ,
118
113
meta : { type : 'ObjectExpression' } ,
119
114
isNewStyle : true ,
120
115
} ,
116
+ 'export default util.createRule({ create() {}, meta: {} });' : {
117
+ create : { type : 'FunctionExpression' } ,
118
+ meta : { type : 'ObjectExpression' } ,
119
+ isNewStyle : true ,
120
+ } ,
121
+
121
122
// Util function from util object with additional doc URL argument
122
123
'export default ESLintUtils.RuleCreator(docsUrl)<Options, MessageIds>({ create() {}, meta: {} });' : {
123
124
create : { type : 'FunctionExpression' } ,
124
125
meta : { type : 'ObjectExpression' } ,
125
126
isNewStyle : true ,
126
127
} ,
128
+ 'export default ESLintUtils.RuleCreator(docsUrl)({ create() {}, meta: {} });' : {
129
+ create : { type : 'FunctionExpression' } ,
130
+ meta : { type : 'ObjectExpression' } ,
131
+ isNewStyle : true ,
132
+ } ,
127
133
} ;
128
134
129
135
Object . keys ( CASES ) . forEach ( ruleSource => {
0 commit comments