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

interface IX123abc throw an error #4624

Closed
thomas3577 opened this issue Apr 2, 2019 · 3 comments · Fixed by #4626
Closed

interface IX123abc throw an error #4624

thomas3577 opened this issue Apr 2, 2019 · 3 comments · Fixed by #4626

Comments

@thomas3577
Copy link

Bug Report

  • TSLint V5.15.0:
  • TypeScript V3.2.4:
  • Running TSLint via: CLI, VSCode

TypeScript code being linted

interface II18nService {
}

class I18nService implements II18nService {
}

with tslint.json configuration:

...
"interface-name": [
  true,
  "always-prefix"
],
...

Actual behavior

ERROR: .../i18n.service.ts: - interface name must start with a capitalized I

Expected behavior

No Error

Examples that work:

  • IAnything
  • IIanything
  • INanything

Examples that don't work:

  • II18anything
  • IN18anything

It seems the numbers in the interface-name are a problem.

And by the way: A Class with the name I18nService works fine.

@VincentLanglet
Copy link
Contributor

VincentLanglet commented Apr 2, 2019

I did this #4626

The main issue was the function isLowerCase and isUpperCase

isLowerCase('3') = true
isUpperCase('3') = true

@chulanovskyi
Copy link

chulanovskyi commented Apr 4, 2019

The problem still exists. After upgrading from 5.14 to 5.15 started to receive such errors:

Screenshot from 2019-04-04 17-55-04

I suppose that tslint expects that the name of the interface should start from two (?) capital letters? Is this documented somewhere?

@VincentLanglet
Copy link
Contributor

@chulanovskyi The PR is not already merge.

But you don't have the same issue. The doc can be updated this way

Requires interface names to begin with a capital ‘I’ prefix

tslint expect IInjectedToggleStateProps in your case

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

Successfully merging a pull request may close this issue.

3 participants