Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

ionic 2 generator filenames don't follow naming conventions #14

Open
jthoms1 opened this issue Mar 10, 2017 · 4 comments
Open

ionic 2 generator filenames don't follow naming conventions #14

jthoms1 opened this issue Mar 10, 2017 · 4 comments

Comments

@jthoms1
Copy link
Member

jthoms1 commented Mar 10, 2017

From @jaufgang on March 9, 2017 19:33

When you create a component, page, service, etc with the cli generator, the filenames of the TypeScript files do not follow the naming conventions recommended in the official Angular Style Guide, in particular Style 02-02 and Style 02-03. The files are missing the conventional suffix for the file type.

This may not be a crucial or pressing issue, but for the sake of promoting best practices, I think it would be a good idea for the generator to conform to these standard conventions.

Copied from original issue: ionic-team/ionic-cli#1968

@WhatsThatItsPat
Copy link

It's worth considering whether these naming conventions should be taken further given the navigation patterns within Ionic.

I didn't find it useful to have everything named *.component.(ts|html) because then ~90% of my project would be component files without distinction.

Instead, I've taken to using *.page.(ts|html) and *.modal.(ts|html). I save *.component.(ts|html) for smaller pieces within my pages and modals. This is handy for searches (⌘P in VSCode, etc.) as well as eyeballing project structure in a file explorer.

I'm curious to find out what other conventions others are trying.


Side note: While I realize you need to move issues around for your organizational sanity, you're not going to get much feedback when an issue lands on a repo with 1 watcher (not that I have a better solution to offer).

@jaufgang
Copy link

I'm cool with .page.ts, .modal.ts, etc. Style 02-02 allows for inventing a small number of additional type names, and this seems to fit that well.

Do use conventional type names including .service, .component, .pipe, .module, and .directive. Invent additional type names if you must but take care not to create too many.

@jaufgang
Copy link

I didn't notice when I originally entered this issue in the other repo, but this is actually a duplicate of #8 in this repo.

@aces2808
Copy link

what is the best practice for naming files in ionic? on our project we are using names with hyphen i.e. user-service.ts or login-page.ts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants