Giter VIP home page Giter VIP logo

Comments (11)

patricklx avatar patricklx commented on May 29, 2024

this? #2107

mmm, this might be different .
But it wil be eager later. Because scope is passes directly, right?

from eslint-plugin-ember.

NullVoxPopuli avatar NullVoxPopuli commented on May 29, 2024

mmm, this might be different .

yeah, that PR adds rules to a config, which I don't think we should do.

I imagine the TS config should end up looking like this:

{
  // this is the exact same as what's in the README
  files: ['**/*.gts'],
  parser: 'ember-eslint-parser',
  plugins: ['ember'],
  extends: [
    'eslint:recommended',
    // hopefully this either adds the rules to the config (so that 2107 isn't needed)
    // or we give up on legacy configs and only recommend flat config
    'plugin:@typescript-eslint/recommended',
    'plugin:ember/recommended',
     // this would detect if @typescript-eslint is present, 
     // and make sure no-use-before-define is turned off
    'plugin:ember/recommended-gts', 
  ],
},

from eslint-plugin-ember.

patricklx avatar patricklx commented on May 29, 2024

I think the error is correct though.
it will be compiled to something like

Foo =  precompileTemplate(`...`,  {
  scope: [Bar]
})

from eslint-plugin-ember.

patricklx avatar patricklx commented on May 29, 2024

I think it was pretty clear that they will not change plugin:@typescript-eslint/recommended behaviour. (Lets discuss this part in #2107)

from eslint-plugin-ember.

NullVoxPopuli avatar NullVoxPopuli commented on May 29, 2024

it wilz be compiled to something like

nay, it's

scope: () => ({ Bar })

from eslint-plugin-ember.

patricklx avatar patricklx commented on May 29, 2024

it wilz be compiled to something like

nay, it's

scope: () => ({ Bar })

hmm, i took another look, you are right:)

But it looks like the rule isn't looking that exactly anyway:
eslint playground

from eslint-plugin-ember.

NullVoxPopuli avatar NullVoxPopuli commented on May 29, 2024

ah! so the eslint rule is wrong!

from eslint-plugin-ember.

patricklx avatar patricklx commented on May 29, 2024

I looks like that's actually the behaviour it intended to do:

This rule will warn when it encounters a reference to an identifier that has not yet been declared.

https://eslint.org/docs/latest/rules/no-use-before-define#rule-details

from eslint-plugin-ember.

NullVoxPopuli avatar NullVoxPopuli commented on May 29, 2024

yeah -- but .. it's safe!

from eslint-plugin-ember.

patricklx avatar patricklx commented on May 29, 2024

i think this can be closed then? as the rule does work correctly as per its own definition

from eslint-plugin-ember.

NullVoxPopuli avatar NullVoxPopuli commented on May 29, 2024

It works incorrectly for how we need it to tho 🤔

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.