fix: lint parse.js + sync.js

This commit is contained in:
2026-03-29 04:16:26 +02:00
parent 65de913c1d
commit 89e0d82830
2 changed files with 8 additions and 12 deletions

View File

@@ -1,10 +1,8 @@
import { parse } from 'csv-parse';
import fs from 'node:fs';
import zlib from 'zlib';
import zlib from 'node:zlib';
import mysql from 'mysql2';
import dotenv from 'dotenv';
dotenv.config();
import './lib/dotenv.js';
if (process.argv.length != 3) {
throw new Error('You should give a project dir');
@@ -43,8 +41,8 @@ const flushBatch = (batch) => {
};
// quand quelques ligne de csv sont parsées on les assemble puis on genere le sql
parser.on('readable', function(){
let record;
parser.on('readable', () =>{
let record = null;
const batch = [];
while ((record = parser.read()) !== null) {
@@ -60,10 +58,10 @@ parser.on('readable', function(){
flushBatch(batch);
});
parser.on('error', function(err){
parser.on('error', (err) =>{
console.error(err.message);
});
parser.on('end', function(){
parser.on('end', () =>{
connection.end();
});