Skip to content

Commit

Permalink
chore: formatting and typecheck fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
anikethsaha committed Apr 1, 2020
1 parent 8ea1227 commit 912e01f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 4 additions & 5 deletions packages/eslint-plugin/src/rules/init-declarations.ts
Expand Up @@ -39,16 +39,15 @@ export default createRule<Options, MessageIds>({
const mode = context.options[0] || 'always';

return {
'VariableDeclaration:exit'(
node: TSESTree.VariableDeclaration,
): void {
'VariableDeclaration:exit'(node: TSESTree.VariableDeclaration): void {
if (mode === 'always') {
if (node?.declare) {
return;
}
if (
node?.parent?.type === AST_NODE_TYPES.TSModuleBlock &&
node?.parent?.parent?.declare
node.parent?.type === AST_NODE_TYPES.TSModuleBlock &&
node.parent?.parent?.type === AST_NODE_TYPES.TSModuleDeclaration &&
node.parent?.parent?.declare
) {
return;
}
Expand Down
4 changes: 1 addition & 3 deletions packages/eslint-plugin/typings/eslint-rules.d.ts
Expand Up @@ -556,9 +556,7 @@ declare module 'eslint/lib/rules/init-declarations' {
}?,
],
{
'VariableDeclaration:exit'(
node: TSESTree.VariableDeclaration,
): void;
'VariableDeclaration:exit'(node: TSESTree.VariableDeclaration): void;
}
>;
export = rule;
Expand Down

0 comments on commit 912e01f

Please sign in to comment.