{"id":19806507,"url":"https://github.com/monade/vscode-custom-code-decorator","last_synced_at":"2025-11-11T19:29:34.171Z","repository":{"id":43549736,"uuid":"218799532","full_name":"monade/vscode-custom-code-decorator","owner":"monade","description":"Custom Code Decorator for VSCode","archived":false,"fork":false,"pushed_at":"2022-12-10T07:26:53.000Z","size":53,"stargazers_count":7,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-25T13:04:14.815Z","etag":null,"topics":["linter-plugin","vscode","vscode-extension"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=monade.vscode-custom-code-decorator","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monade.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-31T15:35:15.000Z","updated_at":"2022-11-07T20:22:00.000Z","dependencies_parsed_at":"2023-01-26T04:31:47.916Z","dependency_job_id":null,"html_url":"https://github.com/monade/vscode-custom-code-decorator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/monade/vscode-custom-code-decorator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fvscode-custom-code-decorator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fvscode-custom-code-decorator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fvscode-custom-code-decorator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fvscode-custom-code-decorator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monade","download_url":"https://codeload.github.com/monade/vscode-custom-code-decorator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monade%2Fvscode-custom-code-decorator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266753971,"owners_count":23979144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linter-plugin","vscode","vscode-extension"],"created_at":"2024-11-12T09:07:44.512Z","updated_at":"2025-11-11T19:29:34.143Z","avatar_url":"https://github.com/monade.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Custom Code Decorator for VSCode\n\nCreate your own, customized, per-project code decorators, simpy putting a `.vslinter.js` file in your project!\n\nSometimes certain projects may need custom code analysis that could not be mapped in a generic way.\n\nNo worries, now create your own!\n\nHere's an example `.vslinter.js` file that colors the word \"cat\" in your code and writes \"Meow~\" as a description:\n\n```javascript\nmodule.exports = {\n\t// Defining style\n  style(vscode) {\n    return {\n      borderWidth: '1px',\n      borderStyle: 'dotted',\n      overviewRulerColor: 'red',\n      overviewRulerLane: vscode.OverviewRulerLane.Right,\n      light: { borderColor: 'lightred' },\n      dark: { borderColor: 'darkred' },\n    };\n  },\n\t// Matching the word \"cat\" and colorize it, adding a hoverMessage \"Meow~\"\n  lint(document, rangesToDecorate) {\n    const regex = /\\scat\\s/g\n    const text = document.getText();\n    let match = regex.exec(text);\n\n    while (match) {\n      const decoration = {\n        'range': [match.index + 1, match.index + match[0].length - 1],\n        'hoverMessage': 'Meow~'\n      };\n      rangesToDecorate.push(decoration);\n      match = regex.exec(text);\n    }\n  }\n}\n```\n\nHere's the result:\n\n![](example.png)\n\n### Some use cases:\n* Defining custom linters for the current project\n* Validating JSON files using custom JSON schemas\n* Custom security requirements for a project\n* Resolving names and suggesting similar elements\n\nInstall it on VS Code: https://marketplace.visualstudio.com/items?itemName=monade.vscode-custom-code-decorator\n\n## Future work / Suggestions:\n\nhttps://github.com/monade/vscode-custom-code-decorator/issues\n\n## If you want to experiment with the source code:\n\n- (do the usual steps to download from GitHub and navigate to folder)\n- `npm install` (just once inside the folder)\n- `npm run watch` (every time you want to test it)\n- open folder in VS Code and hit F5 or go to Debug and click on the green triangle play button\n\nThe key file to edit is `extension.ts` (in the `src` folder).\n\n# Special Thanks\n\nThe initial idea and part of the code comes from this plugin:\nhttps://github.com/hchiam/custom-vscode-linter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonade%2Fvscode-custom-code-decorator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonade%2Fvscode-custom-code-decorator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonade%2Fvscode-custom-code-decorator/lists"}