Skip to content

Commit

Permalink
Merge pull request #6 from NullVoxPopuli/patricklx-patch-1
Browse files Browse the repository at this point in the history
always notify if not correctly setup
  • Loading branch information
NullVoxPopuli authored Dec 21, 2023
2 parents 16f861d + 3ae4d87 commit 756f68b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/preprocessor/noop.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* this preprocessor is setup by our recommended rules for gjs/gts, so it will always be called for it
* the flow is the following:
* 1. gjs/gts files goes through our parses, which calls registerParsedFile, if its not correctly setup, registerParsedFile will not be called
* 2. postprocess checks if the file is registered and if not throws an error (only if parsing failed)
* 2. postprocess checks if the file is registered and if not throws an error
*
*/

Expand All @@ -16,16 +16,13 @@ module.exports = {
preprocess: null,
postprocess: (messages, fileName) => {
const msgs = messages.flat();
if (
msgs.length === 1 &&
msgs[0].ruleId === null &&
msgs[0].message.startsWith('Parsing error: ')
) {
if (!parsedFiles.has(fileName)) {
msgs[0].message += '\n';
msgs[0].message +=
'To lint Gjs/Gts files please follow the setup guide at https://github.com/ember-cli/eslint-plugin-ember#gtsgjs';
}
if (!parsedFiles.has(fileName)) {
msgs[0] = msgs[0] || {
message: '',
};
msgs[0].message += '\n';
msgs[0].message +=
'To lint Gjs/Gts files please follow the setup guide at https://github.com/ember-cli/eslint-plugin-ember#gtsgjs';
}
parsedFiles.delete(fileName); // required for tests
return msgs;
Expand Down

0 comments on commit 756f68b

Please sign in to comment.