Git Product home page Git Product logo

Comments (4)

patocallaghan avatar patocallaghan commented on June 19, 2024 1

Did a bit more digging and it seems the codemod supports actions using ObjectMethod notation but not FunctionExpression.

Works

actions: {
  foo() {}
}

Doesn't work

actions: {
  foo: function() {}
}

I'll see about putting together a PR

Edit:
hmm weirdly i can't replicate this behaviour in the tests

from ember-native-class-codemod.

DArrigoni avatar DArrigoni commented on June 19, 2024

After some more playing around with it I'm getting inconsistent results with this. Some times it works fine, sometimes it does not.

from ember-native-class-codemod.

patocallaghan avatar patocallaghan commented on June 19, 2024

I've just come across the same issue. It seems this is because of the ignoreLeakingState option in the config. This looks like it only supports queryParams by default even though in the README it calls out queryParams and actions.

Ember Objects with objects or arrays as direct properties (actions and queryParams are the exception). See eslint-plugin-ember/avoid-leaking-state-in-ember-objects for more details.

Adding actions to ignoreLeakingState options does go a step further and do a migration but in my testing it looks like it translates to actions = { ... }

@gitKrystan should actions be added as a default option in ignoreLeakingState?

from ember-native-class-codemod.

gitKrystan avatar gitKrystan commented on June 19, 2024

IIRC adding something to ignoreLeakingState means it won't be transformed from an object literal. The actions hash is special-cased, as you found.

Are you seeing anything about this file in codemods.log?

from ember-native-class-codemod.

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.