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:
@@ -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',
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.{ts,tsx}": [
|
"*.{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"
|
"prettier --write"
|
||||||
],
|
],
|
||||||
"*.{json,md,yaml,yml}": [
|
"*.{json,md,yaml,yml}": [
|
||||||
|
|||||||
Reference in New Issue
Block a user