quick-lint-js
quick-lint-js copied to clipboard
Error on EJS or PHP syntax
Example:
// Should report: EJS is not supported by quick-lint-js (similar to E0177)
window.audioRecordingBitRate = <%= audioRecordingBitRate %>;
In the lexer, if we see <%
or <?
(with no space), we can report a warning about EJS or PHP, respectively.
i would like to work on this issue, can you please assign it to me.
Hello @strager Thanks for assigning this issue to me I am a beginner, i would request you to guide me a little bit. I was going through the codebase, i think i need to add logic in the file: " src/quick-lint-js/fe/lex.h "
So what i am thinking is i have to Implement a rule that identifies the <% pattern (EJS) and <? pattern (PHP) and when the lexer detects the EJS or PHP pattern, i need to modify the code to report a warning.
i think i need to add logic in the file: " src/quick-lint-js/fe/lex.h "
Likely lex.cpp, not lex.h. You'd need to modify lex.h if you add a new function, but logic goes in lex.cpp.
i have to Implement a rule that identifies the <% pattern (EJS) and <? pattern (PHP) and when the lexer detects the EJS or PHP pattern, i need to modify the code to report a warning.
The case '<':
in Lexer::try_parse_current_token
is probably where you should start poking:
https://github.com/quick-lint/quick-lint-js/blob/b05e1cc45388d7302c790ae5cf3f00364130efdf/src/quick-lint-js/fe/lex.cpp#L434
Docs for creating a new diagnostic: https://quick-lint-js.com/contribute/create-diagnostic/
Hello Sir @strager i have made changes. requesting you review the same and provide comments and also how would i check in real time link
@pseudofool I suggest compiling your code and running the tests.
When you're done, please create a pull request in GitHub. There's a big green "Create pull request" button on the link you shared. Once you make a pull request, I can write comments directly on the patch.