Giter VIP home page Giter VIP logo

Comments (3)

michalsnik avatar michalsnik commented on May 13, 2024

Hmm, okay. This makes sense 👍

But, currently lots of us do smth like:

import Ember from 'ember';
const { $, RSVP } = Ember;

So we already use $ and RSVP directly which complicates this rule a bit.

I'm thinking about actual implementation of this rule. And it looks like apart from looking for Ember.$ and Ember.RSVP we need to check for the existence of import $ from 'jquery'; and import RSVP from 'rsvp' and then if they don't exist but $ or RSVP are being used - we can assume they're from Ember namespace so we can point that they are supposed to be imported directly, not destructed from Ember.

What do you think @Turbo87 about naming this rule require-direct-imports or something similar? We can mention in documentation which modules are now supported. In the future I guess there will be more of them, so making it more generic now might have a sense.

from eslint-plugin-ember.

Turbo87 avatar Turbo87 commented on May 13, 2024

FWIW https://github.com/ember-cli/ember-rfc176-data has more information on the suggested new import paths

from eslint-plugin-ember.

michalsnik avatar michalsnik commented on May 13, 2024

I'm wondering if we should add this rule or create one that will report all global imports regarding this list: https://github.com/ember-cli/ember-rfc176-data/blob/master/globals.json as part of #86

from eslint-plugin-ember.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.