Skip to content

Commit 1504a42

Browse files
committed
address some of the lint violations
1 parent 9d6bffa commit 1504a42

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

tests/lib/rules/consistent-output.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ ruleTester.run('consistent-output', rule, {
6767
});
6868
`,
6969
options: ['always'],
70+
name: 'test case with code, output, and errors (options: always)',
7071
},
7172
`
7273
new NotRuleTester().run('foo', bar, {
@@ -118,6 +119,7 @@ ruleTester.run('consistent-output', rule, {
118119
`,
119120
options: ['always'],
120121
errors: [ERROR],
122+
name: 'invalid test case missing output (options: always)',
121123
},
122124
],
123125
});

tests/lib/rules/meta-property-ordering.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ ruleTester.run('test-case-property-ordering', rule, {
6565
create() {},
6666
};`,
6767
options: [['schema', 'docs']],
68+
name: 'custom order (options: [schema, docs])',
6869
},
6970
`
7071
module.exports = {
@@ -179,6 +180,7 @@ ruleTester.run('test-case-property-ordering', rule, {
179180
data: { order: ['type', 'docs', 'fixable'].join(', ') },
180181
},
181182
],
183+
name: 'custom order with extra prop (options: [type, docs, fixable])',
182184
},
183185
],
184186
});

tests/lib/rules/no-property-in-node.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ ruleTester.run('no-property-in-node', rule, {
110110
additionalNodeTypeFiles: [/not-found/],
111111
},
112112
],
113+
name: 'additionalNodeTypeFiles with no matches',
113114
},
114115
],
115116
invalid: [
@@ -204,6 +205,7 @@ ruleTester.run('no-property-in-node', rule, {
204205
messageId: 'in',
205206
},
206207
],
208+
name: 'additionalNodeTypeFiles with matches',
207209
},
208210
],
209211
});

tests/lib/rules/report-message-format.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ruleTester.run('report-message-format', rule, {
3030
};
3131
`,
3232
options: ['foo'],
33+
name: 'with no languageOptions (options: foo)',
3334
},
3435
{
3536
// ESM
@@ -42,6 +43,7 @@ ruleTester.run('report-message-format', rule, {
4243
`,
4344
options: ['foo'],
4445
languageOptions: { sourceType: 'module' },
46+
name: 'ESM (options: foo)',
4547
},
4648
{
4749
// With message as variable.
@@ -54,6 +56,7 @@ ruleTester.run('report-message-format', rule, {
5456
};
5557
`,
5658
options: ['foo'],
59+
name: 'with message as variable (options: foo)',
5760
},
5861
{
5962
// With message as variable but cannot statically determine its type.
@@ -66,6 +69,7 @@ ruleTester.run('report-message-format', rule, {
6669
};
6770
`,
6871
options: ['foo'],
72+
name: 'with message as variable but cannot statically determine its type (options: foo)',
6973
},
7074
{
7175
code: `
@@ -76,6 +80,7 @@ ruleTester.run('report-message-format', rule, {
7680
};
7781
`,
7882
options: ['f'],
83+
name: 'with no languageOptions (options: f)',
7984
},
8085
{
8186
code: `
@@ -86,6 +91,7 @@ ruleTester.run('report-message-format', rule, {
8691
};
8792
`,
8893
options: ['foo'],
94+
name: 'with message as variable but variable is not defined in scope (options: foo)',
8995
},
9096
{
9197
code: `
@@ -96,6 +102,7 @@ ruleTester.run('report-message-format', rule, {
96102
};
97103
`,
98104
options: ['^foo$'],
105+
name: 'no match with regex (options: ^foo$)',
99106
},
100107
{
101108
code: `
@@ -106,6 +113,7 @@ ruleTester.run('report-message-format', rule, {
106113
};
107114
`,
108115
options: ['^foo$'],
116+
name: 'object param with regex (options: ^foo$)',
109117
},
110118
{
111119
// Suggestion function
@@ -117,6 +125,7 @@ ruleTester.run('report-message-format', rule, {
117125
};
118126
`,
119127
options: ['^foo$'],
128+
name: 'suggestion function (options: ^foo$)',
120129
},
121130
{
122131
// Suggestion message
@@ -128,6 +137,7 @@ ruleTester.run('report-message-format', rule, {
128137
};
129138
`,
130139
options: ['^foo$'],
140+
name: 'suggestion message (options: ^foo$)',
131141
},
132142
{
133143
// Suggestion message with ternary expression
@@ -139,6 +149,7 @@ ruleTester.run('report-message-format', rule, {
139149
};
140150
`,
141151
options: ['^foo$'],
152+
name: 'suggestion message with ternary (options: ^foo$)',
142153
},
143154
{
144155
code: `
@@ -149,6 +160,7 @@ ruleTester.run('report-message-format', rule, {
149160
};
150161
`,
151162
options: ['bar'],
163+
name: 'substring (options: bar)',
152164
},
153165
{
154166
code: `
@@ -159,6 +171,7 @@ ruleTester.run('report-message-format', rule, {
159171
};
160172
`,
161173
options: ['bar'],
174+
name: 'substring with backticks (options: bar)',
162175
},
163176
{
164177
code: `
@@ -169,6 +182,7 @@ ruleTester.run('report-message-format', rule, {
169182
};
170183
`,
171184
options: ['bar'],
185+
name: 'empty report (options: bar)',
172186
},
173187
{
174188
code: `
@@ -179,6 +193,7 @@ ruleTester.run('report-message-format', rule, {
179193
};
180194
`,
181195
options: ['foo'],
196+
name: 'empty report (options: foo)',
182197
},
183198
{
184199
code: `
@@ -193,6 +208,7 @@ ruleTester.run('report-message-format', rule, {
193208
}
194209
`,
195210
options: ['foo'],
211+
name: 'multiple meta.messages (options: foo)',
196212
},
197213
'module.exports = {};', // No rule.
198214
],

tests/lib/rules/require-meta-docs-description.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ ruleTester.run('require-meta-docs-description', rule, {
9191
};
9292
`,
9393
options: [{ pattern: '^myPrefix' }],
94+
name: "custom pattern (pattern: '^myPrefix')",
9495
},
9596
{
9697
code: `
@@ -100,6 +101,7 @@ ruleTester.run('require-meta-docs-description', rule, {
100101
};
101102
`,
102103
options: [{ pattern: '.+' }], // any description allowed
104+
name: "custom pattern (pattern: '.+')",
103105
},
104106
// `meta` in variable, `description` present.
105107
`
@@ -290,6 +292,7 @@ ruleTester.run('require-meta-docs-description', rule, {
290292
type: 'Literal',
291293
},
292294
],
295+
name: "custom pattern (pattern: '^myPrefix')",
293296
},
294297
],
295298
});

0 commit comments

Comments
 (0)