Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@glimmer/syntax": ">= 0.95.0",
"@typescript-eslint/tsconfig-utils": "^8.57.1",
"content-tag": "^4.1.1",
"ember-estree": "^0.6.10",
"ember-estree": "^0.9.0",
"eslint-scope": "^9.1.2",
"html-tags": "^5.1.0",
"mathml-tag-names": "^4.0.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion scripts/eslint-plugin-ember-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import { execaCommand } from 'execa';
import fse from 'fs-extra';

// Use the fork branch that has the GlimmerBlockParam nodeType fix
// and the test expectations for ember-estree 0.9
// until https://github.com/ember-cli/eslint-plugin-ember/pull/2577 merges,
// then switch back to ember-cli/eslint-plugin-ember.
const REPO = `https://github.com/NullVoxPopuli-ai-agent/eslint-plugin-ember.git`;
const BRANCH = 'update-blockparam-nodetype';
const BRANCH = 'ember-estree-0.9';
const FOLDERS = {
here: process.cwd(),
testRoot: '/tmp/eslint-plugin-ember-test/',
Expand Down
10 changes: 6 additions & 4 deletions src/parser/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function createError(code, message, fileName, start, end = start) {

/**
* Transform code for TypeScript virtual file system.
* Replaces <template> regions with backtick/static-block placeholders.
* Replaces <template> regions with void-backtick/static-block placeholders.
* Used by ts-patch.js for type-aware linting.
*/
export function transformForLint(code, fileName) {
Expand All @@ -392,7 +392,9 @@ export function transformForLint(code, fileName) {
// Build placeholder JS inline (same format as ember-estree's toPlaceholderJS)
let jsCode = code;
for (const tplInfo of [...result].reverse()) {
const content = maskTemplateContentForLint(tplInfo.contents);
const content = maskTemplateContentForLint(
code.slice(tplInfo.contentRange.startUtf16Codepoint, tplInfo.contentRange.endUtf16Codepoint)
);
const start = tplInfo.range.startUtf16Codepoint;
const end = tplInfo.range.endUtf16Codepoint;
const tplLength = end - start;
Expand All @@ -401,8 +403,8 @@ export function transformForLint(code, fileName) {
const spaces = tplLength - content.length - 10; // "static{`" + "`}" = 10
replacement = `static{\`${content}${' '.repeat(Math.max(0, spaces))}\`}`;
} else {
const spaces = tplLength - content.length - 2; // "`" + "`" = 2
replacement = `\`${content}${' '.repeat(Math.max(0, spaces))}\``;
const spaces = tplLength - content.length - 7; // "void `" + "`" = 7
replacement = `void \`${content}${' '.repeat(Math.max(0, spaces))}\``;
}
jsCode = replaceRange(jsCode, start, end, replacement);
}
Expand Down
Loading