mirror of
https://github.com/TriliumNext/Trilium.git
synced 2026-10-11 22:49:56 +00:00
chore(eslint): drop linebreak-style from the format config
The rule could only ever fail on a working copy, never on committed content: `core.autocrlf` normalizes CRLF to LF on commit, and `.gitattributes` additionally pins `eol=lf` on `patches/**`, `docs/**`, the `doc_notes` trees and `*.sh`. LF in the repository is therefore a Git guarantee, and the rule restated it in a place that sees the checkout instead. On a Windows checkout, where `core.autocrlf=true` rewrites LF to CRLF, it fired on every line of every file. That was 423,752 of the 498,252 errors `dev:format-check` reported — 85% of the output, none of it describing anything wrong with the tree, and enough to bury the 48,304 real findings underneath it. It also made `dev:format-fix` unusable there: the one safe-looking remedy would have rewritten every line of every file. `eslint.config.mjs` already carried this rule commented out, so the two configs now agree. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
1c6fa54e23
commit
0eb6d7c63d
@@ -190,7 +190,7 @@ Use `note.getOwnedAttribute()` for direct, `note.getAttribute()` for inherited.
|
||||
|
||||
## Code Style
|
||||
|
||||
- 4-space indent, semicolons, double quotes, max line 100, Unix line endings (the format config enforces these). Imports sorted per `eslint-plugin-simple-import-sort` (packages before relative, alphabetical within a group) — only ESLint checks that and it isn't run locally, so sort by hand.
|
||||
- 4-space indent, semicolons, double quotes, max line 100 (the format config enforces these). Unix line endings come from Git — `.gitattributes` plus `core.autocrlf` normalize to LF on commit, so the format config does not check them. Imports sorted per `eslint-plugin-simple-import-sort` (packages before relative, alphabetical within a group) — only ESLint checks that and it isn't run locally, so sort by hand.
|
||||
- **Never use the non-null assertion `!`**, tests included. Narrow instead: `?.`, `?? fallback`, an explicit check, or an `*OrThrow` accessor (`becca.getNoteOrThrow(id)`).
|
||||
- **Never use `Array.prototype.forEach`** — write a `for...of` loop instead, and iterate `array.entries()` when the index is needed (`for (const [index, item] of arr.entries())`). It reads better and allows `break`/`continue`/`await`.
|
||||
- **Helpers go below the primary export** they support (or in another module), never between the imports and the main definition — the entry point reads first.
|
||||
|
||||
@@ -16,7 +16,6 @@ export const stylisticRules = {
|
||||
"@stylistic/quote-props": ["error", "consistent-as-needed"],
|
||||
"@stylistic/max-len": ["error", { code: 100 }],
|
||||
"@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" }]
|
||||
|
||||
Reference in New Issue
Block a user