mirror of
				https://github.com/monkeytypegame/monkeytype.git
				synced 2025-10-31 19:26:22 +08:00 
			
		
		
		
	Use oxlint for general linting to provide much quicker feedback. Keep eslint for type-aware rules. Fully switch to oxlint once it supports type-aware.
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			732 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			732 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // eslint-disable no-require-imports
 | |
| const fs = require("fs");
 | |
| 
 | |
| function fixQuoteLengths() {
 | |
|   return new Promise((resolve) => {
 | |
|     const quotesFiles = fs.readdirSync("../static/quotes/");
 | |
|     quotesFiles.forEach((quotefilename) => {
 | |
|       quotefilename = quotefilename.split(".")[0];
 | |
|       let quoteData = JSON.parse(
 | |
|         fs.readFileSync(`../static/quotes/${quotefilename}.json`, {
 | |
|           encoding: "utf8",
 | |
|           flag: "r",
 | |
|         })
 | |
|       );
 | |
| 
 | |
|       quoteData.quotes.forEach((quote) => {
 | |
|         quote.length = quote.text.length;
 | |
|       });
 | |
| 
 | |
|       fs.writeFileSync(
 | |
|         `../static/quotes/${quotefilename}.json`,
 | |
|         JSON.stringify(quoteData, null, 2)
 | |
|       );
 | |
|     });
 | |
|     resolve();
 | |
|   });
 | |
| }
 | |
| 
 | |
| fixQuoteLengths();
 |