Skip to content

Commit

Permalink
♻️ [Eslint] Adjust rules for latest antfu
Browse files Browse the repository at this point in the history
  • Loading branch information
beefchimi committed Dec 6, 2024
1 parent 8a8fee6 commit e01827b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
9 changes: 8 additions & 1 deletion app/website/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,20 @@ export default antfu(
{
// Without a `files` scope, these rules will apply to everything.
rules: {
'antfu/if-newline': 'off',
// General
'no-console': 'warn',

// Antfu
'antfu/if-newline': 'off',
'perfectionist/sort-exports': 'off',
'perfectionist/sort-named-exports': 'off',
'perfectionist/sort-imports': 'off',
'style/arrow-parens': ['error', 'always'],
'style/object-curly-spacing': ['error', 'never'],
'test/prefer-lowercase-title': 'off',
'ts/explicit-function-return-type': 'off',
'ts/strict-boolean-expressions': 'off',

// Would like this if I could differentiate between ternary and if conditions.
// 'style/operator-linebreak': ['error', 'after'],

Expand Down
9 changes: 8 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,20 @@ export default antfu(
{
// Without a `files` scope, these rules will apply to everything.
rules: {
'antfu/if-newline': 'off',
// General
'no-console': 'warn',

// Antfu
'antfu/if-newline': 'off',
'perfectionist/sort-exports': 'off',
'perfectionist/sort-named-exports': 'off',
'perfectionist/sort-imports': 'off',
'style/arrow-parens': ['error', 'always'],
'style/object-curly-spacing': ['error', 'never'],
'test/prefer-lowercase-title': 'off',
'ts/explicit-function-return-type': 'off',
'ts/strict-boolean-expressions': 'off',

// Would like this if I could differentiate between ternary and if conditions.
// 'style/operator-linebreak': ['error', 'after'],

Expand Down
16 changes: 16 additions & 0 deletions pkg/earwurm/src/tests/Earwurm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,25 @@ describe('Earwurm component', () => {
}
});

const readySounds = await Promise.all(sounds);

for (const sound of readySounds) {
sound.play();
}

/*
Alternate #1:
for await (const sound of sounds) {
sound.play();
}
*/

/*
Alternate #2:
for (const sound of sounds) {
(await sound).play();
}
*/

expect(mockManager.playing).toBe(true);
expect(mockManager.keys).toHaveLength(3);
Expand Down

0 comments on commit e01827b

Please sign in to comment.