Formatting rules - #91
Merged
Merged
Conversation
(cherry picked from commit 9f0568e4eb774a86b4f82091705f89c2fe370611) (cherry picked from commit 62ee0adb714417e9329fb4ca434079ecfcb382d2)
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Enable csharp_style_prefer_collection_expression with IDE0305 disabled so format does not rewrite .ToList() to spreads. Add info-severity guards to prevent target-typed new, coalesce, pattern-matching, and other bleed during dotnet format style --severity info. Co-authored-by: Cursor <cursoragent@cursor.com>
No code changes; the codebase already satisfies IDE0020/IDE0078. Remove the IDE0078 format guard now that the rule is adopted. Co-authored-by: Cursor <cursoragent@cursor.com>
No code changes; the codebase already uses is not where applicable. Remove the IDE0083 format guard now that the rule is adopted. Co-authored-by: Cursor <cursoragent@cursor.com>
Format now runs whitespace then dotnet format style at warn severity. Remove pattern-matching EditorConfig entries the project is not adopting. Co-authored-by: Cursor <cursoragent@cursor.com>
No code changes; the codebase already satisfies the rule at warning severity. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Prefer unqualified member access in Equals overrides and similar code. Co-authored-by: Cursor <cursoragent@cursor.com>
Prefer int/string/etc. over CLR type names; codebase already conforms. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Scoped to FantasyCritic.Test and FantasyCritic.IntegrationTests. Wraps groups of independent Assert.That calls in using (Assert.EnterMultipleScope()) so all failures in a group are reported together instead of stopping at the first. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Adds FormatAnalyzers/FormatAnalyzersCheck MSBuild targets for the test-project-only NUnit2045 rule, since it comes from the 3rd-party NUnit.Analyzers package and isn't covered by dotnet format style. Format.ps1 and format.sh now call this in a check/fix loop (the fixer only resolves non-overlapping violation groups per pass) so a single run of the format script converges and applies every agreed C# rule, not just the ones dotnet format style covers. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
A <p> can't contain a block-level <ul> (the browser implicitly closes the <p> first), which crashed Prettier's HTML parser and blocked ClientApp formatting entirely. Made the list a sibling of the paragraph, matching the pattern already used elsewhere in the file. Co-authored-by: Cursor <cursoragent@cursor.com>
eslint.config.mjs imported '@typescript-eslint/eslint-plugin', whose configs.recommended is a single legacy config object, not the flat-config array the '...tseslint.configs.recommended' spread expects. That crashed every ESLint run with 'TypeError: tseslint.configs.recommended is not iterable'. The correct package is the 'typescript-eslint' meta-package, which is what's actually declared in devDependencies. Co-authored-by: Cursor <cursoragent@cursor.com>
ESLint 9's flat config removed --ignore-path entirely ('Invalid option'), so 'npm run lint' was failing outright. Move the intent (skip build output and NSwag-generated code, matching the root .gitignore) into eslint.config.mjs's own 'ignores' array instead.
Co-authored-by: Cursor <cursoragent@cursor.com>
Root-level Node scripts (aspnetcore-https.js, vite.*.config.js, eslint.config.mjs itself) run under Node, not the browser, so they legitimately use 'process' and other Node globals the browser-only global set doesn't know about. basicMixin.js also checks process.env.NODE_ENV, which Vite statically replaces at build time even in browser code - add it as a readonly global for that case too. Co-authored-by: Cursor <cursoragent@cursor.com>
eslint-plugin-vue's 'flat/essential' preset assumes Vue 3 and flags valid Vue 2 syntax (.sync/.native modifiers, filters) as errors. This app runs Vue 2.7 (see package.json), so switch to the dedicated 'flat/vue2-essential' preset. Drops ~200 false-positive errors, leaving only genuine lint findings. Co-authored-by: Cursor <cursoragent@cursor.com>
'npm exec -- prettier --check src/' dumped megabytes of raw matched-file content to stdout on this machine/npm version instead of the terse pass/fail output prettier normally gives - even on a clean run. 'npm run' (which the write-mode format/lint scripts already used) doesn't have this problem. Add format:check/lint:check npm scripts mirroring the existing format/lint scripts, and switch Format.ps1/format.sh to call them. Co-authored-by: Cursor <cursoragent@cursor.com>
Now that ESLint actually runs (previous commits) and targets the right Vue major version, these are the zero-behavior-change findings it caught: unused 'catch (error)'/'catch (err)' bindings (use ES2019 optional catch binding instead) and 'let' that's never reassigned ('prefer-const').
Co-authored-by: Cursor <cursoragent@cursor.com>
Both files aliased 'let outerScope = this' to reach into the component from a regular function() callback passed to Array.forEach. An arrow function preserves 'this' lexically, so the alias (flagged by @typescript-eslint/no-this-alias) is unnecessary. Same behavior, no alias. Co-authored-by: Cursor <cursoragent@cursor.com>
Empty computed getter that always returned undefined, flagged by vue/return-in-computed-property. Not referenced anywhere else in the file or template - a leftover stub from an earlier iteration of this page. Safe to delete outright. Co-authored-by: Cursor <cursoragent@cursor.com>
byDate is a local plain object created fresh inside this computed getter, not part of Vues reactive data - it never gets read by anything outside this function. this.$set exists purely to make property additions trigger reactivity, which is not needed here, and calling it from a computed property (a side effect) was flagged by vue/no-side-effects-in-computed-properties and vue/no-deprecated-delete-set. A plain assignment is behaviorally identical for a non-reactive object. Co-authored-by: Cursor <cursoragent@cursor.com>
Documents the 10-commit fix (49497ce) that got scripts/Format.ps1 and format.sh working end-to-end for the ClientApp side (Prettier + ESLint), plus what remains open on both the C# and ClientApp fronts. Co-authored-by: Cursor <cursoragent@cursor.com>
Documents why CSharpier was rejected in favor of editorconfig and dotnet format for this repo. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rig branch Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding a ton of new editor config settings and formatting scripts.