Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng new --prefix kebap-case causes lint errors in directives #13796

Closed
pa-ru opened this issue Mar 1, 2019 · 1 comment · Fixed by #13797
Closed

ng new --prefix kebap-case causes lint errors in directives #13796

pa-ru opened this issue Mar 1, 2019 · 1 comment · Fixed by #13797
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@pa-ru
Copy link

pa-ru commented Mar 1, 2019

🐞 Bug report

Command (mark with an x)

- [x] new

Is this a regression?

unknown but probably not

Description

If you create a new app with ng new --prefix compony-domain the prefix results in the following
tslint.json is generated:

{
    "extends": "../tslint.json",
    "rules": {
        "directive-selector": [
            true,
            "attribute",
            "company-domain",
            "camelCase"
        ],
        "component-selector": [
            true,
            "element",
            "company-domain",
            "kebab-case"
        ]
    }
}

If you create a new directive with ng g d highlight the resulting selector is companyDomainHighlight and causes lint errors.

🔬 Minimal Reproduction

  • ng new kebap-case --prefix kebap-case
  • ng g d highlight
  • ng lint

🔥 Exception or Error


$ ng lint
Linting "kebap-case"...

ERROR: D:/src/kebap-case/src/app/highlight.directive.ts[4, 13]: The selector of the directive "HighlightDirective" should have prefix "kebap-case" (https://angular.io/styleguide#style-02-08)

Lint errors found in the listed files.

🌍 Your Environment


Angular CLI: 7.3.4
Node: 8.14.0
OS: win32 x64
Angular: 7.2.7
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.4
@angular-devkit/build-angular     0.13.4
@angular-devkit/build-optimizer   0.13.4
@angular-devkit/build-webpack     0.13.4
@angular-devkit/core              7.3.4
@angular-devkit/schematics        7.3.4
@angular/cli                      7.3.4
@ngtools/webpack                  7.3.4
@schematics/angular               7.3.4
@schematics/update                0.13.4
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0

Anything else relevant?

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity3: broken area: schematics/angular labels Mar 1, 2019
@ngbot ngbot bot added this to the needsTriage milestone Mar 1, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Mar 1, 2019
hansl pushed a commit that referenced this issue Mar 4, 2019
… directives

`Component` selectors are always kekabed while `Directive` selectors are always camelized. This updates the lint rules to convert the prefix to the appropiate case

Fixes #13796
hansl pushed a commit that referenced this issue Mar 4, 2019
… directives

`Component` selectors are always kekabed while `Directive` selectors are always camelized. This updates the lint rules to convert the prefix to the appropiate case

Fixes #13796
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants