- Fix lint-staged to properly pass file arguments to ESLint - Add batch linting script for processing large file sets - Increase Node.js memory limit to 4GB for ESLint - Add lint:batch npm script for manual batch processing
21 lines
604 B
JavaScript
21 lines
604 B
JavaScript
// 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',
|
|
};
|
|
|