Skip to content

Commit

Permalink
chore(lint): remove unused vars
Browse files Browse the repository at this point in the history
  • Loading branch information
kennylam committed Nov 22, 2023
1 parent f685c17 commit 3b3f5d6
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 37 deletions.
2 changes: 1 addition & 1 deletion packages/carbon-web-components/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = {
plugins: ['@typescript-eslint'],
rules: {
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': 1,
'jsdoc/require-param-type': 0,
'jsdoc/require-returns-type': 0,
'no-undef': 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class CDSButton extends HostListenerMixin(FocusMixin(LitElement)) {
*/
@HostListener('focus')
// @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to
private _handleFocus = async (event) => {
private _handleFocus = async () => {
this.openTooltip = true;
};

Expand All @@ -100,7 +100,7 @@ class CDSButton extends HostListenerMixin(FocusMixin(LitElement)) {
*/
@HostListener('focusout')
// @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to
private _handleFocusout = async (event) => {
private _handleFocusout = async () => {
this.openTooltip = false;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { html } from 'lit';
import { boolean, select, text } from '@storybook/addon-knobs';
import { prefix } from '../../../globals/settings';
import { TABLE_SIZE } from '../table';
// @ts-ignore
import Download16 from '@carbon/web-components/es/icons/download/16';
// @ts-ignore
import Settings16 from '@carbon/web-components/es/icons/settings/16';
import '../index';
import storyDocs from './data-table-story.mdx';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import { html } from 'lit';
import { boolean, select, text } from '@storybook/addon-knobs';
import { prefix } from '../../../globals/settings';
import { TABLE_SIZE } from '../table';
// @ts-ignore
import Download16 from '@carbon/web-components/es/icons/download/16';
// @ts-ignore
import Settings16 from '@carbon/web-components/es/icons/settings/16';
import '../index';
import storyDocs from './data-table-story.mdx';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { html } from 'lit';
import { boolean, select, text } from '@storybook/addon-knobs';
import { prefix } from '../../../globals/settings';
import { TABLE_SIZE } from '../table';
// @ts-ignore
import Settings16 from '@carbon/web-components/es/icons/settings/16';
import '../index';
import storyDocs from './data-table-story.mdx';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { boolean, select, text } from '@storybook/addon-knobs';
import { prefix } from '../../../globals/settings';
import { TABLE_SIZE } from '../table';
// @ts-ignore
import Download16 from '@carbon/web-components/es/icons/download/16';
// @ts-ignore
import Settings16 from '@carbon/web-components/es/icons/settings/16';
import OverflowMenuVertical16 from '@carbon/icons/lib/overflow-menu--vertical/16';
import '../index';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ class CDSTableSkeleton extends LitElement {
</thead>
<tbody>
${Array.from(new Array(rowCount)).map(
(_) =>
() =>
html`
<tr>
${Array.from(new Array(columnCount)).map(
(_) =>
() =>
html`
<td>
<span></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ abstract class CDSFloatingMenu extends HostListenerMixin(

@HostListener('click')
// @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to
private _click = (event: MouseEvent) => {
private _click = () => {
const { parent } = this;
if (parent) {
parent.open = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

import { html } from 'lit';
import { select } from '@storybook/addon-knobs';
// Below path will be there when an application installs `carbon-web-components` package.
// In our dev env, we auto-generate the file and re-map below path to to point to the generated file.
// @ts-ignore
import Filter16 from 'carbon-web-components/es/icons/filter/16';
import View16 from '@carbon/icons/lib/view/16';
import FolderOpen16 from '@carbon/icons/lib/folder--open/16';
import Folders16 from '@carbon/icons/lib/folders/16';
Expand Down Expand Up @@ -87,7 +83,7 @@ const actions = html`
<cds-slug-action-button>View Literature</cds-slug-action-button>
`;

export const Default = (args) => {
export const Default = () => {
return html`
<style>
${styles}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@

import { html } from 'lit';
import { select } from '@storybook/addon-knobs';
// Below path will be there when an application installs `carbon-web-components` package.
// In our dev env, we auto-generate the file and re-map below path to to point to the generated file.
// @ts-ignore
import Filter16 from 'carbon-web-components/es/icons/filter/16';
import textNullable from '../../../.storybook/knob-text-nullable';
import { ifDefined } from 'lit/directives/if-defined.js';
import { prefix } from '../../globals/settings';
Expand Down
2 changes: 1 addition & 1 deletion packages/carbon-web-components/tests/typings/snapshot.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

declare namespace jasmine {
interface Matchers<T> {
interface Matchers {
toMatchSnapshot(options?: { mode: string }): boolean;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Default,
Horizontal,
Vertical,
EndOfSection,
} from '../__stories__/link-list.stories';

describe('c4d-link-list', function () {
Expand Down Expand Up @@ -62,14 +61,6 @@ describe('c4d-link-list', function () {
});
});

it('Renders End of section', async function () {
render(EndOfSection({ parameters: {} }), document.body);
await Promise.resolve();
expect(document.body.querySelector('c4d-link-list')).toMatchSnapshot({
mode: 'shadow',
});
});

afterEach(async function () {
await render(undefined!, document.body);
});
Expand Down

0 comments on commit 3b3f5d6

Please sign in to comment.