question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I have been using Codelyzer with an Ng2 project and loving it. I have started an Ionic 2 project that uses Codelyzer and it works almost perfectly except for an issue with pages. In Ionic the Component decorator is used for pages but the class name is suffixed with “Page.” For example the file hello-ionic.page.ts would be:

import { Component } from '@angular/core';

@Component({
  templateUrl: 'hello-ionic.page.html'
})
export class HelloIonicPage {
  constructor() {

  }
}

This causes Codelyzer to state that “The name of the class HelloIonicPage should end with the suffix Component”.

Changing componentClassSuffixRule.js line 16 from:

return /.*Component$/.test(className);

to

return (/.*Component$/.test(className) || /.*Page$/.test(className));

Fixes the problem but I figure there is probably a more elegant solution. In Ionic projects there will still be components so is there a way of discerning between a page and component based on location (src/pages/* vs srv/components/*)? Or allowing custom component suffixes in the rules config?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
michaeljotacommented, Jan 25, 2017

I think README.md should be updated with an example for using both, the single syntax and the array syntax, or at least mention it. 😃. Do you mind if I do it?

2reactions
plmetzcommented, Dec 10, 2016

Great! Thanks for all your work on this project

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Development Support Policy - Ionic Framework API
Ionic Framework API is 100% open-source (MIT), and always will be. Read our support policy to see why users know Ionic is the...
Read more >
Support - Ionic.io
Expert mobile support when you need it. From enterprise teams needing critical support to developers looking for help from the community, we have...
Read more >
Ionic 2 Overview | Toptal
Native scrolling support brings better performance and improves the user experience by helping to ensure a smooth scroll thanks to asynchronous events. Improved ......
Read more >
Ionic 2 support - IDEs Support (IntelliJ Platform) | JetBrains
Hello, I am starting to work with Ionic 2 and I would use my all mighty IDEA, but it seems to me that...
Read more >
Ionic 2 Mobile App in Under 60 Minutes - YouTube
In this video we will build a complete Ionic 2 mobile application in under an hour. ... SUPPORT THIS CHANNEL WITH A CUP...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found