├── .github └── workflows │ └── main.yml ├── .gitignore ├── EditorConfigWizard.sln ├── LICENSE ├── README.md └── src └── KristofferStrube.EditorConfigWizard ├── .editorconfig ├── App.razor ├── Extensions ├── HumanizerExtensions.cs └── StringListExtensions.cs ├── JsonConverters └── MultilineStringConverter.cs ├── KristofferStrube.EditorConfigWizard.csproj ├── Models ├── CodeStyleCategory.cs ├── CodeStyleRule.cs ├── OptionValue.cs ├── Options │ ├── OneOfManyValueOptions.cs │ ├── OrderedSetWithOneOrMoreOfManyValueOptions.cs │ └── ValueOptions.cs ├── PresenterTemplate.cs └── RuleOption.cs ├── Pages ├── Index.razor ├── Index.razor.cs ├── Wizard.razor ├── Wizard.razor.cs └── Wizard.razor.css ├── Program.cs ├── Properties └── launchSettings.json ├── Services └── EditorConfigService.cs ├── Shared ├── HighLightedCode.razor ├── HighLightedCode.razor.css ├── HoverColor.cs ├── MainLayout.razor ├── MainLayout.razor.css ├── NavMenu.razor ├── NavMenu.razor.css ├── OneOfManyValueOptionsPicker.razor ├── OrderedSetWithOneOrMoreOfManyValueOptionsPicker.razor ├── OrderedSetWithOneOrMoreOfManyValueOptionsPicker.razor.css └── TemplatePresenter.razor ├── _Imports.razor ├── libman.json └── wwwroot ├── 404.html ├── Schema.json ├── css ├── app.css ├── bootstrap │ ├── bootstrap.min.css │ └── bootstrap.min.css.map └── open-iconic │ ├── FONT-LICENSE │ ├── ICON-LICENSE │ ├── README.md │ └── font │ ├── css │ └── open-iconic-bootstrap.min.css │ └── fonts │ ├── open-iconic.eot │ ├── open-iconic.otf │ ├── open-iconic.svg │ ├── open-iconic.ttf │ └── open-iconic.woff ├── favicon.png ├── icon-192.png ├── index.html ├── language_rules.json ├── lib ├── highlight.min.js └── styles │ └── monokai.min.css └── unnecessary_code_rules.json /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: 'Publish application' 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths-ignore: 8 | - '**/README.md' 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | # Checkout the code 15 | - uses: actions/checkout@v2 16 | 17 | # Install .NET 7.0 SDK 18 | - name: Setup .NET 7 preview 19 | uses: actions/setup-dotnet@v1 20 | with: 21 | dotnet-version: '7.0.x' 22 | include-prerelease: true 23 | 24 | # Generate the website 25 | - name: Publish 26 | run: dotnet publish src/KristofferStrube.EditorConfigWizard/KristofferStrube.EditorConfigWizard.csproj --configuration Release --output build 27 | 28 | # Publish the website 29 | - name: GitHub Pages action 30 | if: ${{ github.ref == 'refs/heads/main' }} # Publish only when the push is on main 31 | uses: peaceiris/actions-gh-pages@v3.6.1 32 | with: 33 | github_token: ${{ secrets.PUBLISH_TOKEN }} 34 | publish_branch: gh-pages 35 | publish_dir: build/wwwroot 36 | allow_empty_commit: false 37 | keep_files: false 38 | force_orphan: true 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /EditorConfigWizard.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31903.59 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KristofferStrube.EditorConfigWizard", "src\KristofferStrube.EditorConfigWizard\KristofferStrube.EditorConfigWizard.csproj", "{74278D59-3294-4457-89F8-32124C311666}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {74278D59-3294-4457-89F8-32124C311666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {74278D59-3294-4457-89F8-32124C311666}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {74278D59-3294-4457-89F8-32124C311666}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {74278D59-3294-4457-89F8-32124C311666}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Kristoffer Strube 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EditorConfig Wizard 2 | This is a EditorConfig Wizard written in Blazor WASM. 3 | The current goal is to support all the standard C#/.NET EditorConfig rules. 4 | 5 | ## Try it out 6 | All options that have currently been registered can be seen at: https://kristofferstrube.github.io/EditorConfigWizard/ 7 | 8 | The Wizard itself can be seen at: https://kristofferstrube.github.io/EditorConfigWizard/wizard 9 | 10 | ## Goals 11 | - [ ] Define all Rules and be able to present them. 12 | - [ ] Be able to parse an existing EditorConfig file. 13 | - [ ] Be able to edit an EditorConfig file. 14 | - [x] Be able to generate new EditorConfig files. 15 | - [ ] Be able to compare two EditorConfig files and present their differences. 16 | 17 | ## Example 18 | An EditorConfig file could have the following content: 19 | ```ini 20 | [*.{cs,vb}] 21 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity 22 | dotnet_diagnostic.IDE0048.severity = suggestion 23 | ``` 24 | 25 | The first line specifies that this applies to `.cs` and `.vb` files. 26 | 27 | The second line specifies that the editor will try to always have parenthesis around arithmetic sub expressions where it could be confusing to know which would be calculated first like in `1 + 2 * 3` which might be read like `(1 + 2) * 3` if you are not trained in the precedence of arithmetic operators whereas it would be more clear to write `1 + (2 * 3)`. The other possible value for this option is `never_if_unnecessary` which obviously has the opposite effect. 28 | 29 | *(`dotnet_style_parentheses_in_arithmetic_binary_operators` is a part of the rule with Id `IDE0048`)* 30 | 31 | The third line specifies that this rule should be prompted to the user in the form of a suggestion. We could likewise have chosen to have it appear as a `warning` or an `error` or have hidden or disabled it with `silent` or `none`. 32 | 33 | We would like to be able to present a sample for this which could be the following so that people can make a qualified choice with a quick glance. 34 | ### always_for_clarity 35 | Prefer parentheses to clarify arithmetic operator precedence. 36 | ```csharp 37 | var v = a + (b * c); 38 | ``` 39 | ### never_if_unnecessary 40 | Prefer no parentheses when arithmetic operator precedence is obvious. 41 | ```csharp 42 | var v = a + b * c; 43 | ``` 44 | ## Sample EditorConfigs out in the wild 45 | While exploring this I have found some prominent examples used by professionals in the industry and big open source projects. Here are a few: 46 | - [dotnet/razor/.editorconfig](https://github.com/dotnet/razor/blob/main/.editorconfig) 47 | - [David McCarter's EditorConfig](https://gist.github.com/RealDotNetDave/dbae4d97358ba4515dd52e5b8ca87671) 48 | - [Mads Kristensen's EditorConfig](https://github.com/madskristensen/MIDL/blob/master/.editorconfig) 49 | 50 | We would like to eventually make it possible to cover many of the same rules that they use and to compare ones own config to theirs. 51 | 52 | # Issues 53 | Feel free to open issues on the repository if you find any errors with the project or have wishes for features. 54 | 55 | ## Related articles 56 | - [Rendering dynamic content in Blazor Wasm using DynamicComponent](https://blog.elmah.io/rendering-dynamic-content-in-blazor-wasm-using-dynamiccomponent/) 57 | - [The Blazor NavigationManager](https://kristoffer-strube.dk/post/the-blazor-navigationmanager/) 58 | 59 | ## Checklist for rules 60 | ### Code quality rules 61 | #### Design rules 62 | - unquantified 63 | #### Documentation rules 64 | - unquantified 65 | #### Gloablization rules 66 | - unquantified 67 | #### Portability and interopability rules 68 | - unquantified 69 | #### Maintainability rules rules 70 | - unquantified 71 | #### Naming rules 72 | - unquantified 73 | #### Performance rules 74 | - unquantified 75 | #### SingleFile rules 76 | - unquantified 77 | #### Reliability rules 78 | - unquantified 79 | #### Security rules 80 | - unquantified 81 | #### Uage rules 82 | - unquantified 83 | ### Code style rules 84 | #### Language rules 85 | - [x] IDE0003 86 | - [x] IDE0049 87 | - [x] IDE0036 88 | - [x] IDE0040 89 | - [x] IDE0044 90 | - [x] IDE0062 91 | - [x] IDE0047 92 | - [x] IDE0048 93 | - [x] IDE0010 94 | - [x] IDE0017 95 | - [x] IDE0018 96 | - [x] IDE0028 97 | - [x] IDE0032 98 | - [x] IDE0033 99 | - [x] IDE0034 100 | - [x] IDE0037 101 | - [x] IDE0039 102 | - [x] IDE0042 103 | - [x] IDE0045 104 | - [x] IDE0046 105 | - [x] IDE0054 106 | - [x] IDE0056 107 | - [x] IDE0057 108 | - [x] IDE0070 109 | - [x] IDE0071 110 | - [x] IDE0072 111 | - [x] IDE0074 112 | - [x] IDE0075 113 | - [x] IDE0082 114 | - [x] IDE0090 115 | - [x] IDE0180 116 | - [x] IDE0160 117 | - [x] IDE0161 118 | - [x] IDE0016 119 | - [x] IDE0029 120 | - [x] IDE0030 121 | - [x] IDE0031 122 | - [x] IDE0041 123 | - [x] IDE0150 124 | - [x] IDE1005 125 | - [x] IDE0007 126 | - [x] IDE0008 127 | - [ ] IDE0021 128 | - [ ] IDE0022 129 | - [ ] IDE0023 130 | - [ ] IDE0024 131 | - [ ] IDE0025 132 | - [ ] IDE0026 133 | - [ ] IDE0027 134 | - [ ] IDE0053 135 | - [ ] IDE0061 136 | - [ ] IDE0019 137 | - [ ] IDE0020 138 | - [ ] IDE0038 139 | - [ ] IDE0066 140 | - [ ] IDE0078 141 | - [ ] IDE0083 142 | - [ ] IDE0084 143 | - [ ] IDE0170 144 | - [ ] IDE0011 145 | - [ ] IDE0063 146 | - [ ] IDE0065 147 | - [ ] IDE0073 148 | - [ ] IDE0130 149 | #### Unnecesary code rules 150 | - [x] IDE0001 151 | - [x] IDE0002 152 | - [x] IDE0004 153 | - [x] IDE0005 154 | - [x] IDE0035 155 | - [x] IDE0051 156 | - [x] IDE0052 157 | - [x] IDE0058 158 | - [x] IDE0059 159 | - [ ] IDE0060 160 | - [ ] IDE0079 161 | - [ ] IDE0080 162 | - [ ] IDE0081 163 | - [ ] IDE0100 164 | - [ ] IDE0110 165 | - [ ] IDE0140 166 | #### Miscelllaneous rules 167 | - [ ] IDE0076 168 | - [ ] IDE0077 169 | #### Formatting rules 170 | - [ ] IDE0055 171 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | # All files 3 | [*] 4 | dotnet_style_qualification_for_field = false 5 | dotnet_style_qualification_for_property = false 6 | dotnet_style_qualification_for_method = false 7 | dotnet_style_qualification_for_event = false 8 | dotnet_diagnostic.IDE0003.severity = warning 9 | dotnet_style_predefined_type_for_locals_parameters_members = true 10 | dotnet_style_predefined_type_for_member_access = true 11 | dotnet_diagnostic.IDE0049.severity = error 12 | csharp_preferred_modifier_order = public,private,protected,file,internal,static,new,virtual,abstract,sealed,override,readonly,required,async 13 | dotnet_diagnostic.IDE0036.severity = suggestion 14 | dotnet_style_require_accessibility_modifiers = always 15 | dotnet_diagnostic.IDE0040.severity = error 16 | dotnet_style_readonly_field = true 17 | dotnet_diagnostic.IDE0044.severity = error 18 | csharp_prefer_static_local_function = true 19 | dotnet_diagnostic.IDE0062.severity = error 20 | dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity 21 | dotnet_diagnostic.IDE0047.severity = suggestion 22 | dotnet_diagnostic.IDE0048.severity = suggestion 23 | 24 | 25 | # Xml files 26 | [*.xml] 27 | indent_size = 2 28 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Not found 8 | 9 |

Sorry, there's nothing at this address.

10 |
11 |
12 |
13 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Extensions/HumanizerExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace KristofferStrube.EditorConfigWizard.Extensions; 2 | 3 | public static class HumanizerExtensions 4 | { 5 | public static string Pluralize(this int value, string unit) 6 | { 7 | if (value == 1) 8 | { 9 | return $"{value} {unit}"; 10 | } 11 | if (unit.EndsWith("y")) 12 | { 13 | return $"{value} {unit[..^1]}ies"; 14 | } 15 | return $"{value} {unit}s"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Extensions/StringListExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace KristofferStrube.EditorConfigWizard; 2 | 3 | public static class StringListExtensions 4 | { 5 | public static string AsMultilineString(this List list) 6 | { 7 | return string.Join("\n", list); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/JsonConverters/MultilineStringConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | using System.Text.Json.Serialization; 3 | using static System.Text.Json.JsonSerializer; 4 | 5 | namespace KristofferStrube.EditorConfigWizard.JsonConverters; 6 | 7 | public class MultilineStringConverter : JsonConverter 8 | { 9 | public override string Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 10 | { 11 | if (JsonDocument.TryParseValue(ref reader, out JsonDocument? doc)) 12 | { 13 | if (doc.RootElement.ValueKind is JsonValueKind.Array) 14 | { 15 | return string.Join("\n", doc.RootElement.EnumerateArray().Select(element => element.Deserialize())); 16 | } 17 | return doc.Deserialize()!; 18 | } 19 | throw new JsonException("Could not be parsed as a JsonDocument."); 20 | } 21 | 22 | public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options) 23 | { 24 | string[] lineSplittetString = value.Split('\n'); 25 | if (lineSplittetString.Length is 1) 26 | { 27 | writer.WriteRawValue(Serialize(value, options)); 28 | } 29 | else if (value is not null) 30 | { 31 | writer.WriteStartArray(); 32 | foreach (string element in lineSplittetString) 33 | { 34 | writer.WriteRawValue(Serialize(element, options)); 35 | } 36 | writer.WriteEndArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/KristofferStrube.EditorConfigWizard.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net7.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/CodeStyleCategory.cs: -------------------------------------------------------------------------------- 1 | namespace KristofferStrube.EditorConfigWizard.Models; 2 | 3 | public record CodeStyleCategory(string Title, string Description, List CodeStyleRules) 4 | { 5 | public bool Used { get; set; } 6 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/CodeStyleRule.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard.JsonConverters; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace KristofferStrube.EditorConfigWizard.Models; 5 | 6 | public class CodeStyleRule 7 | { 8 | 9 | public string Id { get; set; } = ""; 10 | 11 | public string Title { get; set; } = ""; 12 | 13 | [JsonConverter(typeof(MultilineStringConverter))] 14 | public string Sample { get; set; } = ""; 15 | 16 | [JsonConverter(typeof(MultilineStringConverter))] 17 | public string FixedSample { get; set; } = ""; 18 | 19 | public List Options { get; set; } = new(); 20 | } 21 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/OptionValue.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard.JsonConverters; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace KristofferStrube.EditorConfigWizard.Models; 5 | 6 | public class OptionValue 7 | { 8 | public string Value { get; set; } = ""; 9 | 10 | public string Description { get; set; } = ""; 11 | 12 | [JsonConverter(typeof(MultilineStringConverter))] 13 | public string Sample { get; set; } = ""; 14 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/Options/OneOfManyValueOptions.cs: -------------------------------------------------------------------------------- 1 | namespace KristofferStrube.EditorConfigWizard.Models.Options 2 | { 3 | public class OneOfManyValueOptions : ValueOptions 4 | { 5 | public List Options { get; set; } = new(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/Options/OrderedSetWithOneOrMoreOfManyValueOptions.cs: -------------------------------------------------------------------------------- 1 | namespace KristofferStrube.EditorConfigWizard.Models.Options 2 | { 3 | public class OrderedSetWithOneOrMoreOfManyValueOptions : ValueOptions 4 | { 5 | public List Options { get; set; } = new(); 6 | public string Description { get; set; } = ""; 7 | public string EncodedValueSeperator { get; set; } = " "; 8 | public string PresenterSeperator { get; set; } = " "; 9 | public PresenterTemplate[] PresenterTemplates { get; set; } = default!; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/Options/ValueOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace KristofferStrube.EditorConfigWizard.Models.Options; 4 | 5 | [JsonDerivedType(typeof(OneOfManyValueOptions), "OneOfMany")] 6 | [JsonDerivedType(typeof(OrderedSetWithOneOrMoreOfManyValueOptions), "OrderedSetWithOneOrMoreOfMany")] 7 | public class ValueOptions 8 | { 9 | public string DefaultOptionValue { get; set; } = ""; 10 | } 11 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/PresenterTemplate.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard.JsonConverters; 2 | using System.Text.Json.Serialization; 3 | 4 | namespace KristofferStrube.EditorConfigWizard.Models; 5 | 6 | public class PresenterTemplate 7 | { 8 | public string[] OptionsApplying { get; set; } = default!; 9 | 10 | [JsonConverter(typeof(MultilineStringConverter))] 11 | public string Template { get; set; } = ""; 12 | 13 | public string TemplateToken { get; set; } = ""; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Models/RuleOption.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard.Models.Options; 2 | 3 | namespace KristofferStrube.EditorConfigWizard.Models; 4 | 5 | public record RuleOption(string Name, ValueOptions ValueOptions) 6 | { 7 | } 8 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @page "/" 2 | 3 |

Code-style Rules for C#/.NET EditorConfig

4 |

This page lists the rules that are currently supported, their options, and corresponding code samples.

5 |
6 | 7 | 8 |
    9 | @foreach (var codeStyleRule in FilteredCodeStyleRules) 10 | { 11 | @foreach (var option in codeStyleRule.Options) 12 | { 13 |
  • 14 |
    15 | 16 | @option.Name - @codeStyleRule.Title (@codeStyleRule.Id) 17 | 18 | @if (option.ValueOptions is OneOfManyValueOptions oneOfMany) 19 | { 20 |
      21 | @foreach (var optionValue in oneOfMany.Options) 22 | { 23 |
    • 24 | @optionValue.Value - 25 | @optionValue.Description 26 | 27 |
    • 28 | } 29 |
    30 | } 31 | else if (option.ValueOptions is OrderedSetWithOneOrMoreOfManyValueOptions orderedSet) 32 | { 33 |

    34 | This rule takes an ordered list of the following options without repititions. 35 |

    36 |
      37 | @foreach (var value in orderedSet.Options) 38 | { 39 |
    1. 40 |
      41 | @value 42 |
      43 |
    2. 44 | } 45 |
    46 | } 47 |
    48 |
  • 49 | } 50 | } 51 |
52 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Pages/Index.razor.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard.Models; 2 | using KristofferStrube.EditorConfigWizard.Services; 3 | using Microsoft.AspNetCore.Components; 4 | 5 | namespace KristofferStrube.EditorConfigWizard.Pages; 6 | 7 | public partial class Index 8 | { 9 | private List codeStyleRules = new(); 10 | 11 | private IQueryable FilteredCodeStyleRules => codeStyleRules 12 | .Where(r => r.Id.Contains(search, StringComparison.OrdinalIgnoreCase) 13 | || r.Title.Contains(search, StringComparison.OrdinalIgnoreCase) 14 | || r.Options.Any(o => o.Name.Contains(search, StringComparison.OrdinalIgnoreCase))) 15 | .AsQueryable(); 16 | 17 | [Inject] 18 | public EditorConfigService ConfigService { get; set; } 19 | 20 | private string search = string.Empty; 21 | 22 | protected override async Task OnInitializedAsync() 23 | { 24 | codeStyleRules = (await ConfigService.LanguagesRulesAsync()).CodeStyleRules 25 | .Concat((await ConfigService.UnnecessaryColeRulesAsync()).CodeStyleRules) 26 | .ToList(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Pages/Wizard.razor: -------------------------------------------------------------------------------- 1 | @page "/Wizard" 2 | 3 |
4 |
5 | @if (progress is not 0) 6 | { 7 | 8 | } 9 |
10 |

11 | @if (progress is not 0 && progress != totalQuestions + 1) 12 | { 13 | Question @progress of @totalQuestions 14 | } 15 |

16 | 17 |
18 |
19 | @if (currentCodeStyleRule is null && codeRuleIndex != codeStyleRules.Count) 20 | { 21 |
22 |

Create an EditorConfig file for your .NET/C# project.

23 |
24 |
25 |

26 | Select Categories 27 |

28 | 29 |
30 | @foreach (var category in codeStyleCategories) 31 | { 32 |
33 | 34 | 35 |
36 |

@category.Description

37 | } 38 |
39 | 40 |
41 | } 42 | else if (currentRuleOption is not null) 43 | { 44 |
45 |
46 |

47 | @((MarkupString)string.Join("_", currentRuleOption.Name.Split("_").Select(part => $"{part}"))) 48 |  – @currentCodeStyleRule.Title (@currentCodeStyleRule.Id) 49 |

50 |
51 |
52 |
53 |

Which do you prefer?

54 |
55 | @if (currentRuleOption.ValueOptions is OneOfManyValueOptions oneOfMany) 56 | { 57 | 58 | } 59 | else if (currentRuleOption.ValueOptions is OrderedSetWithOneOrMoreOfManyValueOptions orderedSet) 60 | { 61 | 62 | } 63 |
64 |
65 | } 66 | else if (ruleOptionIndex == currentCodeStyleRule?.Options.Count) 67 | { 68 |
69 |

70 | What severity should @(ruleOptionIndex is 0 or 1 ? "this rule" : "these rules") be prompted as? 71 |

72 |
73 |
74 |
75 |

76 | @currentCodeStyleRule.Id: "@currentCodeStyleRule.Title" 77 |

78 |
79 |
80 | 81 | 82 | 83 | 84 | 85 |
86 | @if (currentCodeStyleRule.Sample is { Length: > 0 } sample) 87 | { 88 | Sample 89 |
90 | 91 |
92 | } 93 | @if (currentCodeStyleRule.FixedSample is { Length: > 0 } fixedSample) 94 | { 95 | Fixed 96 |
97 | 98 |
99 | } 100 |
101 | } 102 | else 103 | { 104 |
105 |

106 |
This is your new EditorConfig
107 |

108 |
109 |
110 | 111 |
112 |
113 | 114 |
115 | } 116 |
-------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Pages/Wizard.razor.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard.Models; 2 | using KristofferStrube.EditorConfigWizard.Models.Options; 3 | using KristofferStrube.EditorConfigWizard.Services; 4 | using Microsoft.AspNetCore.Components; 5 | using Microsoft.JSInterop; 6 | using System.Text; 7 | 8 | namespace KristofferStrube.EditorConfigWizard.Pages; 9 | 10 | public partial class Wizard : ComponentBase 11 | { 12 | private const int TRANSITION_TIME = 200; 13 | 14 | private CodeStyleRule? currentCodeStyleRule = null; 15 | private RuleOption? currentRuleOption = null; 16 | private List optionChoices = new(); 17 | private List codeStyleRules = new(); 18 | private string fadeClass = ""; 19 | private int codeRuleIndex = -1; 20 | private int ruleOptionIndex = 0; 21 | private readonly Dictionary ruleOptionChoices = new(); 22 | private readonly Dictionary severities = new(); 23 | private string newEditorConfig = ""; 24 | private int totalQuestions; 25 | private int progress; 26 | 27 | private readonly List codeStyleCategories = new(); 28 | 29 | [Inject] 30 | public EditorConfigService ConfigService { get; set; } = default!; 31 | 32 | [Inject] 33 | public IJSRuntime JSRuntime { get; set; } = default!; 34 | 35 | [Inject] 36 | public NavigationManager NavigationManager { get; set; } = default!; 37 | 38 | protected override async Task OnInitializedAsync() 39 | { 40 | codeStyleCategories.Add(await ConfigService.LanguagesRulesAsync()); 41 | codeStyleCategories.Add(await ConfigService.UnnecessaryColeRulesAsync()); 42 | NavigationManager.RegisterLocationChangingHandler(async (context) => 43 | { 44 | if (context.HistoryEntryState is null && context.TargetLocation.EndsWith("wizard")) 45 | { 46 | await ChangeAsync(() => 47 | { 48 | codeRuleIndex = -1; 49 | currentCodeStyleRule = null; 50 | progress = 0; 51 | StateHasChanged(); 52 | }); 53 | } 54 | else if (context.HistoryEntryState == (progress - 1).ToString()) 55 | { 56 | await ChangeAsync(() => 57 | { 58 | progress--; 59 | if (codeRuleIndex == codeStyleRules.Count && currentCodeStyleRule is null) 60 | { 61 | codeRuleIndex--; 62 | currentCodeStyleRule = codeStyleRules.Last(); 63 | ruleOptionIndex = currentCodeStyleRule.Options.Count; 64 | currentRuleOption = null; 65 | optionChoices = currentCodeStyleRule.Options 66 | .Select(o => o.ValueOptions is OrderedSetWithOneOrMoreOfManyValueOptions ? o.ValueOptions.DefaultOptionValue : null) 67 | .ToList(); 68 | } 69 | else if (ruleOptionIndex is not 0) 70 | { 71 | ruleOptionIndex--; 72 | currentRuleOption = currentCodeStyleRule.Options[ruleOptionIndex]; 73 | } 74 | else 75 | { 76 | codeRuleIndex--; 77 | currentCodeStyleRule = codeStyleRules[codeRuleIndex]; 78 | ruleOptionIndex = currentCodeStyleRule.Options.Count; 79 | currentRuleOption = null; 80 | optionChoices = currentCodeStyleRule.Options 81 | .Select(o => o.ValueOptions is OrderedSetWithOneOrMoreOfManyValueOptions ? o.ValueOptions.DefaultOptionValue : null) 82 | .ToList(); 83 | } 84 | StateHasChanged(); 85 | }); 86 | } 87 | }); 88 | } 89 | 90 | private async Task Begin() 91 | { 92 | codeStyleRules = codeStyleCategories 93 | .Where(category => category.Used) 94 | .SelectMany(category => category.CodeStyleRules) 95 | .ToList(); 96 | totalQuestions = codeStyleRules.Count + codeStyleRules.Sum(rule => rule.Options.Count); 97 | await IncrementCodeRule(); 98 | } 99 | 100 | private async Task IncrementCodeRule() 101 | { 102 | await ChangeAsync(() => 103 | { 104 | progress++; 105 | codeRuleIndex++; 106 | ruleOptionIndex = 0; 107 | if (codeRuleIndex == codeStyleRules.Count) 108 | { 109 | GenerateNewEditorConfig(); 110 | currentCodeStyleRule = null; 111 | NavigationManager.NavigateTo("wizard", new NavigationOptions() { HistoryEntryState = progress.ToString() }); 112 | return; 113 | } 114 | currentCodeStyleRule = codeStyleRules[codeRuleIndex]; 115 | if (ruleOptionIndex != currentCodeStyleRule.Options.Count) 116 | { 117 | currentRuleOption = currentCodeStyleRule.Options[ruleOptionIndex]; 118 | optionChoices = currentCodeStyleRule.Options 119 | .Select(o => o.ValueOptions is OrderedSetWithOneOrMoreOfManyValueOptions ? o.ValueOptions.DefaultOptionValue : null) 120 | .ToList(); 121 | } 122 | NavigationManager.NavigateTo("wizard", new NavigationOptions() { HistoryEntryState = progress.ToString() }); 123 | }); 124 | } 125 | 126 | private async Task IncrementRuleOption() 127 | { 128 | await ChangeAsync(() => 129 | { 130 | progress++; 131 | ruleOptionChoices[currentRuleOption.Name] = optionChoices[ruleOptionIndex]; 132 | ruleOptionIndex++; 133 | if (ruleOptionIndex == currentCodeStyleRule.Options.Count) 134 | { 135 | currentRuleOption = null; 136 | } 137 | else 138 | { 139 | currentRuleOption = currentCodeStyleRule.Options[ruleOptionIndex]; 140 | } 141 | NavigationManager.NavigateTo("wizard", new NavigationOptions() { HistoryEntryState = progress.ToString() }); 142 | }); 143 | } 144 | 145 | private void GenerateNewEditorConfig() 146 | { 147 | StringBuilder editorConfigSB = new StringBuilder(); 148 | editorConfigSB.AppendLine("[*]"); 149 | editorConfigSB.AppendLine("# All files"); 150 | foreach (CodeStyleRule codeRule in codeStyleRules) 151 | { 152 | foreach (RuleOption option in codeRule.Options) 153 | { 154 | editorConfigSB.AppendLine($"{option.Name} = {ruleOptionChoices[option.Name]}"); 155 | } 156 | foreach (string id in codeRule.Id.Split(',')) 157 | { 158 | editorConfigSB.AppendLine($"dotnet_diagnostic.{id}.severity = {severities[codeRule.Id]}"); 159 | } 160 | } 161 | newEditorConfig = editorConfigSB.ToString(); 162 | } 163 | 164 | private async Task ChangeAsync(Action action) 165 | { 166 | fadeClass = "fade-out"; 167 | StateHasChanged(); 168 | await Task.Delay(TRANSITION_TIME); 169 | action(); 170 | fadeClass = "fade-in"; 171 | StateHasChanged(); 172 | await Task.Delay(TRANSITION_TIME); 173 | fadeClass = ""; 174 | StateHasChanged(); 175 | } 176 | 177 | private async Task SelectOptionAsync(int choice, string value) 178 | { 179 | optionChoices[choice] = value; 180 | await IncrementRuleOption(); 181 | StateHasChanged(); 182 | } 183 | 184 | private async Task SetSeverityAsync(string severity) 185 | { 186 | severities[currentCodeStyleRule.Id] = severity; 187 | await IncrementCodeRule(); 188 | } 189 | 190 | private async Task CopyToClipboardAsync() 191 | { 192 | await JSRuntime.InvokeVoidAsync("navigator.clipboard.writeText", newEditorConfig); 193 | } 194 | 195 | private async Task GoBackAsync() 196 | { 197 | await JSRuntime.InvokeVoidAsync("history.back"); 198 | } 199 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Pages/Wizard.razor.css: -------------------------------------------------------------------------------- 1 | /* Keep timings in sync with delays in `ChangeAsync` */ 2 | .fade-out { 3 | transition: opacity 200ms ease-in; 4 | opacity: 0; 5 | pointer-events: none; 6 | } 7 | 8 | .fade-in { 9 | transition: opacity 200ms ease-in; 10 | opacity: 1; 11 | pointer-events: none; 12 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Program.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard; 2 | using KristofferStrube.EditorConfigWizard.Services; 3 | using Microsoft.AspNetCore.Components.Web; 4 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 5 | 6 | WebAssemblyHostBuilder builder = WebAssemblyHostBuilder.CreateDefault(args); 7 | builder.RootComponents.Add("#app"); 8 | builder.RootComponents.Add("head::after"); 9 | 10 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 11 | builder.Services.AddScoped(); 12 | 13 | await builder.Build().RunAsync(); 14 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:2384", 7 | "sslPort": 44340 8 | } 9 | }, 10 | "profiles": { 11 | "http": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 16 | "applicationUrl": "http://localhost:5168", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 26 | "applicationUrl": "https://localhost:7253;http://localhost:5168", 27 | "environmentVariables": { 28 | "ASPNETCORE_ENVIRONMENT": "Development" 29 | } 30 | }, 31 | "IIS Express": { 32 | "commandName": "IISExpress", 33 | "launchBrowser": true, 34 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 35 | "environmentVariables": { 36 | "ASPNETCORE_ENVIRONMENT": "Development" 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Services/EditorConfigService.cs: -------------------------------------------------------------------------------- 1 | using KristofferStrube.EditorConfigWizard.Models; 2 | using System.Net.Http.Json; 3 | 4 | namespace KristofferStrube.EditorConfigWizard.Services; 5 | 6 | public class EditorConfigService 7 | { 8 | private readonly Lazy>> languagesRulesTask; 9 | private readonly Lazy>> unnecessaryCodeRulesTask; 10 | 11 | public EditorConfigService(HttpClient httpClient) 12 | { 13 | languagesRulesTask = new(async () => await httpClient.GetFromJsonAsync>("language_rules.json") ?? new()); 14 | unnecessaryCodeRulesTask = new(async () => await httpClient.GetFromJsonAsync>("unnecessary_code_rules.json") ?? new()); 15 | } 16 | 17 | public async Task LanguagesRulesAsync() 18 | { 19 | return new("Language rules", "Rules that pertain to the C# language. For example, you can specify rules that regard the use of var when defining variables, or whether expression-bodied members are preferred.", await languagesRulesTask.Value) 20 | { 21 | Used = true, 22 | }; 23 | } 24 | 25 | public async Task UnnecessaryColeRulesAsync() 26 | { 27 | return new("Unnecessary code rules", "Rules that pertain to unnecessary code that indicates a potential readability, maintainability, performance, or functional problem. For example, unreachable code within methods or unused private fields, properties, or methods is unnecessary code.", await unnecessaryCodeRulesTask.Value) 28 | { 29 | Used = true, 30 | }; 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/HighLightedCode.razor: -------------------------------------------------------------------------------- 1 | @using System.Text 2 | @inject IJSRuntime JSRuntime 3 | 4 | @if (OnClick is not null) 5 | { 6 | 13 | } 14 | else 15 | { 16 |
17 |         
18 |             @Code.Trim()
19 |         
20 |     
21 | } 22 | 23 | @code { 24 | private ElementReference codeBlock; 25 | 26 | private string commonClasses = "text-start"; 27 | 28 | private string? hoverClasses; 29 | 30 | [Parameter, EditorRequired] 31 | public string Code { get; set; } = ""; 32 | 33 | [Parameter, EditorRequired] 34 | public string Language { get; set; } = ""; 35 | 36 | [Parameter] 37 | public Color? BorderHoverColor { get; set; } 38 | 39 | [Parameter] 40 | public Color? BorderColor { get; set; } 41 | 42 | [Parameter] 43 | public Func? OnClick { get; set; } 44 | 45 | protected override void OnParametersSet() 46 | { 47 | var hasHover = BorderHoverColor is not null || BorderColor is not null; 48 | 49 | if (hasHover) 50 | { 51 | var sb = new StringBuilder(); 52 | 53 | if (BorderHoverColor is not null) 54 | { 55 | sb.Append($"{BorderHoverColor.Value.ToString().ToLower()}-hover "); 56 | } 57 | if (BorderColor is not null) 58 | { 59 | sb.Append($"{BorderColor.Value.ToString().ToLower()} "); 60 | } 61 | 62 | sb.Append("hasHover"); 63 | hoverClasses = sb.ToString(); 64 | } 65 | } 66 | 67 | protected override async Task OnAfterRenderAsync(bool firstRender) 68 | { 69 | if (!firstRender) return; 70 | 71 | await JSRuntime.InvokeVoidAsync("hljs.highlightElement", codeBlock); 72 | } 73 | 74 | async Task InvokeAction() 75 | { 76 | if (OnClick is null) return; 77 | await OnClick(); 78 | } 79 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/HighLightedCode.razor.css: -------------------------------------------------------------------------------- 1 | .hasHover { 2 | border: 4px solid transparent; 3 | } 4 | 5 | button { 6 | background: none !important; 7 | padding: 0 !important; 8 | border-radius: 14px !important; 9 | width: 100% !important; 10 | } 11 | 12 | pre { 13 | border-radius: 10px; /* border-radius of button minus border-width of .hasHover */ 14 | margin-inline: 0; 15 | margin-block: 0.5rem; 16 | width: 100%; 17 | } 18 | 19 | button pre { 20 | margin: 0; 21 | } 22 | 23 | code { 24 | max-height: 70vh; 25 | } 26 | 27 | .red-hover:hover { 28 | border: 4px solid red; 29 | } 30 | 31 | .red-hover:focus { 32 | outline-color: red; 33 | outline-style: solid; 34 | outline-offset: -4px; 35 | outline-width: 4px; 36 | } 37 | 38 | .green-hover:hover { 39 | border: 4px solid green; 40 | } 41 | 42 | .green-hover:focus { 43 | outline-color: green; 44 | outline-style: solid; 45 | outline-offset: -4px; 46 | outline-width: 4px; 47 | } 48 | 49 | .yellow-hover:hover { 50 | border: 4px solid orange; 51 | } 52 | 53 | .yellow-hover:focus { 54 | outline-color: orange; 55 | outline-style: solid; 56 | outline-offset: -4px; 57 | outline-width: 4px; 58 | } 59 | 60 | .red { 61 | background-color: red; 62 | } 63 | 64 | .green { 65 | background-color: green; 66 | } 67 | 68 | .yellow { 69 | background-color: orange; 70 | } 71 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/HoverColor.cs: -------------------------------------------------------------------------------- 1 | namespace KristofferStrube.EditorConfigWizard.Shared; 2 | 3 | public enum Color 4 | { 5 | Green, 6 | Red, 7 | Yellow 8 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | @inject NavigationManager NavigationManager 3 | 4 |
5 | 8 | 9 |
10 |
11 | 12 | 13 | 14 |
15 | 16 |
17 | @Body 18 |
19 |
20 |
21 | 22 | @code { 23 | private string relativeUri => NavigationManager.ToBaseRelativePath(NavigationManager.Uri); 24 | 25 | protected string page => (string.IsNullOrEmpty(relativeUri) ? "Index" : relativeUri) + ".razor"; 26 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/MainLayout.razor.css: -------------------------------------------------------------------------------- 1 | .page { 2 | position: relative; 3 | display: flex; 4 | flex-direction: column; 5 | } 6 | 7 | main { 8 | flex: 1; 9 | } 10 | 11 | .sidebar { 12 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 13 | } 14 | 15 | .top-row { 16 | background-color: #f7f7f7; 17 | border-bottom: 1px solid #d6d5d5; 18 | justify-content: flex-end; 19 | height: 3.5rem; 20 | display: flex; 21 | align-items: center; 22 | } 23 | 24 | .top-row ::deep a, .top-row ::deep .btn-link { 25 | white-space: nowrap; 26 | margin-left: 1.5rem; 27 | text-decoration: none; 28 | } 29 | 30 | .top-row ::deep a:hover, .top-row ::deep .btn-link:hover { 31 | text-decoration: underline; 32 | } 33 | 34 | .top-row ::deep a:first-child { 35 | overflow: hidden; 36 | text-overflow: ellipsis; 37 | } 38 | 39 | @media (max-width: 767.98px) { 40 | .top-row:not(.auth) { 41 | display: none; 42 | } 43 | 44 | .top-row.auth { 45 | justify-content: space-between; 46 | } 47 | 48 | .top-row ::deep a, .top-row ::deep .btn-link { 49 | margin-left: 0; 50 | } 51 | } 52 | 53 | @media (min-width: 768px) { 54 | .page { 55 | flex-direction: row; 56 | } 57 | 58 | .sidebar { 59 | width: 250px; 60 | height: 100vh; 61 | position: sticky; 62 | top: 0; 63 | } 64 | 65 | .top-row { 66 | position: sticky; 67 | top: 0; 68 | z-index: 1; 69 | } 70 | 71 | .top-row.auth ::deep a:first-child { 72 | flex: 1; 73 | text-align: right; 74 | width: 0; 75 | } 76 | 77 | .top-row, article { 78 | padding-left: 2rem !important; 79 | padding-right: 1.5rem !important; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  9 | 10 | 24 | 25 | @code { 26 | private bool collapseNavMenu = true; 27 | 28 | private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null; 29 | 30 | private void ToggleNavMenu() 31 | { 32 | collapseNavMenu = !collapseNavMenu; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/NavMenu.razor.css: -------------------------------------------------------------------------------- 1 | .navbar-toggler { 2 | background-color: rgba(255, 255, 255, 0.1); 3 | } 4 | 5 | .top-row { 6 | height: 3.5rem; 7 | background-color: rgba(0,0,0,0.4); 8 | } 9 | 10 | .navbar-brand { 11 | font-size: 1.1rem; 12 | } 13 | 14 | .oi { 15 | width: 2rem; 16 | font-size: 1.1rem; 17 | vertical-align: text-top; 18 | top: -2px; 19 | } 20 | 21 | .nav-item { 22 | font-size: 0.9rem; 23 | padding-bottom: 0.5rem; 24 | } 25 | 26 | .nav-item:first-of-type { 27 | padding-top: 1rem; 28 | } 29 | 30 | .nav-item:last-of-type { 31 | padding-bottom: 1rem; 32 | } 33 | 34 | .nav-item ::deep a { 35 | color: #d7d7d7; 36 | border-radius: 4px; 37 | height: 3rem; 38 | display: flex; 39 | align-items: center; 40 | line-height: 3rem; 41 | } 42 | 43 | .nav-item ::deep a.active { 44 | background-color: rgba(255,255,255,0.25); 45 | color: white; 46 | } 47 | 48 | .nav-item ::deep a:hover { 49 | background-color: rgba(255,255,255,0.1); 50 | color: white; 51 | } 52 | 53 | @media (min-width: 768px) { 54 | .navbar-toggler { 55 | display: none; 56 | } 57 | 58 | .collapse { 59 | /* Never collapse the sidebar for wide screens */ 60 | display: block; 61 | } 62 | 63 | .nav-scrollable { 64 | /* Allow sidebar to scroll for tall menus */ 65 | height: calc(100vh - 3.5rem); 66 | overflow-y: auto; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/OneOfManyValueOptionsPicker.razor: -------------------------------------------------------------------------------- 1 | 
    2 | @foreach (var optionValue in ValueOptions.Options) 3 | { 4 |
  • 5 |
    6 | @optionValue.Value @(optionValue.Value == ValueOptions.DefaultOptionValue ? " (default)" : "") 7 |
    8 |

    @optionValue.Description

    9 | 15 |
  • 16 | } 17 |
18 | 19 | @code { 20 | [Parameter] 21 | public OneOfManyValueOptions ValueOptions { get; set; } 22 | 23 | [Parameter] 24 | public Func SelectOption { get; set; } 25 | 26 | [Parameter] 27 | public string OptionChoice { get; set; } 28 | } 29 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/OrderedSetWithOneOrMoreOfManyValueOptionsPicker.razor: -------------------------------------------------------------------------------- 1 | 

2 | @ValueOptions.Description 3 |

4 |

Currently selected Options

5 |
6 | @for (int i = 0; i < selectedOptions.Count(); i++) 7 | { 8 | var value = selectedOptions[i]; 9 |
10 |
11 |
@(i+1).
12 | @value 13 |
14 |
15 | < 16 | X 17 | > 18 |
19 |
20 | } 21 |
22 | @if (nonSelectedOptions.Count() > 0) 23 | { 24 |

Non-selected options

25 |
26 | @foreach (var value in nonSelectedOptions) 27 | { 28 |
29 | @value 30 |
31 | + 32 |
33 |
34 | } 35 |
36 | } 37 |

38 | Samples 39 |

40 | @foreach(var template in ValueOptions.PresenterTemplates) 41 | { 42 | 43 | } 44 | 45 | 46 | @code { 47 | private List selectedOptions = new(); 48 | private List nonSelectedOptions = new(); 49 | 50 | [Parameter] 51 | public OrderedSetWithOneOrMoreOfManyValueOptions ValueOptions { get; set; } 52 | 53 | [Parameter] 54 | public Func SelectOption { get; set; } 55 | 56 | [Parameter] 57 | public string OptionChoice { get; set; } 58 | 59 | protected override void OnParametersSet() 60 | { 61 | selectedOptions = OptionChoice is not null ? OptionChoice.Split(ValueOptions.EncodedValueSeperator).ToList() : new(); 62 | nonSelectedOptions = ValueOptions.Options.Except(selectedOptions).ToList(); 63 | } 64 | 65 | void Remove(string value) 66 | { 67 | selectedOptions.Remove(value); 68 | UpdateOptions(); 69 | } 70 | 71 | void Add(string value) 72 | { 73 | selectedOptions.Add(value); 74 | UpdateOptions(); 75 | } 76 | 77 | void MoveLeft(string value) 78 | { 79 | var index = selectedOptions.IndexOf(value); 80 | if (index == 0) return; 81 | 82 | selectedOptions.RemoveAt(index); 83 | selectedOptions.Insert(index - 1, value); 84 | UpdateOptions(); 85 | } 86 | 87 | void MoveRight(string value) 88 | { 89 | var index = selectedOptions.IndexOf(value); 90 | if (index == selectedOptions.Count - 1) return; 91 | 92 | selectedOptions.RemoveAt(index); 93 | selectedOptions.Insert(index + 1, value); 94 | UpdateOptions(); 95 | } 96 | 97 | void UpdateOptions() 98 | { 99 | OptionChoice = string.Join(ValueOptions.EncodedValueSeperator, selectedOptions); 100 | nonSelectedOptions = ValueOptions.Options.Except(selectedOptions).ToList(); 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/OrderedSetWithOneOrMoreOfManyValueOptionsPicker.razor.css: -------------------------------------------------------------------------------- 1 | .flex1 { 2 | display: flex; 3 | flex: 1; 4 | justify-content: center; 5 | font-weight: 900; 6 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/Shared/TemplatePresenter.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | @code { 4 | private string sample; 5 | 6 | [Parameter, EditorRequired] 7 | public PresenterTemplate PresenterTemplate { get; set; } 8 | 9 | [Parameter, EditorRequired] 10 | public string Separator { get; set; } 11 | 12 | [Parameter, EditorRequired] 13 | public List SelectedOptions { get; set; } 14 | 15 | protected override void OnParametersSet() 16 | { 17 | var options = PresenterTemplate.OptionsApplying.Order(new ModifierComparer(PresenterTemplate.OptionsApplying, SelectedOptions)); 18 | 19 | var tokenReplacement = string.Join(Separator, options); 20 | sample = PresenterTemplate.Template.Replace(PresenterTemplate.TemplateToken, tokenReplacement); 21 | } 22 | 23 | public class ModifierComparer : IComparer 24 | { 25 | private readonly List optionsApplying; 26 | private readonly List selectedOptions; 27 | 28 | public ModifierComparer(string[] optionsApplying, List selectedOptions) 29 | { 30 | this.optionsApplying = optionsApplying.ToList(); 31 | this.selectedOptions = selectedOptions; 32 | } 33 | 34 | int IComparer.Compare(string? x, string? y) 35 | { 36 | if (x is null || y is null) return 0; 37 | if (selectedOptions.Contains(x) && selectedOptions.Contains(y)) 38 | { 39 | return selectedOptions.IndexOf(x).CompareTo(selectedOptions.IndexOf(y)); 40 | } 41 | return optionsApplying.IndexOf(x).CompareTo(optionsApplying.IndexOf(y)); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.Web.Virtualization 7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 8 | @using Microsoft.JSInterop 9 | @using KristofferStrube.EditorConfigWizard 10 | @using KristofferStrube.EditorConfigWizard.Models.Options 11 | @using KristofferStrube.EditorConfigWizard.Models; 12 | @using KristofferStrube.EditorConfigWizard.Services; 13 | @using KristofferStrube.EditorConfigWizard.Shared 14 | @using KristofferStrube.EditorConfigWizard.Extensions 15 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/libman.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "defaultProvider": "cdnjs", 4 | "libraries": [ 5 | { 6 | "library": "highlight.js@11.7.0", 7 | "destination": "wwwroot/lib", 8 | "files": [ "highlight.min.js", "styles/monokai.min.css" ], 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/404.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | EditorConfig Wizard 6 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/Schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-06/schema#", 3 | "type": "array", 4 | "note": "Generated by: https://codebeautify.org/json-to-json-schema-generator", 5 | "items": { 6 | "$ref": "#/definitions/Element" 7 | }, 8 | "definitions": { 9 | "Element": { 10 | "type": "object", 11 | "additionalProperties": false, 12 | "properties": { 13 | "Id": { 14 | "type": "string" 15 | }, 16 | "Title": { 17 | "type": "string" 18 | }, 19 | "Sample": { 20 | "anyOf": [ 21 | { 22 | "type": "array", 23 | "items": { 24 | "type": "string" 25 | } 26 | }, 27 | { 28 | "type": "string" 29 | } 30 | ], 31 | "title": "Sample" 32 | }, 33 | "FixedSample": { 34 | "anyOf": [ 35 | { 36 | "type": "array", 37 | "items": { 38 | "type": "string" 39 | } 40 | }, 41 | { 42 | "type": "string" 43 | } 44 | ], 45 | "title": "Sample" 46 | }, 47 | "Options": { 48 | "type": "array", 49 | "items": { 50 | "$ref": "#/definitions/Option" 51 | } 52 | } 53 | }, 54 | "required": [ 55 | "Id", 56 | "Title" 57 | ], 58 | "title": "Element" 59 | }, 60 | "Option": { 61 | "type": "object", 62 | "additionalProperties": false, 63 | "properties": { 64 | "Name": { 65 | "type": "string" 66 | }, 67 | "ValueOptions": { 68 | "$ref": "#/definitions/ValueOptions" 69 | } 70 | }, 71 | "required": [ 72 | "Name", 73 | "ValueOptions" 74 | ], 75 | "title": "Welcome8Option" 76 | }, 77 | "ValueOptions": { 78 | "type": "object", 79 | "additionalProperties": false, 80 | "properties": { 81 | "$type": { 82 | "$ref": "#/definitions/Type" 83 | }, 84 | "Options": { 85 | "type": "array", 86 | "items": { 87 | "$ref": "#/definitions/OptionUnion" 88 | } 89 | }, 90 | "Description": { 91 | "type": "string" 92 | }, 93 | "DefaultOptionValue": { 94 | "type": "string" 95 | }, 96 | "EncodedValueSeperator": { 97 | "type": "string" 98 | }, 99 | "PresenterSeperator": { 100 | "type": "string" 101 | }, 102 | "PresenterTemplates": { 103 | "type": "array", 104 | "items": { 105 | "$ref": "#/definitions/PresenterTemplate" 106 | } 107 | } 108 | }, 109 | "required": [ 110 | "$type", 111 | "DefaultOptionValue", 112 | "Options" 113 | ], 114 | "title": "ValueOptions" 115 | }, 116 | "OptionOption": { 117 | "type": "object", 118 | "additionalProperties": false, 119 | "properties": { 120 | "Value": { 121 | "type": "string" 122 | }, 123 | "Description": { 124 | "type": "string" 125 | }, 126 | "Sample": { 127 | "$ref": "#/definitions/Sample" 128 | } 129 | }, 130 | "required": [ 131 | "Description", 132 | "Sample", 133 | "Value" 134 | ], 135 | "title": "OptionOption" 136 | }, 137 | "PresenterTemplate": { 138 | "type": "object", 139 | "additionalProperties": false, 140 | "properties": { 141 | "OptionsApplying": { 142 | "type": "array", 143 | "items": { 144 | "type": "string" 145 | } 146 | }, 147 | "Template": { 148 | "type": "array", 149 | "items": { 150 | "type": "string" 151 | } 152 | }, 153 | "TemplateToken": { 154 | "type": "string" 155 | } 156 | }, 157 | "required": [ 158 | "OptionsApplying", 159 | "Template", 160 | "TemplateToken" 161 | ], 162 | "title": "PresenterTemplate" 163 | }, 164 | "OptionUnion": { 165 | "anyOf": [ 166 | { 167 | "$ref": "#/definitions/OptionOption" 168 | }, 169 | { 170 | "type": "string" 171 | } 172 | ], 173 | "title": "OptionUnion" 174 | }, 175 | "Sample": { 176 | "anyOf": [ 177 | { 178 | "type": "array", 179 | "items": { 180 | "type": "string" 181 | } 182 | }, 183 | { 184 | "type": "string" 185 | } 186 | ], 187 | "title": "Sample" 188 | }, 189 | "Type": { 190 | "type": "string", 191 | "enum": [ 192 | "OneOfMany", 193 | "OrderedSetWithOneOrMoreOfMany" 194 | ], 195 | "title": "Type" 196 | } 197 | } 198 | } 199 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | html, body { 4 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 5 | } 6 | 7 | h1:focus { 8 | outline: none; 9 | } 10 | 11 | a, .btn-link { 12 | color: #0071c1; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { 22 | outline: none !important; 23 | } 24 | 25 | .content { 26 | padding-top: 1.1rem; 27 | } 28 | 29 | .valid.modified:not([type=checkbox]) { 30 | outline: 1px solid #26b050; 31 | } 32 | 33 | .invalid { 34 | outline: 1px solid red; 35 | } 36 | 37 | .validation-message { 38 | color: red; 39 | } 40 | 41 | #blazor-error-ui { 42 | background: lightyellow; 43 | bottom: 0; 44 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 45 | display: none; 46 | left: 0; 47 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 48 | position: fixed; 49 | width: 100%; 50 | z-index: 1000; 51 | } 52 | 53 | #blazor-error-ui .dismiss { 54 | cursor: pointer; 55 | position: absolute; 56 | right: 0.75rem; 57 | top: 0.5rem; 58 | } 59 | 60 | .blazor-error-boundary { 61 | background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121; 62 | padding: 1rem 1rem 1rem 3.7rem; 63 | color: white; 64 | } 65 | 66 | .blazor-error-boundary::after { 67 | content: "An error has occurred." 68 | } 69 | 70 | .loading-progress { 71 | position: relative; 72 | display: block; 73 | width: 8rem; 74 | height: 8rem; 75 | margin: 20vh auto 1rem auto; 76 | } 77 | 78 | .loading-progress circle { 79 | fill: none; 80 | stroke: #e0e0e0; 81 | stroke-width: 0.6rem; 82 | transform-origin: 50% 50%; 83 | transform: rotate(-90deg); 84 | } 85 | 86 | .loading-progress circle:last-child { 87 | stroke: #1b6ec2; 88 | stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; 89 | transition: stroke-dasharray 0.05s ease-in-out; 90 | } 91 | 92 | .loading-progress-text { 93 | position: absolute; 94 | text-align: center; 95 | font-weight: bold; 96 | inset: calc(20vh + 3.25rem) 0 auto 0.2rem; 97 | } 98 | 99 | .loading-progress-text:after { 100 | content: var(--blazor-load-percentage-text, "Loading"); 101 | } 102 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](https://github.com/iconic/open-iconic) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](https://github.com/iconic/open-iconic). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](https://github.com/iconic/open-iconic) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](https://github.com/iconic/open-iconic) and [Reference](https://github.com/iconic/open-iconic) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KristofferStrube/EditorConfigWizard/6ecc8fc4cde165b1431050549373d3f9053e1439/src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KristofferStrube/EditorConfigWizard/6ecc8fc4cde165b1431050549373d3f9053e1439/src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 9 | By P.J. Onori 10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) 11 | 12 | 13 | 14 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 74 | 76 | 79 | 81 | 84 | 86 | 88 | 91 | 93 | 95 | 98 | 100 | 102 | 104 | 106 | 109 | 112 | 115 | 117 | 121 | 123 | 125 | 127 | 130 | 132 | 134 | 136 | 138 | 141 | 143 | 145 | 147 | 149 | 151 | 153 | 155 | 157 | 159 | 162 | 165 | 167 | 169 | 172 | 174 | 177 | 179 | 181 | 183 | 185 | 189 | 191 | 194 | 196 | 198 | 200 | 202 | 205 | 207 | 209 | 211 | 213 | 215 | 218 | 220 | 222 | 224 | 226 | 228 | 230 | 232 | 234 | 236 | 238 | 241 | 243 | 245 | 247 | 249 | 251 | 253 | 256 | 259 | 261 | 263 | 265 | 267 | 269 | 272 | 274 | 276 | 280 | 282 | 285 | 287 | 289 | 292 | 295 | 298 | 300 | 302 | 304 | 306 | 309 | 312 | 314 | 316 | 318 | 320 | 322 | 324 | 326 | 330 | 334 | 338 | 340 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 358 | 360 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 379 | 381 | 383 | 386 | 388 | 390 | 392 | 394 | 396 | 399 | 401 | 404 | 406 | 408 | 410 | 412 | 414 | 416 | 419 | 421 | 423 | 425 | 428 | 431 | 435 | 438 | 440 | 442 | 444 | 446 | 448 | 451 | 453 | 455 | 457 | 460 | 462 | 464 | 466 | 468 | 471 | 473 | 477 | 479 | 481 | 483 | 486 | 488 | 490 | 492 | 494 | 496 | 499 | 501 | 504 | 506 | 509 | 512 | 515 | 517 | 520 | 522 | 524 | 526 | 529 | 532 | 534 | 536 | 539 | 542 | 543 | 544 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KristofferStrube/EditorConfigWizard/6ecc8fc4cde165b1431050549373d3f9053e1439/src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KristofferStrube/EditorConfigWizard/6ecc8fc4cde165b1431050549373d3f9053e1439/src/KristofferStrube.EditorConfigWizard/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KristofferStrube/EditorConfigWizard/6ecc8fc4cde165b1431050549373d3f9053e1439/src/KristofferStrube.EditorConfigWizard/wwwroot/favicon.png -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KristofferStrube/EditorConfigWizard/6ecc8fc4cde165b1431050549373d3f9053e1439/src/KristofferStrube.EditorConfigWizard/wwwroot/icon-192.png -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | EditorConfig Wizard 8 | 9 | 10 | 32 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
53 | 54 | 55 | 56 | 57 |
58 |
59 | 60 |
61 | An unhandled error has occurred. 62 | Reload 63 | 🗙 64 |
65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/language_rules.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Id": "IDE0003", 4 | "Title": "Remove this qualification", 5 | "Options": [ 6 | { 7 | "Name": "dotnet_style_qualification_for_field", 8 | "ValueOptions": { 9 | "$type": "OneOfMany", 10 | "Options": [ 11 | { 12 | "Value": "true", 13 | "Description": "Prefer fields to be prefaced with this in C#.", 14 | "Sample": "this.capacity = 0;" 15 | }, 16 | { 17 | "Value": "false", 18 | "Description": "Prefer fields not to be prefaced with this.", 19 | "Sample": "capacity = 0;" 20 | } 21 | ], 22 | "DefaultOptionValue": "false" 23 | } 24 | }, 25 | { 26 | "Name": "dotnet_style_qualification_for_property", 27 | "ValueOptions": { 28 | "$type": "OneOfMany", 29 | "Options": [ 30 | { 31 | "Value": "true", 32 | "Description": "Prefer properties to be prefaced with this in C#.", 33 | "Sample": "this.ID = 0;" 34 | }, 35 | { 36 | "Value": "false", 37 | "Description": "Prefer properties not to be prefaced with this.", 38 | "Sample": "ID = 0;" 39 | } 40 | ], 41 | "DefaultOptionValue": "false" 42 | } 43 | }, 44 | { 45 | "Name": "dotnet_style_qualification_for_method", 46 | "ValueOptions": { 47 | "$type": "OneOfMany", 48 | "Options": [ 49 | { 50 | "Value": "true", 51 | "Description": "Prefer methods to be prefaced with this in C#.", 52 | "Sample": "this.Display();" 53 | }, 54 | { 55 | "Value": "false", 56 | "Description": "Prefer methods not to be prefaced with this.", 57 | "Sample": "Display();" 58 | } 59 | ], 60 | "DefaultOptionValue": "false" 61 | } 62 | }, 63 | { 64 | "Name": "dotnet_style_qualification_for_event", 65 | "ValueOptions": { 66 | "$type": "OneOfMany", 67 | "Options": [ 68 | { 69 | "Value": "true", 70 | "Description": "Prefer events to be prefaced with this in C#.", 71 | "Sample": "this.Elapsed += Handler;" 72 | }, 73 | { 74 | "Value": "false", 75 | "Description": "Prefer events not to be prefaced with this.", 76 | "Sample": "Elapsed += Handler;" 77 | } 78 | ], 79 | "DefaultOptionValue": "false" 80 | } 81 | } 82 | ] 83 | }, 84 | { 85 | "Id": "IDE0049", 86 | "Title": "Use language keywords instead of framework type names for type references", 87 | "Options": [ 88 | { 89 | "Name": "dotnet_style_predefined_type_for_locals_parameters_members", 90 | "ValueOptions": { 91 | "$type": "OneOfMany", 92 | "Options": [ 93 | { 94 | "Value": "true", 95 | "Description": "Prefer the language keyword for local variables, method parameters, and class members.", 96 | "Sample": "private int _member;" 97 | }, 98 | { 99 | "Value": "false", 100 | "Description": "Prefer the type name for local variables, method parameters, and class members", 101 | "Sample": "private Int32 _member;" 102 | } 103 | ], 104 | "DefaultOptionValue": "true" 105 | } 106 | }, 107 | { 108 | "Name": "dotnet_style_predefined_type_for_member_access", 109 | "ValueOptions": { 110 | "$type": "OneOfMany", 111 | "Options": [ 112 | { 113 | "Value": "true", 114 | "Description": "Prefer the language keyword for member access expressions.", 115 | "Sample": "var local = int.MaxValue;" 116 | }, 117 | { 118 | "Value": "false", 119 | "Description": "Prefer the type name for member access expressions.", 120 | "Sample": "var local = Int32.MaxValue;" 121 | } 122 | ], 123 | "DefaultOptionValue": "true" 124 | } 125 | } 126 | ] 127 | }, 128 | { 129 | "Id": "IDE0036", 130 | "Title": "Order modifiers", 131 | "Options": [ 132 | { 133 | "Name": "csharp_preferred_modifier_order", 134 | "ValueOptions": { 135 | "$type": "OrderedSetWithOneOrMoreOfMany", 136 | "Options": [ 137 | "public", 138 | "private", 139 | "protected", 140 | "internal", 141 | "file", 142 | "static", 143 | "extern", 144 | "new", 145 | "virtual", 146 | "abstract", 147 | "sealed", 148 | "override", 149 | "readonly", 150 | "unsafe", 151 | "required", 152 | "volatile", 153 | "async" 154 | ], 155 | "Description": "Change the order of the modifiers so that they fit with your style using the arrows or remove one if you don't care about its order. The initial setup is the default order. You can see how the order reflects on the samples in the bottom.", 156 | "DefaultOptionValue": "public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async", 157 | "EncodedValueSeperator": ",", 158 | "PresenterSeperator": " ", 159 | "PresenterTemplates": [ 160 | { 161 | "OptionsApplying": [ 162 | "public", 163 | "override", 164 | "unsafe", 165 | "async" 166 | ], 167 | "Template": [ 168 | "modifiers Task FastCopyAsync() => { }" 169 | ], 170 | "TemplateToken": "modifiers" 171 | }, 172 | { 173 | "OptionsApplying": [ 174 | "internal", 175 | "file", 176 | "sealed" 177 | ], 178 | "Template": [ 179 | "modifiers class MyClass", 180 | "{", 181 | "}" 182 | ], 183 | "TemplateToken": "modifiers" 184 | } 185 | ] 186 | } 187 | } 188 | ] 189 | }, 190 | { 191 | "Id": "IDE0040", 192 | "Title": "Add accessibility modifiers", 193 | "Options": [ 194 | { 195 | "Name": "dotnet_style_require_accessibility_modifiers", 196 | "ValueOptions": { 197 | "$type": "OneOfMany", 198 | "Options": [ 199 | { 200 | "Value": "always", 201 | "Description": "Prefer accessibility modifiers to be specified.", 202 | "Sample": [ 203 | "class MyClass", 204 | "{", 205 | " private const string thisFieldIsConst = \"constant\";", 206 | "}", 207 | "", 208 | "interface IMyInterface", 209 | "{", 210 | " public string SomeProperty { get; set; }", 211 | "}" 212 | ] 213 | }, 214 | { 215 | "Value": "for_non_interface_members", 216 | "Description": "Prefer accessibility modifiers except for public interface members.", 217 | "Sample": [ 218 | "class MyClass", 219 | "{", 220 | " private const string thisFieldIsConst = \"constant\";", 221 | "}", 222 | "", 223 | "interface IMyInterface", 224 | "{", 225 | " string SomeProperty { get; set; }", 226 | "}" 227 | ] 228 | }, 229 | { 230 | "Value": "never", 231 | "Description": "Do not prefer accessibility modifiers to be specified.", 232 | "Sample": [ 233 | "class MyClass", 234 | "{", 235 | " const string thisFieldIsConst = \"constant\";", 236 | "}", 237 | "", 238 | "interface IMyInterface", 239 | "{", 240 | " string SomeProperty { get; set; }", 241 | "}" 242 | ] 243 | }, 244 | { 245 | "Value": "omit_if_default", 246 | "Description": "Prefer accessibility modifiers except if they are the default modifier.", 247 | "Sample": [ 248 | "class MyClass", 249 | "{", 250 | " const string thisFieldIsConst = \"constant\";", 251 | "}", 252 | "", 253 | "interface IMyInterface", 254 | "{", 255 | " string SomeProperty { get; set; }", 256 | "}" 257 | ] 258 | } 259 | ], 260 | "DefaultOptionValue": "for_non_interface_members" 261 | } 262 | } 263 | ] 264 | }, 265 | { 266 | "Id": "IDE0044", 267 | "Title": "Add readonly modifier", 268 | "Options": [ 269 | { 270 | "Name": "dotnet_style_readonly_field", 271 | "ValueOptions": { 272 | "$type": "OneOfMany", 273 | "Options": [ 274 | { 275 | "Value": "true", 276 | "Description": "Prefer that private fields be marked readonly if they're only ever assigned inline or in a constructor.", 277 | "Sample": [ 278 | "class MyClass", 279 | "{", 280 | " private readonly int _daysInYear = 365;", 281 | "}" 282 | ] 283 | }, 284 | { 285 | "Value": "false", 286 | "Description": "Specify no preference over whether private fields are marked readonly.", 287 | "Sample": [ 288 | "class MyClass", 289 | "{", 290 | " private int _daysInYear = 365;", 291 | "}" 292 | ] 293 | } 294 | ], 295 | "DefaultOptionValue": "true" 296 | } 297 | } 298 | ] 299 | }, 300 | { 301 | "Id": "IDE0062", 302 | "Title": "Make local function static", 303 | "Options": [ 304 | { 305 | "Name": "csharp_prefer_static_local_function", 306 | "ValueOptions": { 307 | "$type": "OneOfMany", 308 | "Options": [ 309 | { 310 | "Value": "true", 311 | "Description": "Prefer local functions to be marked static.", 312 | "Sample": [ 313 | "void M()", 314 | "{", 315 | " Hello();", 316 | " static void Hello() => Console.WriteLine(\"Hello\");", 317 | "}" 318 | ] 319 | }, 320 | { 321 | "Value": "false", 322 | "Description": "Prefer local functions not to be marked static.", 323 | "Sample": [ 324 | "void M()", 325 | "{", 326 | " Hello();", 327 | " void Hello() => Console.WriteLine(\"Hello\");", 328 | "}" 329 | ] 330 | } 331 | ], 332 | "DefaultOptionValue": "true:suggestion" 333 | } 334 | } 335 | ] 336 | }, 337 | { 338 | "Id": "IDE0047,IDE0048", 339 | "Title": "Add/Remove parentheses for clarity", 340 | "Options": [ 341 | { 342 | "Name": "dotnet_style_parentheses_in_arithmetic_binary_operators", 343 | "ValueOptions": { 344 | "$type": "OneOfMany", 345 | "Options": [ 346 | { 347 | "Value": "always_for_clarity", 348 | "Description": "Prefer parentheses to clarify arithmetic operator precedence.", 349 | "Sample": "var v = a + (b * c);" 350 | }, 351 | { 352 | "Value": "never_if_unnecessary", 353 | "Description": "Prefer no parentheses when arithmetic operator precedence is obvious.", 354 | "Sample": "var v = a + b * c;" 355 | } 356 | ], 357 | "DefaultOptionValue": "always_for_clarity" 358 | } 359 | } 360 | ] 361 | }, 362 | { 363 | "Id": "IDE0010", 364 | "Title": "Add missing cases to switch statement", 365 | "Sample": [ 366 | "enum Color { Red, Green, Blue }", 367 | "", 368 | "// Unfixed", 369 | "static string HexColor(Color color)", 370 | "{", 371 | " switch (color)", 372 | " {", 373 | " case Color.Red: return \"F00\";", 374 | " case Color.Green: return \"0F0\";", 375 | " }", 376 | " return throw new InvalidArgumentException($\"Non-supported color: {color}\");", 377 | "}" 378 | ], 379 | "FixedSample": [ 380 | "enum Color { Red, Green, Blue }", 381 | "", 382 | "static string HexColor(Color color)", 383 | "{", 384 | " switch (color)", 385 | " {", 386 | " case Color.Red: return \"F00\";", 387 | " case Color.Green: return \"0F0\";", 388 | " case Color.Blue: return \"00F\";", 389 | " case default: throw new InvalidArgumentException($\"Non-supported color: {color}\");", 390 | " }", 391 | "}" 392 | ] 393 | }, 394 | { 395 | "Id": "IDE0017", 396 | "Title": "Use object initializers", 397 | "Options": [ 398 | { 399 | "Name": "dotnet_style_object_initializer", 400 | "ValueOptions": { 401 | "$type": "OneOfMany", 402 | "Options": [ 403 | { 404 | "Value": "true", 405 | "Description": "Prefer objects to be initialized using object initializers when possible.", 406 | "Sample": [ 407 | "var p1 = new Person()", 408 | "{", 409 | " Height = 176", 410 | "};" 411 | ] 412 | }, 413 | { 414 | "Value": "false", 415 | "Description": "Prefer objects to not be initialized using object initializers.", 416 | "Sample": [ 417 | "var p1 = new Person();", 418 | "p1.Height = 176;" 419 | ] 420 | } 421 | ], 422 | "DefaultOptionValue": "true" 423 | } 424 | } 425 | ] 426 | }, 427 | { 428 | "Id": "IDE0018", 429 | "Title": "Inline variable declaration", 430 | "Options": [ 431 | { 432 | "Name": "csharp_style_inlined_variable_declaration", 433 | "ValueOptions": { 434 | "$type": "OneOfMany", 435 | "Options": [ 436 | { 437 | "Value": "true", 438 | "Description": "Prefer out variables to be declared inline in the argument list of a method call when possible.", 439 | "Sample": [ 440 | "if (double.TryParse(value, out double i))", 441 | "{", 442 | " Console.WriteLine($\"{i}*{i}={i*i}\");", 443 | "}" 444 | ] 445 | }, 446 | { 447 | "Value": "false", 448 | "Description": "Prefer out variables to be declared before the method call.", 449 | "Sample": [ 450 | "double i;", 451 | "if (double.TryParse(value, out i))", 452 | "{", 453 | " Console.WriteLine($\"{i}*{i}={i*i}\");", 454 | "}" 455 | ] 456 | } 457 | ], 458 | "DefaultOptionValue": "true" 459 | } 460 | } 461 | ] 462 | }, 463 | { 464 | "Id": "IDE0028", 465 | "Title": "Use collection initializers", 466 | "Options": [ 467 | { 468 | "Name": "dotnet_style_collection_initializer", 469 | "ValueOptions": { 470 | "$type": "OneOfMany", 471 | "Options": [ 472 | { 473 | "Value": "true", 474 | "Description": "Prefer collections to be initialized using collection initializers when possible.", 475 | "Sample": "List numbers = new() { \"one\", \"two\", \"three\" };" 476 | }, 477 | { 478 | "Value": "false", 479 | "Description": "Prefer collections to not be initialized using collection initializers.", 480 | "Sample": [ 481 | "List numbers = new();", 482 | "numbers.Add(\"one\");", 483 | "numbers.Add(\"two\");", 484 | "numbers.Add(\"three\");" 485 | ] 486 | } 487 | ], 488 | "DefaultOptionValue": "true" 489 | } 490 | } 491 | ] 492 | }, 493 | { 494 | "Id": "IDE0032", 495 | "Title": "Use auto-implemented property", 496 | "Options": [ 497 | { 498 | "Name": "dotnet_style_prefer_auto_properties", 499 | "ValueOptions": { 500 | "$type": "OneOfMany", 501 | "Options": [ 502 | { 503 | "Value": "true", 504 | "Description": "Prefer auto-implemented properties.", 505 | "Sample": "private int Age { get; }" 506 | }, 507 | { 508 | "Value": "false", 509 | "Description": "Prefer properties with private backing fields.", 510 | "Sample": [ 511 | "private int _age;", 512 | "", 513 | "public int Age", 514 | "{", 515 | " get", 516 | " {", 517 | " return _age;", 518 | " }", 519 | "}" 520 | ] 521 | } 522 | ], 523 | "DefaultOptionValue": "true" 524 | } 525 | } 526 | ] 527 | }, 528 | { 529 | "Id": "IDE0033", 530 | "Title": "Use explicitly provided tuple name", 531 | "Options": [ 532 | { 533 | "Name": "dotnet_style_explicit_tuple_names", 534 | "ValueOptions": { 535 | "$type": "OneOfMany", 536 | "Options": [ 537 | { 538 | "Value": "true", 539 | "Description": "Prefer tuple names to ItemX properties.", 540 | "Sample": [ 541 | "(double x, double y) coordinate = CalculateCoordinate();", 542 | "var x = coordinate.x;" 543 | ] 544 | }, 545 | { 546 | "Value": "false", 547 | "Description": "Prefer ItemX properties to tuple names.", 548 | "Sample": [ 549 | "(double x, double y) coordinate = CalculateCoordinate();", 550 | "var x = coordinate.Item1;" 551 | ] 552 | } 553 | ], 554 | "DefaultOptionValue": "true" 555 | } 556 | } 557 | ] 558 | }, 559 | { 560 | "Id": "IDE0034", 561 | "Title": "Simplify default expression", 562 | "Options": [ 563 | { 564 | "Name": "csharp_prefer_simple_default_expression", 565 | "ValueOptions": { 566 | "$type": "OneOfMany", 567 | "Options": [ 568 | { 569 | "Value": "true", 570 | "Description": "Prefer default over default(T).", 571 | "Sample": [ 572 | "public enum Currency { USD, EUR, DKK }", 573 | "int CalculatePrice(Currency currency = default) { ... }" 574 | ] 575 | }, 576 | { 577 | "Value": "false", 578 | "Description": "Prefer default(T) over default.", 579 | "Sample": [ 580 | "public enum Currency { USD, EUR, DKK }", 581 | "int CalculatePrice(Currency currency = default(Currency)) { ... }" 582 | ] 583 | } 584 | ], 585 | "DefaultOptionValue": "true" 586 | } 587 | } 588 | ] 589 | }, 590 | { 591 | "Id": "IDE0037", 592 | "Title": "Use inferred member name", 593 | "Options": [ 594 | { 595 | "Name": "dotnet_style_prefer_inferred_tuple_names", 596 | "ValueOptions": { 597 | "$type": "OneOfMany", 598 | "Options": [ 599 | { 600 | "Value": "true", 601 | "Description": "Prefer inferred tuple element names.", 602 | "Sample": "var coordinate = (x, y);" 603 | }, 604 | { 605 | "Value": "false", 606 | "Description": "Prefer explicit tuple element names.", 607 | "Sample": "var coordinate = (x: x, y: y);" 608 | } 609 | ], 610 | "DefaultOptionValue": "true" 611 | } 612 | }, 613 | { 614 | "Name": "dotnet_style_prefer_inferred_anonymous_type_member_names", 615 | "ValueOptions": { 616 | "$type": "OneOfMany", 617 | "Options": [ 618 | { 619 | "Value": "true", 620 | "Description": "Prefer inferred anonymous type member names.", 621 | "Sample": "return new { color, shape, width }" 622 | }, 623 | { 624 | "Value": "false", 625 | "Description": "Prefer explicit anonymous type member names.", 626 | "Sample": "return new { color: color, shape: shape, width: width }" 627 | } 628 | ], 629 | "DefaultOptionValue": "true" 630 | } 631 | } 632 | ] 633 | }, 634 | { 635 | "Id": "IDE0039", 636 | "Title": "Use local function instead of lambda", 637 | "Options": [ 638 | { 639 | "Name": "csharp_style_prefer_local_over_anonymous_function", 640 | "ValueOptions": { 641 | "$type": "OneOfMany", 642 | "Options": [ 643 | { 644 | "Value": "true", 645 | "Description": "Prefer local functions over anonymous functions.", 646 | "Sample": [ 647 | "int price(int amount, decimal itemPrice) {", 648 | " return amount * itemPrice;", 649 | "}" 650 | ] 651 | }, 652 | { 653 | "Value": "false", 654 | "Description": "Prefer anonymous functions over local functions.", 655 | "Sample": [ 656 | "Func price = (int amount, decimal itemPrice) => {", 657 | " return amount * itemPrice;", 658 | "}" 659 | ] 660 | } 661 | ], 662 | "DefaultOptionValue": "true" 663 | } 664 | } 665 | ] 666 | }, 667 | { 668 | "Id": "IDE0042", 669 | "Title": "Deconstruct variable declaration", 670 | "Options": [ 671 | { 672 | "Name": "csharp_style_deconstructed_variable_declaration", 673 | "ValueOptions": { 674 | "$type": "OneOfMany", 675 | "Options": [ 676 | { 677 | "Value": "true", 678 | "Description": "Prefer deconstructed variable declarations.", 679 | "Sample": [ 680 | "var (x, y) = CalculateCoordinate();", 681 | "Console.WriteLine($\"The x coordinate is {x}\");" 682 | ] 683 | }, 684 | { 685 | "Value": "false", 686 | "Description": "Do not prefer deconstruction in variable declarations.", 687 | "Sample": [ 688 | "var coordinate = CalculateCoordinate();", 689 | "Console.WriteLine($\"The x coordinate is {coordinate.x}\");" 690 | ] 691 | } 692 | ], 693 | "DefaultOptionValue": "true" 694 | } 695 | } 696 | ] 697 | }, 698 | { 699 | "Id": "IDE0045", 700 | "Title": "Use conditional expression for assignment", 701 | "Options": [ 702 | { 703 | "Name": "dotnet_style_prefer_conditional_expression_over_assignment", 704 | "ValueOptions": { 705 | "$type": "OneOfMany", 706 | "Options": [ 707 | { 708 | "Value": "true", 709 | "Description": "Prefer assignments with a ternary conditional.", 710 | "Sample": "var isEvenText = isEven(x) ? \"even\" : \"odd\";" 711 | }, 712 | { 713 | "Value": "false", 714 | "Description": "Prefer assignments with an if-else statement.", 715 | "Sample": [ 716 | "string isEvenText;", 717 | "if (isEven(x))", 718 | "{", 719 | " isEvenText = \"even\"", 720 | "}", 721 | "else", 722 | "{", 723 | " isEvenText = \"odd\"", 724 | "}" 725 | ] 726 | } 727 | ], 728 | "DefaultOptionValue": "true" 729 | } 730 | } 731 | ] 732 | }, 733 | { 734 | "Id": "IDE0046", 735 | "Title": "Use conditional expression for return", 736 | "Options": [ 737 | { 738 | "Name": "dotnet_style_prefer_conditional_expression_over_return", 739 | "ValueOptions": { 740 | "$type": "OneOfMany", 741 | "Options": [ 742 | { 743 | "Value": "true", 744 | "Description": "Prefer return statements to use a ternary conditional.", 745 | "Sample": "return isEven(x) ? \"even\" : \"odd\";" 746 | }, 747 | { 748 | "Value": "false", 749 | "Description": "Prefer return statements to use an if-else statement.", 750 | "Sample": [ 751 | "if (isEven(x))", 752 | "{", 753 | " return \"even\"", 754 | "}", 755 | "else", 756 | "{", 757 | " return \"odd\"", 758 | "}" 759 | ] 760 | } 761 | ], 762 | "DefaultOptionValue": "true" 763 | } 764 | } 765 | ] 766 | }, 767 | { 768 | "Id": "IDE0054,IDE0074", 769 | "Title": "Use (coalesce) compound assignment", 770 | "Options": [ 771 | { 772 | "Name": "dotnet_style_prefer_compound_assignment", 773 | "ValueOptions": { 774 | "$type": "OneOfMany", 775 | "Options": [ 776 | { 777 | "Value": "true", 778 | "Description": "Prefer compound assignment expressions.", 779 | "Sample": [ 780 | "product ??= new Product(SaleType.None)", 781 | "if (product.SaleType is SaleType.Active)", 782 | "{", 783 | " price *= 1.1;", 784 | "}" 785 | ] 786 | }, 787 | { 788 | "Value": "false", 789 | "Description": "Don't prefer compound assignment expressions.", 790 | "Sample": [ 791 | "product = product ?? new Product(SaleType.None)", 792 | "if (product.SaleType is SaleType.Active)", 793 | "{", 794 | " price = price * 1.1;", 795 | "}" 796 | ] 797 | } 798 | ], 799 | "DefaultOptionValue": "true" 800 | } 801 | } 802 | ] 803 | }, 804 | { 805 | "Id": "IDE0056", 806 | "Title": "Use index operator", 807 | "Options": [ 808 | { 809 | "Name": "csharp_style_prefer_index_operator", 810 | "ValueOptions": { 811 | "$type": "OneOfMany", 812 | "Options": [ 813 | { 814 | "Value": "true", 815 | "Description": "Prefer to use the ^ operator when calculating an index from the end of a collection.", 816 | "Sample": [ 817 | "int[] sizes = { 1, 2, 4, 8, 10 };", 818 | "var largestSize = sizes[^1];" 819 | ] 820 | }, 821 | { 822 | "Value": "false", 823 | "Description": "Prefer not to use the ^ operator when calculating an index from the end of a collection.", 824 | "Sample": [ 825 | "int[] sizes = { 1, 2, 4, 8, 10 };", 826 | "var largestSize = sizes[sizes.Length - 1];" 827 | ] 828 | } 829 | ], 830 | "DefaultOptionValue": "true" 831 | } 832 | } 833 | ] 834 | }, 835 | { 836 | "Id": "IDE0057", 837 | "Title": "Use range operator", 838 | "Options": [ 839 | { 840 | "Name": "csharp_style_prefer_range_operator", 841 | "ValueOptions": { 842 | "$type": "OneOfMany", 843 | "Options": [ 844 | { 845 | "Value": "true", 846 | "Description": "Prefer to use the range operator .. when extracting a \"slice\" of a collection.", 847 | "Sample": [ 848 | "string rhyme = \"Humpty Dumpty sat on a wall.\";", 849 | "var name = rhyme[0..13];" 850 | ] 851 | }, 852 | { 853 | "Value": "false", 854 | "Description": "Prefer not to use the range operator .. when extracting a \"slice\" of a collection.", 855 | "Sample": [ 856 | "string rhyme = \"Humpty Dumpty sat on a wall.\";", 857 | "var name = rhyme.Substring(0, 13);" 858 | ] 859 | } 860 | ], 861 | "DefaultOptionValue": "true" 862 | } 863 | } 864 | ] 865 | }, 866 | { 867 | "Id": "IDE0070", 868 | "Title": "Use System.HashCode.Combine", 869 | "Sample": [ 870 | "public class Cat : Animal", 871 | "{", 872 | " private string furPattern;", 873 | " ", 874 | " // Unfixed", 875 | " public override int GetHashCode()", 876 | " {", 877 | " var hashCode = 1299709;", 878 | " var hashCode = hashCode * 15485863 + base.GetHashCode();", 879 | " var hashCode = hashCode * 15485863 * furPattern.GetHashCode();", 880 | " return hashCode;", 881 | " }", 882 | "}" 883 | ], 884 | "FixedSample": [ 885 | "public class Cat : Animal", 886 | "{", 887 | " private string furPattern;", 888 | " ", 889 | " public override int GetHashCode()", 890 | " {", 891 | " return System.HashCode.Combine(base.GetHashCode(), furPattern);", 892 | " }", 893 | "}" 894 | ] 895 | }, 896 | { 897 | "Id": "IDE0071", 898 | "Title": "Simplify interpolation", 899 | "Options": [ 900 | { 901 | "Name": "dotnet_style_prefer_simplified_interpolation", 902 | "ValueOptions": { 903 | "$type": "OneOfMany", 904 | "Options": [ 905 | { 906 | "Value": "true", 907 | "Description": "Prefer simplified interpolated strings.", 908 | "Sample": "var result = $\"The price is {price} USD\";" 909 | }, 910 | { 911 | "Value": "false", 912 | "Description": "Do not prefer simplified interpolated strings.", 913 | "Sample": "var result = $\"The price is {price.ToString()} USD\";" 914 | } 915 | ], 916 | "DefaultOptionValue": "true" 917 | } 918 | } 919 | ] 920 | }, 921 | { 922 | "Id": "IDE0072", 923 | "Title": "Add missing cases to switch expression", 924 | "Sample": [ 925 | "enum Color { Red, Green, Blue }", 926 | "", 927 | "// Unfixed", 928 | "static string HexColor(Color color)", 929 | "{", 930 | " return color switch", 931 | " {", 932 | " Color.Red => \"F00\",", 933 | " Color.Green => \"0F0\",", 934 | " _ => throw new InvalidArgumentException($\"Non-supported color: {color}\")", 935 | " }", 936 | "}" 937 | ], 938 | "FixedSample": [ 939 | "enum Color { Red, Green, Blue }", 940 | "", 941 | "static string HexColor(Color color)", 942 | "{", 943 | " return color switch", 944 | " {", 945 | " Color.Red => \"F00\",", 946 | " Color.Green => \"0F0\",", 947 | " Color.Blue => \"00F\",", 948 | " _ => throw new InvalidArgumentException($\"Non-supported color: {color}\")", 949 | " }", 950 | "}" 951 | ] 952 | }, 953 | { 954 | "Id": "IDE0075", 955 | "Title": "Simplify conditional expression", 956 | "Options": [ 957 | { 958 | "Name": "dotnet_style_prefer_simplified_boolean_expressions", 959 | "ValueOptions": { 960 | "$type": "OneOfMany", 961 | "Options": [ 962 | { 963 | "Value": "true", 964 | "Description": "Prefer simplified conditional expressions.", 965 | "Sample": [ 966 | "var M1AndM2 = M1() && M2();", 967 | "var M1OrM2 = M1() || M2();" 968 | ] 969 | }, 970 | { 971 | "Value": "false", 972 | "Description": "Do not prefer simplified conditional expressions.", 973 | "Sample": [ 974 | "var M1AndM2 = M1() && M2() ? true : false;", 975 | "var M1OrM2 = M1() ? true : M2();" 976 | ] 977 | } 978 | ], 979 | "DefaultOptionValue": "true" 980 | } 981 | } 982 | ] 983 | }, 984 | { 985 | "Id": "IDE0082", 986 | "Title": "Convert typeof to nameof", 987 | "Sample": [ 988 | "public record Cat(string Name, int Age);", 989 | "Console.WriteLine($\"We have a class named {typeof(Cat).Name}\");" 990 | ], 991 | "FixedSample": [ 992 | "public record Cat(string Name, int Age);", 993 | "Console.WriteLine($\"We have a class named {nameof(Cat)}\");" 994 | ] 995 | }, 996 | { 997 | "Id": "IDE0090", 998 | "Title": "Simplify new expression", 999 | "Options": [ 1000 | { 1001 | "Name": "csharp_style_implicit_object_creation_when_type_is_apparent", 1002 | "ValueOptions": { 1003 | "$type": "OneOfMany", 1004 | "Options": [ 1005 | { 1006 | "Value": "true", 1007 | "Description": "Prefer target-typed new expressions when created type is apparent.", 1008 | "Sample": "HttpClient httpClient = new();" 1009 | }, 1010 | { 1011 | "Value": "false", 1012 | "Description": "Do not prefer target-typed new expressions.", 1013 | "Sample": "HttpClient httpClient = new HttpClient();" 1014 | } 1015 | ], 1016 | "DefaultOptionValue": "true" 1017 | } 1018 | } 1019 | ] 1020 | }, 1021 | { 1022 | "Id": "IDE0180", 1023 | "Title": "Use tuple to swap values", 1024 | "Sample": [ 1025 | "int[] numbers = new int[] { 2, 1, 3, 4 };", 1026 | "int temp = numbers[0];", 1027 | "numbers[0] = numbers[1];", 1028 | "numbers[1] = temp;" 1029 | ], 1030 | "FixedSample": [ 1031 | "int[] numbers = new int[] { 2, 1, 3, 4 };", 1032 | "(numbers[0], numbers[1]) = (numbers[1], numbers[0]);" 1033 | ] 1034 | }, 1035 | { 1036 | "Id": "IDE0160,IDE0161", 1037 | "Title": "Use block/file-scoped namespace", 1038 | "Options": [ 1039 | { 1040 | "Name": "csharp_style_namespace_declarations", 1041 | "ValueOptions": { 1042 | "$type": "OneOfMany", 1043 | "Options": [ 1044 | { 1045 | "Value": "block_scoped", 1046 | "Description": "Namespace declarations should be block scoped.", 1047 | "Sample": [ 1048 | "namespace MyOrg.MyProject", 1049 | "{", 1050 | " class Program", 1051 | " {", 1052 | " Console.WriteLine(\"Hello!\");", 1053 | " }", 1054 | "}" 1055 | ] 1056 | }, 1057 | { 1058 | "Value": "file_scoped", 1059 | "Description": "\tNamespace declarations should be file scoped.", 1060 | "Sample": [ 1061 | "namespace MyOrg.MyProject;", 1062 | "", 1063 | "class Program", 1064 | "{", 1065 | " Console.WriteLine(\"Hello!\");", 1066 | "}" 1067 | ] 1068 | } 1069 | ], 1070 | "DefaultOptionValue": "block_scoped" 1071 | } 1072 | } 1073 | ] 1074 | }, 1075 | { 1076 | "Id": "IDE0016", 1077 | "Title": "Use throw expression", 1078 | "Options": [ 1079 | { 1080 | "Name": "csharp_style_throw_expression", 1081 | "ValueOptions": { 1082 | "$type": "OneOfMany", 1083 | "Options": [ 1084 | { 1085 | "Value": "true", 1086 | "Description": "Prefer to use throw expressions instead of throw statements.", 1087 | "Sample": "this.name = name ?? throw new ArgumentNullException(nameof(name));" 1088 | }, 1089 | { 1090 | "Value": "false", 1091 | "Description": "Prefer to use throw statements instead of throw expressions", 1092 | "Sample": [ 1093 | "if (name == null)", 1094 | "{", 1095 | " throw new ArgumentNullException(nameof(name));", 1096 | "}", 1097 | "this.name = name;" 1098 | ] 1099 | } 1100 | ], 1101 | "DefaultOptionValue": "true" 1102 | } 1103 | } 1104 | ] 1105 | }, 1106 | { 1107 | "Id": "IDE0029,IDE0030", 1108 | "Title": "Use coalesce expression (non-nullable/nullable types)", 1109 | "Options": [ 1110 | { 1111 | "Name": "dotnet_style_coalesce_expression", 1112 | "ValueOptions": { 1113 | "$type": "OneOfMany", 1114 | "Options": [ 1115 | { 1116 | "Value": "true", 1117 | "Description": "Prefer null coalescing expressions to ternary operator checking.", 1118 | "Sample": "int height = length ?? 150;" 1119 | }, 1120 | { 1121 | "Value": "false", 1122 | "Description": "Prefer ternary operator checking to null coalescing expressions.", 1123 | "Sample": "int height = length != null ? length : 150;" 1124 | } 1125 | ], 1126 | "DefaultOptionValue": "true" 1127 | } 1128 | } 1129 | ] 1130 | }, 1131 | { 1132 | "Id": "IDE0031", 1133 | "Title": "Use null propagation", 1134 | "Options": [ 1135 | { 1136 | "Name": "dotnet_style_null_propagation", 1137 | "ValueOptions": { 1138 | "$type": "OneOfMany", 1139 | "Options": [ 1140 | { 1141 | "Value": "true", 1142 | "Description": "Prefer to use null-conditional operator when possible.", 1143 | "Sample": "int? amount = cats?.Count();" 1144 | }, 1145 | { 1146 | "Value": "false", 1147 | "Description": "Prefer to use ternary null checking where possible.", 1148 | "Sample": "int? amount = cats != null ? cats.Count() : null;" 1149 | } 1150 | ], 1151 | "DefaultOptionValue": "true" 1152 | } 1153 | } 1154 | ] 1155 | }, 1156 | { 1157 | "Id": "IDE0041", 1158 | "Title": "Use 'is null' check", 1159 | "Options": [ 1160 | { 1161 | "Name": "dotnet_style_prefer_is_null_check_over_reference_equality_method", 1162 | "ValueOptions": { 1163 | "$type": "OneOfMany", 1164 | "Options": [ 1165 | { 1166 | "Value": "true", 1167 | "Description": "Prefer 'is null' check.", 1168 | "Sample": "string playerName = name is null ? \"Bob\" : name;" 1169 | }, 1170 | { 1171 | "Value": "false", 1172 | "Description": "Prefer reference equality method", 1173 | "Sample": "string playerName = name == null ? \"Bob\" : name;" 1174 | } 1175 | ], 1176 | "DefaultOptionValue": "true" 1177 | } 1178 | } 1179 | ] 1180 | }, 1181 | { 1182 | "Id": "IDE0150", 1183 | "Title": "Prefer 'null' check over type check", 1184 | "Options": [ 1185 | { 1186 | "Name": "csharp_style_prefer_null_check_over_type_check", 1187 | "ValueOptions": { 1188 | "$type": "OneOfMany", 1189 | "Options": [ 1190 | { 1191 | "Value": "true", 1192 | "Description": "Prefer null check over type check.", 1193 | "Sample": [ 1194 | "if (age is null)", 1195 | "{", 1196 | " Console.WriteLine(\"We don't know your age.\");", 1197 | "}" 1198 | ] 1199 | }, 1200 | { 1201 | "Value": "false", 1202 | "Description": "Disables the rule.", 1203 | "Sample": [ 1204 | "if (age is not int)", 1205 | "{", 1206 | " Console.WriteLine(\"We don't know your age.\");", 1207 | "}" 1208 | ] 1209 | } 1210 | ], 1211 | "DefaultOptionValue": "true" 1212 | } 1213 | } 1214 | ] 1215 | }, 1216 | { 1217 | "Id": "IDE1005", 1218 | "Title": "Use conditional delegate call", 1219 | "Options": [ 1220 | { 1221 | "Name": "csharp_style_conditional_delegate_call", 1222 | "ValueOptions": { 1223 | "$type": "OneOfMany", 1224 | "Options": [ 1225 | { 1226 | "Value": "true", 1227 | "Description": "Prefer to use the conditional coalescing operator (?.) when invoking a lambda expression.", 1228 | "Sample": "title = formatter?.Invoke(name);" 1229 | }, 1230 | { 1231 | "Value": "false", 1232 | "Description": "Prefer to perform a null check before invoking a lambda expression.", 1233 | "Sample": [ 1234 | "if (formatter != null)", 1235 | "{", 1236 | " title = formatter(name);", 1237 | "}" 1238 | ] 1239 | } 1240 | ], 1241 | "DefaultOptionValue": "true" 1242 | } 1243 | } 1244 | ] 1245 | }, 1246 | { 1247 | "Id": "IDE0007,IDE0008", 1248 | "Title": "Use var or explicit type", 1249 | "Options": [ 1250 | { 1251 | "Name": "csharp_style_var_for_built_in_types", 1252 | "ValueOptions": { 1253 | "$type": "OneOfMany", 1254 | "Options": [ 1255 | { 1256 | "Value": "true", 1257 | "Description": "Prefer var is used to declare variables with built-in system types such as int.", 1258 | "Sample": "var height = 176;" 1259 | }, 1260 | { 1261 | "Value": "false", 1262 | "Description": "Prefer explicit type over var to declare variables with built-in system types such as int.", 1263 | "Sample": "int height = 176;" 1264 | } 1265 | ], 1266 | "DefaultOptionValue": "false" 1267 | } 1268 | }, 1269 | { 1270 | "Name": "csharp_style_var_when_type_is_apparent", 1271 | "ValueOptions": { 1272 | "$type": "OneOfMany", 1273 | "Options": [ 1274 | { 1275 | "Value": "true", 1276 | "Description": "Prefer var when the type is already mentioned on the right-hand side of a declaration expression.", 1277 | "Sample": "var cats = new List();" 1278 | }, 1279 | { 1280 | "Value": "false", 1281 | "Description": "Prefer explicit type when the type is already mentioned on the right-hand side of a declaration expression.", 1282 | "Sample": "List cats = new List();" 1283 | } 1284 | ], 1285 | "DefaultOptionValue": "false" 1286 | } 1287 | }, 1288 | { 1289 | "Name": "csharp_style_var_elsewhere", 1290 | "ValueOptions": { 1291 | "$type": "OneOfMany", 1292 | "Options": [ 1293 | { 1294 | "Value": "true", 1295 | "Description": "Prefer var over explicit type in all cases, unless overridden by another code style rule.", 1296 | "Sample": "var mapper = StyleController.Create();" 1297 | }, 1298 | { 1299 | "Value": "false", 1300 | "Description": "Prefer explicit type over var in all cases, unless overridden by another code style rule.", 1301 | "Sample": "StyleMapper mapper = StyleController.Create();" 1302 | } 1303 | ], 1304 | "DefaultOptionValue": "false" 1305 | } 1306 | } 1307 | ] 1308 | } 1309 | ] 1310 | -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/lib/styles/monokai.min.css: -------------------------------------------------------------------------------- 1 | pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#272822;color:#ddd}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-selector-tag,.hljs-strong,.hljs-tag{color:#f92672}.hljs-code{color:#66d9ef}.hljs-attribute,.hljs-link,.hljs-regexp,.hljs-symbol{color:#bf79db}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-section,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string,.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#a6e22e}.hljs-class .hljs-title,.hljs-title.class_{color:#fff}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#75715e}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-section,.hljs-selector-id,.hljs-selector-tag,.hljs-title,.hljs-type{font-weight:700} -------------------------------------------------------------------------------- /src/KristofferStrube.EditorConfigWizard/wwwroot/unnecessary_code_rules.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "Id": "IDE0001", 4 | "Title": "Simplify name", 5 | "Sample": [ 6 | "using System.Text.Json;", 7 | "", 8 | "var person = new { Name = \"Bob\" };", 9 | "var serializedPerson = System.Text.Json.JsonSerializer.Serialize(person);" 10 | ], 11 | "FixedSample": [ 12 | "using System.Text.Json;", 13 | "", 14 | "var person = new { Name = \"Bob\" };", 15 | "var serializedPerson = JsonSerializer.Serialize(person);" 16 | ] 17 | }, 18 | { 19 | "Id": "IDE0002", 20 | "Title": "Simplify member access", 21 | "Sample": [ 22 | "class MyClass", 23 | "{", 24 | " void MyMethod() => MyClass.StaticMethod();", 25 | "", 26 | " static void StaticMethod() { }", 27 | "}" 28 | ], 29 | "FixedSample": [ 30 | "class MyClass", 31 | "{", 32 | " void MyMethod() => StaticMethod();", 33 | "", 34 | " static void StaticMethod() { }", 35 | "}" 36 | ] 37 | }, 38 | { 39 | "Id": "IDE0004", 40 | "Title": "Remove unnecessary cast", 41 | "Sample": "var pi = (int)22/7", 42 | "FixedSample": "var pi = 22/7" 43 | }, 44 | { 45 | "Id": "IDE0005", 46 | "Title": "Remove unnecessary import", 47 | "Sample": [ 48 | "using System;", 49 | "", 50 | "var name = \"Bob\";" 51 | ], 52 | "FixedSample": [ 53 | "var name = \"Bob\";" 54 | ] 55 | }, 56 | { 57 | "Id": "IDE0035", 58 | "Title": "Remove unreachable code", 59 | "Sample": [ 60 | "public decimal Cost(int amount, decimal price)", 61 | "{", 62 | " var cost = amount * price;", 63 | " return cost;", 64 | " Logger.log($\"Calculated cost: {cost}\");", 65 | "}" 66 | ], 67 | "FixedSample": [ 68 | "public decimal Cost(int amount, decimal price)", 69 | "{", 70 | " var cost = amount * price;", 71 | " return cost;", 72 | "}" 73 | ] 74 | }, 75 | { 76 | "Id": "IDE0051", 77 | "Title": "Remove unused private member", 78 | "Sample": [ 79 | "class Person", 80 | "{", 81 | " private int _shoeSize;", 82 | " private double _height;", 83 | " public bool IsTall() => _height > 180;", 84 | "}" 85 | ], 86 | "FixedSample": [ 87 | "class Person", 88 | "{", 89 | " private double _height;", 90 | " public bool IsTall() => _height > 180;", 91 | "}" 92 | ] 93 | }, 94 | { 95 | "Id": "IDE0052", 96 | "Title": "Remove unread private member", 97 | "Sample": [ 98 | "class Coin", 99 | "{", 100 | " private bool _lastWasHeads;", 101 | " private bool _lastWasTails;", 102 | "", 103 | " public void Flip()", 104 | " {", 105 | " int toss = Random.Shared.Next(1)", 106 | " _lastWasHeads = toss == 1", 107 | " _lastWasTails = toss == 0", 108 | " }", 109 | "", 110 | " public bool headWon() => _lastWasHeads;", 111 | "}" 112 | ], 113 | "FixedSample": [ 114 | "class Coin", 115 | "{", 116 | " private bool _lastWasHeads;", 117 | "", 118 | " public void Flip()", 119 | " {", 120 | " int toss = Random.Shared.Next(1)", 121 | " _lastWasHeads = toss == 1", 122 | " }", 123 | "", 124 | " public bool headWon() => _lastWasHeads;", 125 | "}" 126 | ] 127 | }, 128 | { 129 | "Id": "IDE0058", 130 | "Title": "Remove unnecessary expression value", 131 | "Options": [ 132 | { 133 | "Name": "csharp_style_unused_value_expression_statement_preference", 134 | "ValueOptions": { 135 | "$type": "OneOfMany", 136 | "Options": [ 137 | { 138 | "Value": "discard_variable", 139 | "Description": "Prefer to assign an unused expression to a discard.", 140 | "Sample": [ 141 | "// Unfixed", 142 | "int.Parse(\"137\");", 143 | "", 144 | "// Fixed", 145 | "_ = int.Parse(\"137\");" 146 | ] 147 | }, 148 | { 149 | "Value": "unused_local_variable", 150 | "Description": "Prefer to assign an unused expression to a local variable that's never used.", 151 | "Sample": [ 152 | "// Unfixed", 153 | "int.Parse(\"137\");", 154 | "", 155 | "// Fixed", 156 | "var unused = int.Parse(\"137\");" 157 | ] 158 | } 159 | ], 160 | "DefaultOptionValue": "discard_variable" 161 | } 162 | } 163 | ] 164 | }, 165 | { 166 | "Id": "IDE0059", 167 | "Title": "Remove unnecessary value assignment", 168 | "Options": [ 169 | { 170 | "Name": "csharp_style_unused_value_assignment_preference", 171 | "ValueOptions": { 172 | "$type": "OneOfMany", 173 | "Options": [ 174 | { 175 | "Value": "discard_variable", 176 | "Description": "Prefer to use a discard when assigning a value that's not used.", 177 | "Sample": [ 178 | "// Unfixed", 179 | "static double InvariantParseDouble(string stringValue)", 180 | "{", 181 | " double.TryParse(stringValue, CultureInfo.InvariantCulture, out var value);", 182 | " return value;", 183 | "}", 184 | "", 185 | "// Fixed", 186 | "static double InvariantParseDouble(string stringValue)", 187 | "{", 188 | " _ = double.TryParse(stringValue, CultureInfo.InvariantCulture, out var value);", 189 | " return value;", 190 | "}", 191 | "" 192 | ] 193 | }, 194 | { 195 | "Value": "unused_local_variable", 196 | "Description": "Prefer to use a local variable when assigning a value that's not used.", 197 | "Sample": [ 198 | "// Unfixed", 199 | "static double InvariantParseDouble(string stringValue)", 200 | "{", 201 | " double.TryParse(stringValue, CultureInfo.InvariantCulture, out var value);", 202 | " return value;", 203 | "}", 204 | "", 205 | "// Fixed", 206 | "static double InvariantParseDouble(string stringValue)", 207 | "{", 208 | " var unused = double.TryParse(stringValue, CultureInfo.InvariantCulture, out var value);", 209 | " return value;", 210 | "}", 211 | "" 212 | ] 213 | } 214 | ], 215 | "DefaultOptionValue": "discard_variable" 216 | } 217 | } 218 | ] 219 | } 220 | ] 221 | --------------------------------------------------------------------------------