| 
									
										
										
										
											2025-04-02 08:35:24 +02:00
										 |  |  | import stylistic from "@stylistic/eslint-plugin"; | 
					
						
							| 
									
										
										
										
											2025-04-02 08:58:52 +02:00
										 |  |  | import tsParser from "@typescript-eslint/parser"; | 
					
						
							| 
									
										
										
										
											2025-04-02 08:35:24 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | // eslint config just for formatting rules
 | 
					
						
							|  |  |  | // potentially to be merged with the linting rules into one single config,
 | 
					
						
							|  |  |  | // once we have fixed the majority of lint errors
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Go to https://eslint.style/rules/default/${rule_without_prefix} to check the rule details
 | 
					
						
							|  |  |  | export const stylisticRules = { | 
					
						
							|  |  |  |     "@stylistic/indent": [ "error", 4 ], | 
					
						
							|  |  |  |     "@stylistic/quotes": [ "error", "double", { avoidEscape: true, allowTemplateLiterals: "always" } ], | 
					
						
							|  |  |  |     "@stylistic/semi": [ "error", "always" ], | 
					
						
							|  |  |  |     "@stylistic/quote-props": [ "error", "consistent-as-needed" ], | 
					
						
							| 
									
										
										
										
											2025-04-02 21:16:18 +03:00
										 |  |  |     "@stylistic/max-len": [ "error", { code: 100 } ], | 
					
						
							| 
									
										
										
										
											2025-04-02 08:35:24 +02:00
										 |  |  |     "@stylistic/comma-dangle": [ "error", "never" ], | 
					
						
							|  |  |  |     "@stylistic/linebreak-style": [ "error", "unix" ], | 
					
						
							|  |  |  |     "@stylistic/array-bracket-spacing": [ "error", "always" ], | 
					
						
							|  |  |  |     "@stylistic/object-curly-spacing": [ "error", "always" ], | 
					
						
							|  |  |  |     "@stylistic/padded-blocks": [ "error", { classes: "always" } ] | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default [ | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2025-04-02 08:58:52 +02:00
										 |  |  |         files: [ "**/*.{js,ts,mjs,cjs}" ], | 
					
						
							|  |  |  |         languageOptions: { | 
					
						
							|  |  |  |             parser: tsParser | 
					
						
							|  |  |  |         }, | 
					
						
							| 
									
										
										
										
											2025-04-02 08:35:24 +02:00
										 |  |  |         plugins: { | 
					
						
							|  |  |  |             "@stylistic": stylistic | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         rules: { | 
					
						
							|  |  |  |             ...stylisticRules | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ignores: [ | 
					
						
							|  |  |  |             "build/*", | 
					
						
							|  |  |  |             "dist/*", | 
					
						
							|  |  |  |             "docs/*", | 
					
						
							| 
									
										
										
										
											2025-04-02 08:42:14 +02:00
										 |  |  |             "demo/*", | 
					
						
							| 
									
										
										
										
											2025-04-02 08:35:24 +02:00
										 |  |  |             "libraries/*", | 
					
						
							|  |  |  |             // TriliumNextTODO: check if we want to format packages here as well - for now skipping it
 | 
					
						
							|  |  |  |             "packages/*", | 
					
						
							|  |  |  |             "src/public/app-dist/*", | 
					
						
							|  |  |  |             "src/public/app/doc_notes/*" | 
					
						
							|  |  |  |         ] | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | ]; |