-
Notifications
You must be signed in to change notification settings - Fork 16
feat(no-multiple-global-stores): add suggestion #198
feat(no-multiple-global-stores): add suggestion #198
Conversation
messageId: noMultipleGlobalStores, | ||
suggestions: [ | ||
{ | ||
messageId: noMultipleGlobalStoresSuggest, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that updating Typescript
and @typescript-eslint
fixes the problem in SOME cases of the weird as MessageIds
🤷♂️ (I've removed that typecast where applicable... for the others unfortunately, TS keeps complaining).
@@ -66,8 +66,8 @@ | |||
"@types/eslint": "^7.28.0", | |||
"@types/node": "^14.14.7", | |||
"@types/prettier": "^2.3.2", | |||
"@typescript-eslint/eslint-plugin": "^4.29.2", | |||
"@typescript-eslint/parser": "^4.29.2", | |||
"@typescript-eslint/eslint-plugin": "^4.31.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was impressed that updating just these 3 packages makes such a big diff in package-lock.json
.
@@ -20,6 +20,7 @@ export default ESLintUtils.RuleCreator(docsUrl)<Options, MessageIds>({ | |||
category: 'Best Practices', | |||
description: 'Use a consistent name for the global store.', | |||
recommended: 'warn', | |||
suggestion: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it would be a good idea to adjust the README script to include when a rule has suggestions or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, it's on my backlog to add it to the generation of the rules 😅
c5abe37
to
a1e2d1a
Compare
export class OnePlusExtraOk { | ||
constructor(private store: Store, data: Service) {} | ||
}`, | ||
` | ||
export class FirstOk { | ||
constructor(private store: Store, data: Service) {} | ||
} | ||
|
||
export class SecondOk { | ||
constructor(private store: Store, data: Service) {} | ||
}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed these because they are repeated.
a1e2d1a
to
83d09f4
Compare
const detailsContent = | ||
err instanceof Error | ||
? ` | ||
Details: | ||
${err.message} | ||
` | ||
: '' | ||
context.logger.warn(` | ||
Something went wrong while adding the NgRx ESLint Plugin. | ||
The NgRx ESLint Plugin is installed but not configured. | ||
|
||
Please see ${docs} to configure the NgRx ESLint Plugin. | ||
|
||
Details: | ||
${err.message} | ||
${detailsContent} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, | ||
} | ||
}, | ||
}) | ||
|
||
function getRemoveRangeFor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this was more code than I had expected 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! Dealing with tokens (mostly parenthesis, commas and comments) is really, really boring and lead to a verbose code. I wish it were possible to use use selectors for fixer/suggestions as well 😄
🎉 This PR is included in version 1.34.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Part of #179.