Skip to content

Commit

Permalink
boime lint
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Sep 22, 2024
1 parent 61f7d4d commit c8ccf79
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bin/fanyi.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env -S node --no-deprecation

import { Command } from 'commander';
import chalk from 'chalk';
import { Command } from 'commander';
import updateNotifier from 'update-notifier';
import pkg from '../package.json';
import config from '../lib/config.mjs';
import { searchList } from '../lib/searchHistory.mjs';
import pkg from '../package.json';

updateNotifier({ pkg }).notify();
const program = new Command();
Expand Down
6 changes: 3 additions & 3 deletions index.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Groq } from 'groq-sdk';
import print from './lib/print.mjs';
import { XMLParser } from 'fast-xml-parser';
import ora from 'ora';
import gradient from 'gradient-string';
import { Groq } from 'groq-sdk';
import fetch from 'node-fetch';
import ora from 'ora';
import print from './lib/print.mjs';

const gradients = [
'cristal',
Expand Down
2 changes: 1 addition & 1 deletion lib/config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from 'node:fs';
import { homedir } from 'node:os';
import path from 'node:path';
import { existsSync, statSync, readFileSync, mkdirSync, writeFileSync } from 'node:fs';
import chalk from 'chalk';

const configDir = path.resolve(homedir, '.config', 'fanyi');
Expand Down
4 changes: 3 additions & 1 deletion lib/print.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ export function iciba(data, options = {}) {
if (typeof data.pos[i] !== 'string' || !data.pos[i]) {
return;
}
log(`${chalkInstance.gray('- ')}${chalkInstance.green(`${data.pos[i]} ${data.acceptation[i].trim()}`)}`);
log(
`${chalkInstance.gray('- ')}${chalkInstance.green(`${data.pos[i]} ${data.acceptation[i].trim()}`)}`,
);
means.push(`${data.pos[i]} ${data.acceptation[i].trim()}`);
});

Expand Down
2 changes: 1 addition & 1 deletion lib/searchHistory.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ensureFileSync, readFileSync, writeFile } from 'node:fs';
import { homedir } from 'node:os';
import path from 'node:path';
import chalk from 'chalk';
import dayjs from 'dayjs';
import { homedir } from 'node:os';

const searchFilePath = path.resolve(homedir, '.config', 'fanyi', 'searchHistory.txt');

Expand Down

0 comments on commit c8ccf79

Please sign in to comment.