Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-verdes committed Nov 19, 2024
1 parent 563afee commit c15fa09
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/components/carousel/carousel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ describe('<sl-carousel>', () => {
<sl-carousel-item>Node 6</sl-carousel-item>
</sl-carousel>
`);
const expectedSlides = el.querySelectorAll('.expected')!;
const expectedSlides = el.querySelectorAll('.expected');
const nextButton: HTMLElement = el.shadowRoot!.querySelector('.carousel__navigation-button--next')!;

// Act
Expand Down Expand Up @@ -351,7 +351,7 @@ describe('<sl-carousel>', () => {
<sl-carousel-item class="expected">Node 6</sl-carousel-item>
</sl-carousel>
`);
const expectedSlides = el.querySelectorAll('.expected')!;
const expectedSlides = el.querySelectorAll('.expected');
const nextButton: HTMLElement = el.shadowRoot!.querySelector('.carousel__navigation-button--next')!;

// Act
Expand Down
6 changes: 3 additions & 3 deletions src/components/mf-nav-item/subnav-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@ export class SubnavController implements ReactiveController {
event.stopPropagation();
if (this.popupRef.value.active) {
if (navItems[0] instanceof HTMLElement) {
navItems[0].focus();
navItems[0]?.focus();
}
} else {
this.enableSubnav(false);
this.host.updateComplete.then(() => {
if (navItems[0] instanceof HTMLElement) {
navItems[0].focus();
if (navItems![0] instanceof HTMLElement) {
navItems![0].focus();
}
});
this.host.requestUpdate();
Expand Down
8 changes: 4 additions & 4 deletions src/components/radio-group/radio-group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe('when submitting a form', () => {
</form>
`);
const button = form.querySelector('sl-button')!;
const radio = form.querySelectorAll('sl-radio')[1]!;
const radio = form.querySelectorAll('sl-radio')[1];
const submitHandler = sinon.spy((event: SubmitEvent) => {
formData = new FormData(form);

Expand Down Expand Up @@ -261,7 +261,7 @@ describe('when a size is applied', () => {
<sl-radio id="radio-2" value="2"></sl-radio>
</sl-radio-group>
`);
const [radio1, radio2] = radioGroup.querySelectorAll('sl-radio')!;
const [radio1, radio2] = radioGroup.querySelectorAll('sl-radio');

expect(radio1.size).to.equal('large');
expect(radio2.size).to.equal('large');
Expand All @@ -274,7 +274,7 @@ describe('when a size is applied', () => {
<sl-radio-button id="radio-2" value="2"></sl-radio-button>
</sl-radio-group>
`);
const [radio1, radio2] = radioGroup.querySelectorAll('sl-radio-button')!;
const [radio1, radio2] = radioGroup.querySelectorAll('sl-radio-button');

expect(radio1.size).to.equal('large');
expect(radio2.size).to.equal('large');
Expand All @@ -287,7 +287,7 @@ describe('when a size is applied', () => {
<sl-radio-button id="radio-2" value="2"></sl-radio-button>
</sl-radio-group>
`);
const [radio1, radio2] = radioGroup.querySelectorAll('sl-radio-button')!;
const [radio1, radio2] = radioGroup.querySelectorAll('sl-radio-button');

expect(radio1.size).to.equal('small');
expect(radio2.size).to.equal('small');
Expand Down
4 changes: 2 additions & 2 deletions src/components/select/select.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ describe('<sl-select>', () => {
<sl-option value="option-3">Option 3</sl-option>
</sl-select>
`);
const secondOption = el.querySelectorAll('sl-option')[1]!;
const secondOption = el.querySelectorAll('sl-option')[1];

expect(el.checkValidity()).to.be.true;
expect(el.hasAttribute('data-required')).to.be.true;
Expand Down Expand Up @@ -347,7 +347,7 @@ describe('<sl-select>', () => {
<sl-option value="option-3">Option 3</sl-option>
</sl-select>
`);
const secondOption = el.querySelectorAll('sl-option')[1]!;
const secondOption = el.querySelectorAll('sl-option')[1];

expect(el.hasAttribute('data-required')).to.be.true;
expect(el.hasAttribute('data-optional')).to.be.false;
Expand Down
2 changes: 1 addition & 1 deletion src/components/tab/tab.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ describe('<sl-tab>', () => {
</sl-tab-group>
`);
const closeButton = tabGroup
.querySelectorAll('sl-tab')[0]!
.querySelectorAll('sl-tab')[0]
.shadowRoot!.querySelector<SlIconButton>('[part~="close-button"]')!;

const handleClose = sinon.spy();
Expand Down

0 comments on commit c15fa09

Please sign in to comment.