Ember Component Template Colocation Migrator

screenshot of Ember Component Template Colocation Migrator

A codemod for https://github.com/emberjs/rfcs/pull/481

Overview:

The ember-component-template-colocation codemod is a tool that co-locates component JS and HBS files as described in the Component Templates Co-location RFC. This means that the JavaScript and Handlebars template files for a component will be located in the same directory, making the component structure more organized and easier to navigate.

Features:

  • Co-locate Component JS and HBS files: The main feature of this codemod is to move the component JavaScript file and Handlebars template file to the same directory, making it easier to locate and manage the component files.
  • Flat component structure: By default, the codemod changes the classic component structure to a flat component structure. This means that all component files will be located in the same directory.
  • Nested component structure: If desired, the codemod also supports changing from a classic to a nested component structure. This can be done by adding the -ns flag when running the codemod.

Summary:

The ember-component-template-colocation codemod is a useful tool for Ember.js developers who want to improve the organization of their component files. By co-locating the component JavaScript and Handlebars template files, the codemod helps to create a more streamlined and manageable component structure. It offers the flexibility to choose between a flat component structure or a nested component structure, depending on the developer's preference. Overall, this codemod can greatly enhance the development experience for Ember.js projects.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.