fix: finalize lint-staged configuration with proper file argument passing

- Fix bash command to properly pass file arguments to ESLint
- Add lint:batch script for manual batch processing
- Ensure NODE_OPTIONS is set correctly for memory management
This commit is contained in:
defiQUG
2025-11-13 09:35:45 -08:00
parent 97daf7e407
commit 79a29230e6
2 changed files with 1 additions and 21 deletions

View File

@@ -1,20 +0,0 @@
// Lint-staged configuration
// Handles large batches of files with proper memory management
module.exports = {
'*.{ts,tsx}': (filenames) => {
// Process files in smaller batches to avoid memory issues
const batchSize = 20;
const batches = [];
for (let i = 0; i < filenames.length; i += batchSize) {
batches.push(filenames.slice(i, i + batchSize));
}
return batches.map((batch) => {
return `NODE_OPTIONS='--max-old-space-size=4096' eslint --fix --config eslint.config.js ${batch.join(' ')}`;
});
},
'*.{json,md,yaml,yml}': 'prettier --write',
};

View File

@@ -16,7 +16,7 @@
},
"lint-staged": {
"*.{ts,tsx}": [
"bash -c 'NODE_OPTIONS=\"--max-old-space-size=4096\" eslint --fix --config eslint.config.js'",
"bash -c 'NODE_OPTIONS=\"--max-old-space-size=4096\" eslint --fix --config eslint.config.js \"$@\"' --",
"prettier --write"
],
"*.{json,md,yaml,yml}": [