Skip to content

Commit

Permalink
chore(biome): 🚨 fix biome errors/warns
Browse files Browse the repository at this point in the history
  • Loading branch information
4doist committed Sep 27, 2024
1 parent 5c26b63 commit 1fd7215
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/create-sunar/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"suspicious": {
"all": true,
"noConsole": "off",
"noConsoleLog": "off"
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/create-sunar/src/helpers/is-empty-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ const validFiles = [
'.yarn',
];

const imlRegex = /\.iml$/;

export function isEmptyDir(root: string, name: string): boolean {
const conflicts = readdirSync(root).filter(
(file) => !(validFiles.includes(file) || /\.iml$/.test(file)),
(file) => !(validFiles.includes(file) || imlRegex.test(file)),
);

if (conflicts.length <= 0) return true;
Expand Down
4 changes: 2 additions & 2 deletions packages/sunar/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"nursery": {
"all": true,
"noEnum": "off",
"useImportRestrictions": "off",
"useConsistentMemberAccessibility": "off"
},
Expand All @@ -33,8 +34,7 @@
"suspicious": {
"all": true,
"noEmptyBlockStatements": "off",
"noExplicitAny": "off",
"noConsoleLog": "off"
"noExplicitAny": "off"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sunar/src/utils/isObject/isObject.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('isObject()', () => {

it('should return true for other non-plain objects', () => {
expect(isObject(new Date())).toBe(true);
// biome-ignore lint/nursery/useTopLevelRegex: testing purposes
// biome-ignore lint/performance/useTopLevelRegex: testing purposes
expect(isObject(/regex/)).toBe(true);
});
});
4 changes: 2 additions & 2 deletions packages/sunar/src/utils/isRegex/isRegex.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isRegex } from './isRegex';

describe('isRegex()', () => {
it('should return true for a valid RegExp', () => {
// biome-ignore lint/nursery/useTopLevelRegex: testing purposes
// biome-ignore lint/performance/useTopLevelRegex: testing purposes
const regex = /[a-z]+/;
expect(isRegex(regex)).toBe(true);
});
Expand All @@ -18,7 +18,7 @@ describe('isRegex()', () => {
});

it('should return false for null', () => {
// biome-ignore lint/nursery/noEvolvingTypes: testing purposes
// biome-ignore lint/suspicious/noEvolvingTypes: testing purposes
const notRegex = null;
expect(isRegex(notRegex)).toBe(false);
});
Expand Down
16 changes: 9 additions & 7 deletions packages/sunar/src/vitest/signals/ready.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Signal } from '../../builders'
import { execute } from '../../mutators'
import { Signals } from '../../utils'
import { Signal } from '../../builders';
import { execute } from '../../mutators';
import { Signals } from '../../utils';

const signal = new Signal(Signals.ClientReady)
const signal = new Signal(Signals.ClientReady);

execute(signal, (client) => {
console.log(`${client.user.tag} ready!`)
})
// biome-ignore lint/suspicious/noConsoleLog: testing purposes
// biome-ignore lint/suspicious/noConsole: testing purposes
console.log(`${client.user.tag} ready!`);
});

export { signal }
export { signal };

0 comments on commit 1fd7215

Please sign in to comment.