Skip to content

Commit e469fb5

Browse files
committed
feat: change test-case-property-ordering to add supports languageOptions
fixes #402 Signed-off-by: 唯然 <[email protected]>
1 parent 0450e4c commit e469fb5

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Diff for: lib/rules/test-case-property-ordering.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ module.exports = {
4545
'output',
4646
'options',
4747
'parser',
48-
'parserOptions',
48+
'languageOptions', // used in eslint flat config
49+
'parserOptions', // used in eslintrc config
4950
'globals',
5051
'env',
5152
'errors',

Diff for: tests/lib/rules/test-case-property-ordering.js

+22
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,27 @@ ruleTester.run('test-case-property-ordering', rule, {
212212
},
213213
],
214214
},
215+
{
216+
code: `
217+
new RuleTester().run('foo', bar, {
218+
valid: [
219+
{\ncode: "foo",\noutput: "",\nerrors: ["baz"],\nlanguageOptions: "",\n},
220+
]
221+
});
222+
`,
223+
output: `
224+
new RuleTester().run('foo', bar, {
225+
valid: [
226+
{\ncode: "foo",\noutput: "",\nlanguageOptions: "",\nerrors: ["baz"],\n},
227+
]
228+
});
229+
`,
230+
errors: [
231+
{
232+
message:
233+
'The properties of a test case should be placed in a consistent order: [code, output, languageOptions, errors].',
234+
},
235+
],
236+
},
215237
],
216238
});

0 commit comments

Comments
 (0)