Skip to content

Commit

Permalink
fix: pr review feedback on documentation and config
Browse files Browse the repository at this point in the history
  • Loading branch information
rtablada committed Dec 29, 2022
1 parent 238c372 commit d06fe3f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
9 changes: 3 additions & 6 deletions docs/rules/no-implicit-injections.md
Expand Up @@ -93,23 +93,20 @@ Example config:
```js
module.exports = {
rules: {
'ember/no-implicit-injections': [2, {
'ember/no-implicit-injections': ['error', {
services: [
// Ember Responsive Used to Auto Inject the media service in Components/Controllers
{ serviceName: 'media', moduleNames: ['Component', 'Controller'] },
// Ember CLI Flash Used to Auto Inject the flashMessages service in all modules
{ serviceName: 'flashMessages' },
// Check for uses of the store in Routes or Controllers
{ serviceName: 'store', moduleNames: ['Route', 'Controller'] },
]
}]
}
}
```

## Related Rules

- [no-unnecessary-service-injection-argument](no-unnecessary-service-injection-argument.md) omit service injection argument if possible
- [no-implicit-service-injection-argument](no-unnecessary-service-injection-argument.md) require the service injection argument for all services (fix output for this rule follows this pattern)

## References

- [Deprecation](https://deprecations.emberjs.com/v3.x/#toc_implicit-injections)
15 changes: 14 additions & 1 deletion lib/rules/no-implicit-injections.js
Expand Up @@ -38,6 +38,7 @@ module.exports = {
type: 'object',
properties: {
services: {
minItems: 1,
type: 'array',
items: {
type: 'object',
Expand All @@ -49,10 +50,22 @@ module.exports = {
moduleNames: {
type: 'array',
items: {
type: 'string',
enum: [
'Component',
'GlimmerComponent',
'Controller',
'Mixin',
'Route',
'Service',
'ArrayProxy',
'ObjectProxy',
'EmberObject',
'Helper',
],
},
},
},
additionalProperties: false,
},
},
},
Expand Down

0 comments on commit d06fe3f

Please sign in to comment.