DemoHinty (formely: Assistant) is language and framework agnostic. Example workspace configuration for Angular/TypeScript. It informs about a bad boolean Input declaration in Angular component. Normally it does not trigger build or linter errors and is a hard to track problem:
Result: Hinty - Dynamic Hints For Your CodeAre you annoyed that your notes on hard to fix issues are not available when you need them the most - while coding? Is setting standards for the team code broken even if you have a centralized place for rules because it i hard to keep tabs on them all the time? Never make the same mistakes again! At last there is a solution to these problems. Let me present you a groundbreaking Visual Studio Code extension. Hinty will boost your team code quality and performance. No more looking into documentation. Now you don't need to search through piles of notes to find what you need. Now you can write notes that will pop-up exactly when you or your team member writes a code that they apply to. The extension is designed to make the process super easy:
Installation
Extension in the Visual Studio Code Marketplace: https://marketplace.visualstudio.com/items?itemName=tomasz-smykowski.assistant How to install ready-made rulesets?Hinty is language and framework agnostic. The database of ready-made rulesets will grow over time. Available ready-made rulesets (in rulesets folder in the repo):
Total: over 50 hints! Combine suitable rulesets for you stack eg. for Angular combine TypeScript, HTML, Angular, JS, CSS and general rules. If you have a set of rules for any language / library create MR, or send it in any way, to be included here! COMMIT YOUR HINTS!!!! How to add your own Hinty rules?You can add rules to workspace settings file, and/or to user settings file depending on your needs. 1a. If you want to add settings to workspace, open Visual Studio Code Workspace: a) If you don't have it, choose file "Save Workspace As..." b) Press CTRL + ALT + P to open options c) Find/write "Preferences: Open Workspace Settings (JSON) and open it 1b. If you want to add settings to user settings, open Visual Studio Code User settings: b) Press CTRL + ALT + P to open options c) Find/write "Preferences: Open Settings (JSON) and open it
Each rule should contain: regex - a string with a RegEx rule message - text that should be displayed when the rule is trigerred How to add RegEx modifiers?On default RegEx rules are processed with a 'g' modifier. You can change this behaviour. For example by adding an 'i' modifier to make the rule case insensitive. All RegEx modifiers are supported by the extension. How to add modifier?
If both modifiers are set, local modifiers will be used. How to add multiline rule?Set modifiers to "s" How to limit the rule to a specific file extension or file?You can add "fileRegex" property to a rule. It is a RegEx that indicates what file, files you want the rule to be checked against. For example, to check only files with scss extension, you set:
Dash indicates a start of the file name, dollar an end .* - any characters any number of times \. - escaped dot (it has a special meaning in RegEx). Since \ has a special meaning in JSON, it is escaped with another slash scss - the extension you are looking for When adding file names remember to espace special characters e.g. dot character. LicenceYou can:
for free for whatever you want, including commercial use FAQHow to inspire to write my own rules?Please read an articles of rules authors. They covers ideas for rules and concept of how to write them: Angular, CSS, JS: https://medium.com/@tomaszs2/8-visual-studio-code-assistant-rules-for-nasty-angular-bugs-9f186277e0ab SQL (by Chris Young): https://dev.to/ronsoak/doing-the-impossible-using-assistant-to-make-a-sql-linter-and-how-you-can-make-it-lint-whatever-you-want-2ke2 What is the difference between Hinty and SonarLint?
What is the difference between Hinty and regular Linters
Notes for extension developers
AuthorsTomasz Smykowski (http://tomasz-smykowski.com) Internal notesHow to publish rules
How to publish extension
|