Skip to content

Commit

Permalink
fix(eslint-plugin): [padding-line-between-statements] problems within…
Browse files Browse the repository at this point in the history
… namespaces not being reported
  • Loading branch information
rafaelss95 committed Sep 12, 2021
1 parent 4a88de2 commit 0d58a24
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
Expand Up @@ -723,10 +723,11 @@ export default util.createRule<Options, MessageIds>({
if (
!node.parent ||
![
AST_NODE_TYPES.SwitchStatement,
AST_NODE_TYPES.BlockStatement,
AST_NODE_TYPES.Program,
AST_NODE_TYPES.SwitchCase,
AST_NODE_TYPES.SwitchStatement,
AST_NODE_TYPES.TSModuleBlock,
].includes(node.parent.type)
) {
return;
Expand Down
Expand Up @@ -5056,5 +5056,45 @@ var a = 1
{ messageId: 'expectedBlankLine' },
],
},
{
// https://github.com/typescript-eslint/typescript-eslint/issues/3863
code: `
declare namespace Types {
type Foo = string;
type Bar = string;
interface FooBar {
[key: string]: string;
}
interface BarBaz {
[key: string]: string;
}
}
`,
output: `
declare namespace Types {
type Foo = string;
type Bar = string;
interface FooBar {
[key: string]: string;
}
interface BarBaz {
[key: string]: string;
}
}
`,
options: [
{ blankLine: 'always', prev: '*', next: ['interface', 'type'] },
],
errors: [
{ messageId: 'expectedBlankLine' },
{ messageId: 'expectedBlankLine' },
{ messageId: 'expectedBlankLine' },
{ messageId: 'expectedBlankLine' },
],
},
],
});

0 comments on commit 0d58a24

Please sign in to comment.