question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose meta data to rules for the Ember version being used

See original GitHub issue

This will allow rules to accommodate the best rules for a given Ember version. This would be helpful for a few existing rules (the recent rule RE: dynamic invocation without fn; the no-capital-arguments rule; and likely others).

There are a couple different logical paths to accomplish this:

  • have the configuration provide the Ember version, something like:

    module.exports = {
      meta: {
        emberVersion: require('ember-source/package').version
      },
    
      extends: 'recommended',
    };
    
  • attempt to resolve the version (resolvePackagePath relative to the configPath)

I think we could allow both options…

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
Turbo87commented, Feb 6, 2021

I think I’d prefer to use the existing rule configuration options system that we already have. It seems reasonable that the Ember version would be able to change the default value for config options, but I think we should ensure that all of these things are still overridable.

1reaction
bmishcommented, Mar 9, 2021

I’d be concerned about exposing the Ember version to rules for the following reasons:

  • Greater rule complexity
  • Greater testing burden, need to check behavior in each Ember version
  • No existing precedent for exposing dependency versions to lint rules (ESLint)

As @Turbo87 suggested, I’d rather rely on rule options to tell the rules about specific features/preferences they should be aware of.

Now if we really need to have awareness of the Ember version somewhere, maybe the config itself (i.e. recommended) could detect the Ember version and configure the rules as desired. Although that makes the config a lot more complex…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Metadata - Ember Data
Metadata is data that goes along with a specific model or type instead of a record. Pagination is a common example of using...
Read more >
How Ember does Ember.version() from browser console?
I know what is window and its variable. I just want to know how Ember "assigns" variable to window, since I couldn't find...
Read more >
salsify/ember-exclaim - GitHub
An addon allowing apps to expose declarative, JSON-configurable custom UIs backed by Ember ... Helpers are used to transform data for an ember-exclaim...
Read more >
ember-simple-auth-input-meta-updated - npm package - Snyk
Ember Simple Auth can be used as a browserified version that ... Auth is included in an application (see the Installation instructions for ......
Read more >
@ember-data/serializer | Yarn - Package Manager
Provides reference Serializer implementations for use with @ember-data/store ... EmberData is a lightweight reactive data library for JavaScript ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found