Skip to content

Commit 80dd4b1

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

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
@@ -214,5 +214,27 @@ ruleTester.run('test-case-property-ordering', rule, {
214214
},
215215
],
216216
},
217+
{
218+
code: `
219+
new RuleTester().run('foo', bar, {
220+
valid: [
221+
{\ncode: "foo",\noutput: "",\nerrors: ["baz"],\nlanguageOptions: "",\n},
222+
]
223+
});
224+
`,
225+
output: `
226+
new RuleTester().run('foo', bar, {
227+
valid: [
228+
{\ncode: "foo",\noutput: "",\nlanguageOptions: "",\nerrors: ["baz"],\n},
229+
]
230+
});
231+
`,
232+
errors: [
233+
{
234+
message:
235+
'The properties of a test case should be placed in a consistent order: [code, output, languageOptions, errors].',
236+
},
237+
],
238+
},
217239
],
218240
});

0 commit comments

Comments
 (0)