{"id":26143,"library":"razor-vue-lint","title":"razor-vue-lint","description":"An ESLint preprocessor for .NET Razor (.cshtml) views containing inline Vue.js templates. Version 1.1.10 wraps Razor expressions (e.g. @Html.PropertyFor) inside /* eslint-disable */ and /* eslint-enable */ comment blocks so that ESLint only lints the Vue template portions. It supports three expression patterns: newline-terminated, closing-tag-terminated, and attribute-enclosed. The library is extensible via custom regex matchers and matcher keys. Released on npm, with low release cadence. Key differentiator: solves a niche problem of linting Vue code embedded in C# Razor views. Not widely adopted; consider manual ESLint configuration as an alternative.","status":"active","version":"1.1.10","language":"javascript","source_language":"en","source_url":"https://github.com/kristianmandrup/razor-vue-lint","tags":["javascript","vue","vuejs","razor","mvc","eslint","linting","lint","template"],"install":[{"cmd":"npm install razor-vue-lint","lang":"bash","label":"npm"},{"cmd":"yarn add razor-vue-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add razor-vue-lint","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM; named export only. Wrong: destructuring from require works but is not standard ESM pattern.","wrong":"const razorVueLint = require('razor-vue-lint'); razorVueLint.esLintEscapeRazorExpressions(code);","symbol":"esLintEscapeRazorExpressions","correct":"import { esLintEscapeRazorExpressions } from 'razor-vue-lint'"},{"note":"Historical alias for esLintEscapeRazorExpressions? Not documented.","wrong":"import { esLintEscapeRazorExpressions } from 'razor-vue-lint'; // wrong function name","symbol":"addIgnoreEsLintBlocksForRazorExpressions","correct":"import { addIgnoreEsLintBlocksForRazorExpressions } from 'razor-vue-lint'"},{"note":"No default export; only named exports.","wrong":"import { default } from 'razor-vue-lint';","symbol":"default","correct":"import razorVueLint from 'razor-vue-lint'; razorVueLint.esLintEscapeRazorExpressions(code);"}],"quickstart":{"code":"import { esLintEscapeRazorExpressions } from 'razor-vue-lint';\nimport { readFileSync, writeFileSync } from 'fs';\nimport { globSync } from 'glob';\n\nconst files = globSync('**/*.cshtml');\nfor (const file of files) {\n  const original = readFileSync(file, 'utf-8');\n  const lintSafe = esLintEscapeRazorExpressions(original);\n  writeFileSync(file.replace('.cshtml', '.lint.cshtml'), lintSafe);\n  console.log(`Processed ${file}`);\n}","lang":"typescript","description":"Recursively processes all .cshtml files in a project, escaping Razor expressions with ESLint ignore comments and saving to .lint.cshtml files."},"warnings":[{"fix":"Contribute custom matchers via options or manually wrap unsupported expressions with /* eslint-disable */ and /* eslint-enable */.","message":"Not all Razor expression patterns are supported; only those terminated by newline, closing tag, or single quotes. Complex expressions may not be escaped.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Replace addIgnoreEsLintBlocksForRazorExpressions with esLintEscapeRazorExpressions.","message":"Function addIgnoreEsLintBlocksForRazorExpressions is undocumented and may be removed. Use esLintEscapeRazorExpressions instead.","severity":"deprecated","affected_versions":"<=1.1.10"},{"fix":"Consider writing a custom ESLint plugin or preprocessor for .cshtml files instead.","message":"Package has not been updated since initial release; no active maintenance. Could break with future ESLint versions.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.10':18 'adopt':94 'altern':101 'attribut':57 'attribute-enclos':56 'block':33 'c':89 'cadenc':76 'close':52 'closing-tag-termin':51 'code':86 'comment':32 'configur':98 'consid':95 'contain':13 'cshtml':11 'custom':64 'differenti':78 'disabl':27 'e.g':22 'embed':87 'enabl':31 'enclos':58 'eslint':6,26,30,36,97,107 'eslint-dis':25 'eslint-en':29 'express':21,46 'extens':62 'html.propertyfor':23 'inlin':14 'insid':24 'javascript':102 'key':69,77 'librari':60 'lint':4,38,84,108,109 'low':74 'manual':96 'matcher':66,68 'mvc':106 'net':9 'newlin':49 'newline-termin':48 'nich':81 'npm':72 'pattern':47 'portion':42 'preprocessor':7 'problem':82 'razor':2,10,20,90,105 'razor-vue-lint':1 'regex':65 'releas':70,75 'solv':79 'support':44 'tag':53 'templat':16,41,110 'termin':50,54 'three':45 'version':17 'via':63 'view':12,91 'vue':3,40,85,103 'vue.js':15 'vuej':104 'wide':93 'wrap':19","created_at":"2026-05-01T13:48:25.732060+00:00","updated_at":"2026-05-01T13:48:25.732060+00:00","problems":[{"fix":"Install @types/razor-vue-lint (if available) or create a declaration file: declare module 'razor-vue-lint';","cause":"TypeScript project not finding types; package has no bundled types.","error":"Cannot find module 'razor-vue-lint' or its corresponding type declarations."},{"fix":"Use import instead of require(): import { esLintEscapeRazorExpressions } from 'razor-vue-lint';","cause":"Using require() in an ESM context; the package is ESM-only.","error":"Uncaught SyntaxError: The requested module 'razor-vue-lint' does not provide an export named 'esLintEscapeRazorExpressions'"},{"fix":"Use import { esLintEscapeRazorExpressions } from 'razor-vue-lint'; not import razorVueLint from 'razor-vue-lint';","cause":"Importing the default export instead of named export.","error":"TypeError: esLintEscapeRazorExpressions is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/kristianmandrup/razor-vue-lint","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/razor-vue-lint","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}