Skip to content

feat!: change test-case-property-ordering to add supports languageOptions #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/rules/test-case-property-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,10 @@ module.exports = {
'output',
'options',
'parser',
'parserOptions',
'globals',
'env',
'languageOptions', // flat-mode only
'parserOptions', // eslintrc-mode only
'globals', // eslintrc-mode only
'env', // eslintrc-mode only
'errors',
];
const sourceCode = context.sourceCode || context.getSourceCode(); // TODO: just use context.sourceCode when dropping eslint < v9
Expand Down
22 changes: 22 additions & 0 deletions tests/lib/rules/test-case-property-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,5 +214,27 @@ ruleTester.run('test-case-property-ordering', rule, {
},
],
},
{
code: `
new RuleTester().run('foo', bar, {
valid: [
{\ncode: "foo",\noutput: "",\nerrors: ["baz"],\nlanguageOptions: "",\n},
]
});
`,
output: `
new RuleTester().run('foo', bar, {
valid: [
{\ncode: "foo",\noutput: "",\nlanguageOptions: "",\nerrors: ["baz"],\n},
]
});
`,
errors: [
{
message:
'The properties of a test case should be placed in a consistent order: [code, output, languageOptions, errors].',
},
],
},
],
});
Loading