Skip to content

Commit

Permalink
format/lint
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Jul 31, 2019
1 parent 4b87377 commit a05aaea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/test/rules/attach-shadow-constructor_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,6 @@ ruleTester.run('attach-shadow-constructor', rule, {
column: 11
}
]
},
}
]
});
4 changes: 2 additions & 2 deletions src/test/util_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const parseExpr = (expr: string): ESTree.Node => {
return (parsed as ESTree.Program).body[0];
};

const mockContext = {
const mockContext = ({
settings: {}
} as unknown as Rule.RuleContext;
} as unknown) as Rule.RuleContext;

describe('util', () => {
describe('isCustomElement', () => {
Expand Down
7 changes: 5 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function isCustomElementDecorator(node: DecoratorNode): boolean {
/**
* Determines if a node is an element class or not.
*
* @param {Rule.RuleContext} context ESLint rule context
* @param {ESTree.Node} node Node to test
* @param {AST.Token=} jsdoc JSDoc to parse
* @return {boolean}
Expand All @@ -39,9 +40,11 @@ export function isCustomElement(
jsdoc?: AST.Token | null
): node is ESTree.Class {
const asDecorated = node as WithDecorators<ESTree.Node>;
let customElementBases: string[] = ['HTMLElement'];
const customElementBases: string[] = ['HTMLElement'];
if (context.settings.wc && context.settings.wc.elementBaseClasses) {
customElementBases.push(...context.settings.wc.elementBaseClasses as string[]);
customElementBases.push(
...(context.settings.wc.elementBaseClasses as string[])
);
}

if (node.type === 'ClassExpression' || node.type === 'ClassDeclaration') {
Expand Down

0 comments on commit a05aaea

Please sign in to comment.