kopia lustrzana https://github.com/shoelace-style/shoelace
update eslint
rodzic
f57adb33eb
commit
e60c5c4546
|
@ -83,34 +83,6 @@ module.exports = {
|
|||
'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
|
||||
'@typescript-eslint/member-delimiter-style': 'warn',
|
||||
'@typescript-eslint/method-signature-style': 'warn',
|
||||
'@typescript-eslint/naming-convention': [
|
||||
'warn',
|
||||
{
|
||||
selector: 'default',
|
||||
format: ['camelCase']
|
||||
},
|
||||
{
|
||||
selector: ['function', 'enumMember', 'property'],
|
||||
format: ['camelCase', 'PascalCase']
|
||||
},
|
||||
{
|
||||
selector: 'variable',
|
||||
modifiers: ['const'],
|
||||
format: ['camelCase', 'PascalCase', 'UPPER_CASE']
|
||||
},
|
||||
{
|
||||
selector: 'typeLike',
|
||||
format: ['PascalCase']
|
||||
},
|
||||
{
|
||||
selector: 'typeProperty',
|
||||
format: ['camelCase', 'PascalCase', 'UPPER_CASE']
|
||||
},
|
||||
{
|
||||
selector: 'objectLiteralProperty',
|
||||
format: null
|
||||
}
|
||||
],
|
||||
'@typescript-eslint/no-extraneous-class': 'error',
|
||||
'@typescript-eslint/no-parameter-properties': 'error',
|
||||
'@typescript-eslint/strict-boolean-expressions': 'off'
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('<sl-checkbox>', () => {
|
|||
it('should fire sl-change when clicked', async () => {
|
||||
const el = await fixture<SlCheckbox>(html` <sl-checkbox></sl-checkbox> `);
|
||||
setTimeout(() => el.shadowRoot!.querySelector('input')!.click());
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -40,7 +40,7 @@ describe('<sl-checkbox>', () => {
|
|||
const input = el.shadowRoot!.querySelector('input')!;
|
||||
input.focus();
|
||||
setTimeout(() => sendKeys({ press: ' ' }));
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
|
|
@ -46,7 +46,7 @@ describe('<sl-icon>', () => {
|
|||
|
||||
it('renders pre-loaded system icons and emits sl-load event', async () => {
|
||||
const el = await fixture<SlIcon>(html` <sl-icon library="system"></sl-icon> `);
|
||||
const listener = oneEvent(el, 'sl-load');
|
||||
const listener = oneEvent(el, 'sl-load') as Promise<CustomEvent>;
|
||||
|
||||
el.name = 'check-lg';
|
||||
const ev = await listener;
|
||||
|
@ -102,7 +102,7 @@ describe('<sl-icon>', () => {
|
|||
describe('new library', () => {
|
||||
it('renders icons from the new library and emits sl-load event', async () => {
|
||||
const el = await fixture<SlIcon>(html` <sl-icon library="test-library"></sl-icon> `);
|
||||
const listener = oneEvent(el, 'sl-load');
|
||||
const listener = oneEvent(el, 'sl-load') as Promise<CustomEvent>;
|
||||
|
||||
el.name = 'test-icon1';
|
||||
const ev = await listener;
|
||||
|
@ -131,7 +131,7 @@ describe('<sl-icon>', () => {
|
|||
|
||||
it('emits sl-error when the file cant be retrieved', async () => {
|
||||
const el = await fixture<SlIcon>(html` <sl-icon library="test-library"></sl-icon> `);
|
||||
const listener = oneEvent(el, 'sl-error');
|
||||
const listener = oneEvent(el, 'sl-error') as Promise<CustomEvent>;
|
||||
|
||||
el.name = 'bad-request';
|
||||
const ev = await listener;
|
||||
|
@ -143,7 +143,7 @@ describe('<sl-icon>', () => {
|
|||
|
||||
it("emits sl-error when there isn't an svg element in the registered icon", async () => {
|
||||
const el = await fixture<SlIcon>(html` <sl-icon library="test-library"></sl-icon> `);
|
||||
const listener = oneEvent(el, 'sl-error');
|
||||
const listener = oneEvent(el, 'sl-error') as Promise<CustomEvent>;
|
||||
|
||||
el.name = 'bad-icon';
|
||||
const ev = await listener;
|
||||
|
|
|
@ -20,7 +20,7 @@ describe('<sl-radio-button>', () => {
|
|||
it('should fire sl-change when clicked', async () => {
|
||||
const el = await fixture<SlRadioButton>(html` <sl-radio-button></sl-radio-button> `);
|
||||
setTimeout(() => el.input.click());
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -29,7 +29,7 @@ describe('<sl-radio-button>', () => {
|
|||
const el = await fixture<SlRadioButton>(html` <sl-radio-button></sl-radio-button> `);
|
||||
el.input.focus();
|
||||
setTimeout(() => sendKeys({ press: ' ' }));
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -45,7 +45,7 @@ describe('<sl-radio-button>', () => {
|
|||
const radio2 = radioGroup.querySelector<SlRadioButton>('#radio-2')!;
|
||||
radio1.input.focus();
|
||||
setTimeout(() => sendKeys({ press: 'ArrowRight' }));
|
||||
const event = await oneEvent(radio2, 'sl-change');
|
||||
const event = (await oneEvent(radio2, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(radio2);
|
||||
expect(radio2.checked).to.be.true;
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ describe('<sl-radio>', () => {
|
|||
it('should fire sl-change when clicked', async () => {
|
||||
const el = await fixture<SlRadio>(html` <sl-radio></sl-radio> `);
|
||||
setTimeout(() => el.input.click());
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -30,7 +30,7 @@ describe('<sl-radio>', () => {
|
|||
const el = await fixture<SlRadio>(html` <sl-radio></sl-radio> `);
|
||||
el.input.focus();
|
||||
setTimeout(() => sendKeys({ press: ' ' }));
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -46,7 +46,7 @@ describe('<sl-radio>', () => {
|
|||
const radio2 = radioGroup.querySelector<SlRadio>('#radio-2')!;
|
||||
radio1.input.focus();
|
||||
setTimeout(() => sendKeys({ press: 'ArrowRight' }));
|
||||
const event = await oneEvent(radio2, 'sl-change');
|
||||
const event = (await oneEvent(radio2, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(radio2);
|
||||
expect(radio2.checked).to.be.true;
|
||||
});
|
||||
|
|
|
@ -19,7 +19,7 @@ describe('<sl-switch>', () => {
|
|||
it('should fire sl-change when clicked', async () => {
|
||||
const el = await fixture<SlSwitch>(html` <sl-switch></sl-switch> `);
|
||||
setTimeout(() => el.shadowRoot!.querySelector('input')!.click());
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -28,7 +28,7 @@ describe('<sl-switch>', () => {
|
|||
const el = await fixture<SlSwitch>(html` <sl-switch></sl-switch> `);
|
||||
el.focus();
|
||||
setTimeout(() => sendKeys({ press: ' ' }));
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -37,7 +37,7 @@ describe('<sl-switch>', () => {
|
|||
const el = await fixture<SlSwitch>(html` <sl-switch></sl-switch> `);
|
||||
el.focus();
|
||||
setTimeout(() => sendKeys({ press: 'ArrowRight' }));
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.true;
|
||||
});
|
||||
|
@ -46,7 +46,7 @@ describe('<sl-switch>', () => {
|
|||
const el = await fixture<SlSwitch>(html` <sl-switch checked></sl-switch> `);
|
||||
el.focus();
|
||||
setTimeout(() => sendKeys({ press: 'ArrowLeft' }));
|
||||
const event = await oneEvent(el, 'sl-change');
|
||||
const event = (await oneEvent(el, 'sl-change')) as CustomEvent;
|
||||
expect(event.target).to.equal(el);
|
||||
expect(el.checked).to.be.false;
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue