Skip to content
Permalink
Browse files

fix(eslint-plugin): [naming-convention] check bodyless function param…

…eters (#2675)
  • Loading branch information
thomasmichaelwallace committed Oct 18, 2020
1 parent d690c8d commit c505863ac41755383e08893ba0bc4c0fd937eb1d
@@ -529,10 +529,11 @@ export default util.createRule<Options, MessageIds>({
// #endregion function

// #region parameter

'FunctionDeclaration, TSDeclareFunction, FunctionExpression, ArrowFunctionExpression'(
'FunctionDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, FunctionExpression, ArrowFunctionExpression'(
node:
| TSESTree.FunctionDeclaration
| TSESTree.TSDeclareFunction
| TSESTree.TSEmptyBodyFunctionExpression
| TSESTree.FunctionExpression
| TSESTree.ArrowFunctionExpression,
): void {
@@ -1316,5 +1316,20 @@ ruleTester.run('naming-convention', rule, {
},
],
},
{
code: `
declare class Foo {
Bar(Baz: string): void;
}
`,
parserOptions,
options: [{ selector: 'parameter', format: ['camelCase'] }],
errors: [
{
line: 3,
messageId: 'doesNotMatchFormat',
},
],
},
],
});

0 comments on commit c505863

Please sign in to comment.
You can’t perform that action at this time.