`--fix` is broken with `.gts` files
See original GitHub issueHere is where I am testing: https://github.com/NullVoxPopuli/limber/pull/545
cd frontend
pnpm i
pnpm lint:hbs
pnpm lint:hbs --fix
Without --fix
works fine:
❯ pnpm ember-template-lint app/components/limber/output/index.gts
app/components/limber/output/index.gts
16:10 error Delete `⏎··` prettier
17:58 error Delete `··` prettier
19:4 error Replace `··{{!--` with `{{!` prettier
24:6 error Delete `--` prettier
24:11 error Delete `··` prettier
26:1 error Replace `······` with ` ` prettier
27:32 error Delete `··` prettier
28:60 error Replace `··········{{!--·@glint-ignore·--` with ` {{! @glint-ignore ` prettier
29:35 error Delete `··` prettier
31:10 error Delete `··` prettier
31:24 error Delete `··` prettier
33:6 error Delete `··` prettier
33:17 error Replace `······` with ` ` prettier
35:1 error Replace `····` with ` ` prettier
36:11 error Replace `··</Compiler>⏎` with `</Compiler>` prettier
With fix gives an error an the typescript syntax:
❯ pnpm ember-template-lint app/components/limber/output/index.gts --fix
/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/syntax-error.js:19
let error = new Error(`${message}: ${quotedCode}(error occurred in '${module}' @ line ${line} : column ${column})`);
^
Error [SyntaxError]: Unclosed element `Signature`:
|
| <Signature>
|
(error occurred in 'an unknown module' @ line 15 : column 24)
at generateSyntaxError (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/syntax-error.js:19:15)
at TokenizerEventHandlers.Program (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser/handlebars-node-visitors.js:63:50)
at TokenizerEventHandlers.acceptTemplate (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser.js:78:27)
at preprocess (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser/tokenizer-event-handlers.js:377:72)
at new ParseResult (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/ember-template-recast@6.1.3/node_modules/ember-template-recast/lib/parse-result.js:101:43)
so, maybe somehow when in fix mode, the templates aren’t getting parsed / extracted appropriately.
looks like the same error on gjs:
pnpm lint:hbs app/components/limber/output/js-test.gjs --fix
> limber@0.0.0 lint:hbs /home/nullvoxpopuli/Development/NullVoxPopuli/limber/frontend
> ember-template-lint . --no-error-on-unmatched-pattern "app/components/limber/output/js-test.gjs" "--fix"
/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/syntax-error.js:19
let error = new Error(`${message}: ${quotedCode}(error occurred in '${module}' @ line ${line} : column ${column})`);
^
Error [SyntaxError]: ' is not a valid character within attribute names: (error occurred in 'an unknown module' @ line 16 : column 12)
at generateSyntaxError (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/syntax-error.js:19:15)
at TokenizerEventHandlers.reportSyntaxError (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser/tokenizer-event-handlers.js:257:48)
at EventedTokenizer.attributeName (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/simple-html-tokenizer@0.5.11/node_modules/simple-html-tokenizer/dist/simple-html-tokenizer.js:473:39)
at EventedTokenizer.tokenizePart (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/simple-html-tokenizer@0.5.11/node_modules/simple-html-tokenizer/dist/simple-html-tokenizer.js:661:29)
at TokenizerEventHandlers.ContentStatement (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser/handlebars-node-visitors.js:254:20)
at TokenizerEventHandlers.acceptNode (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser.js:82:27)
at TokenizerEventHandlers.Program (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser/handlebars-node-visitors.js:55:12)
at TokenizerEventHandlers.acceptTemplate (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser.js:78:27)
at preprocess (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/@glimmer+syntax@0.83.1/node_modules/@glimmer/syntax/dist/commonjs/es2017/lib/parser/tokenizer-event-handlers.js:377:72)
at new ParseResult (/home/nullvoxpopuli/Development/NullVoxPopuli/limber/node_modules/.pnpm/ember-template-recast@6.1.3/node_modules/ember-template-recast/lib/parse-result.js:101:43)
Issue Analytics
- State:
- Created a year ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
How to open .GTS file? .GTS extension Information.
Execute .GTS file by double-clicking on it. If you have already installed the software to open it and the files associations are set...
Read more >Use the System File Checker tool to repair missing or ...
Describes how to use the System File Checker tool to troubleshoot missing or corrupted system files in Windows 8.1, Windows 8, Windows 7...
Read more >How to open broken computer files
Select your problem file, click the down arrow next to the Open button, and choose Open and Repair from the list.
Read more >How to Fix Broken File Associations in Windows 10
But occasionally, there is some kind of corruption that may occur because of a virus, a poorly written program or the evil computer...
Read more >Fix for Broken Excel Files
Fix for Broken Excel Files. Step 1: Verify whether forms are functioning ... Step 2: Remove the MS Forms.exd file (close all instances...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I created some simple test case failures for this issue over in https://github.com/ember-template-lint/ember-template-lint/pull/2696
Looks like the
Linter.prototype.verifyAndFix
pathway didn’t get the same treatment asLinter.prototype.verify
(migration to useparseTemplates
).https://github.com/ember-template-lint/ember-template-lint/blob/e4a99f3c5762087e9ceaef96f3b6dd07e498e91e/lib/linter.js#L178