Code Monkey home page Code Monkey logo

em-to-ed-codemod's Introduction

em-to-ed-codemod Build Status

A collection of codemod's for em-to-ed-codemod.

Usage

To run a specific codemod from this project, you would run the following:

npx github:patocallaghan/em-to-ed-codemod <TRANSFORM NAME> path/of/files/ or/some**/*glob.js

Transforms

Contributing

Installation

  • clone the repo
  • change into the repo directory
  • yarn

Running tests

  • yarn test
  • yarn test:watch for live-reloading
  • For debugging, install ndb and run ndb yarn test:watch

Update Documentation

  • yarn update-docs

em-to-ed-codemod's People

Contributors

patocallaghan avatar sduquej avatar

Watchers

 avatar James Cloos avatar

Forkers

richgt

em-to-ed-codemod's Issues

Remove unconfigured `RestAdapter`s

If we see adapter: RestAdapter.create() without any extensions in a model's configuration we should remove it altogether as the default behaviour of Ember Data's adapter would be enough.

Before

export default IntercomModel.extend({}).reopenClass({
  adapter: RestAdapter.create(),
  url: '/some/url'
});

After

export default IntercomModel.extend({}).reopenClass({
  url: '/some/url'
});

Remove `camelizeKeys` configuration

If we see camelizeKeys: true (there are no instances of false) in a model's configuration we should remove it altogether as this is default behaviour in Ember Data.

Before

export default IntercomModel.extend({}).reopenClass({
  camelizeKeys: true,
  url: '/some/url'
});

After

export default IntercomModel.extend({}).reopenClass({
  url: '/some/url'
});

Migrate `Model.extend`

We currently migrate IntercomModel.extend to DS.Model, but there are a few instances of using Ember Model's Model directly.

Before

export default Model.extend(UserAvatarData, {

After

export default DS.Model.extend(UserAvatarData, {

Remove `intercom/no-ember-model` ESLint comment

We should remove this rule when converting from IntercomModel to DS.Model

//eslint-disable-next-line intercom/no-ember-model

There are two forms we'll need to accommodate

//eslint-disable-next-line intercom/no-ember-model
let SomeModelVar = IntercomModel.extend({
});

//eslint-disable-next-line intercom/no-ember-model
export default IntercomModel.extend({
});

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.