mirror of
https://github.com/jung-geun/NFD2NFC.git
synced 2026-06-21 04:15:14 +09:00
fix: typecheck/lint 오류 수정
tsconfig.json: module ESNext로 변경, renderer 제외. .eslintrc.cjs: varsIgnorePattern '^_' 추가. store.ts: notificationIntervalSecs 기본값(30) 추가. src/lib/index.ts: FilterOptions/ScanEntry를 올바른 소스 파일에서 import. scanner.ts: 미사용 fs import 제거. ipc.ts: 미사용 nanoid import 제거. cli/index.ts: 미사용 argv 변수 void 처리, showHelp() → 메시지 출력으로 대체. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ module.exports = {
|
||||
plugins: ['@typescript-eslint'],
|
||||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
||||
'@typescript-eslint/no-explicit-any': 'warn',
|
||||
},
|
||||
overrides: [
|
||||
|
||||
7727
package-lock.json
generated
Normal file
7727
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ import { scan } from '../core/scanner';
|
||||
import { normalizeEntry } from '../core/normalizer';
|
||||
import type { RenameResult } from '../core/types';
|
||||
|
||||
const argv = yargs(hideBin(process.argv))
|
||||
void yargs(hideBin(process.argv))
|
||||
.usage('Usage: $0 <command|path> [options]')
|
||||
.command(
|
||||
'file <path>',
|
||||
@@ -34,7 +34,7 @@ const argv = yargs(hideBin(process.argv))
|
||||
.option('dry-run', { alias: 'n', describe: '실제 변환 없이 대상만 출력', type: 'boolean', default: false }),
|
||||
async (args) => {
|
||||
if (!args.path) {
|
||||
yargs.showHelp();
|
||||
console.error('경로를 지정해주세요. nfd2nfc --help 로 도움말을 확인하세요.');
|
||||
process.exit(1);
|
||||
}
|
||||
try {
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('shouldNormalize', () => {
|
||||
|
||||
it('파일명에 한글 자모 확장-A 범위 코드포인트가 있으면 → true', () => {
|
||||
// U+A960 Hangul Jamo Extended-A
|
||||
const name = 'ꥠfile.txt'; // 확장-A 자모
|
||||
const _name = 'ꥠfile.txt'; // 확장-A 자모
|
||||
// 이 코드포인트는 단독으로 NFC와 다른 NFD를 만들지는 않지만 filter 범위 테스트
|
||||
// shouldNormalize는 먼저 NFC 동일성 체크를 하므로, NFC!=원본인 경우에만 범위 체크함
|
||||
// 따라서 실제로 NFD인 상황을 만들기 위해 함께 한글 자모를 섞어 줌
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('normalizeEntry — file', () => {
|
||||
|
||||
it('라틴 악센트 NFD → skipped (한글 필터)', async () => {
|
||||
// e + combining acute accent (é in NFD)
|
||||
const nfdName = 'caféNFD.txt'; // 이미 NFC라 아래에서 직접 NFD로 만들기
|
||||
const _nfdName = 'caféNFD.txt'; // 이미 NFC라 아래에서 직접 NFD로 만들기
|
||||
// 실제 NFD 문자열: NFC e('e') + combining acute U+0301
|
||||
const nfdReal = 'café.txt';
|
||||
const filePath = path.join(tmpDir, nfdReal);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import fs, { Dirent } from 'fs';
|
||||
import { Dirent } from 'fs';
|
||||
import fsPromises from 'fs/promises';
|
||||
import path from 'path';
|
||||
import { shouldNormalize } from './filter';
|
||||
|
||||
@@ -6,4 +6,6 @@ export const normalizeToNFD = (s: string): string => s.normalize('NFD');
|
||||
export { normalizeEntry } from '../core/normalizer';
|
||||
export { scan } from '../core/scanner';
|
||||
export { shouldNormalize } from '../core/filter';
|
||||
export type { RenameResult, FilterOptions, ScanEntry } from '../core/types';
|
||||
export type { FilterOptions } from '../core/filter';
|
||||
export type { ScanEntry } from '../core/scanner';
|
||||
export type { RenameResult } from '../core/types';
|
||||
|
||||
@@ -2,7 +2,6 @@ import { ipcMain, dialog, app, BrowserWindow } from 'electron';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { scan } from '../core/scanner';
|
||||
import { normalizeEntry } from '../core/normalizer';
|
||||
import { nanoid } from './nanoid';
|
||||
import * as store from './store';
|
||||
import * as watcher from './watcher';
|
||||
import type { WatchedDir, UndoEntry } from '../core/types';
|
||||
|
||||
@@ -10,6 +10,7 @@ const DEFAULT_SETTINGS: AppSettings = {
|
||||
startAtLogin: false,
|
||||
defaultMode: 'auto',
|
||||
notificationsEnabled: true,
|
||||
notificationIntervalSecs: 30,
|
||||
};
|
||||
|
||||
const DEFAULT_SCHEMA: AppSchema = {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022"],
|
||||
"module": "CommonJS",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
@@ -11,5 +11,5 @@
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"baseUrl": "."
|
||||
},
|
||||
"exclude": ["node_modules", "out", "dist"]
|
||||
"exclude": ["node_modules", "out", "dist", "src/renderer/**"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user