TypeScript coding guidelines say to not prefix interface with I #3265
Comments
Note that these are the guidelines for writing the typescript compiler itself. It's not meant to be a style guide for any other typescript project out there. |
50 cent from a passer-by: |
I tried turning off the "I" prefix by adding interface-name to the default {
"extends": [
"tslint:recommended",
"tslint-react",
"tslint-config-prettier"
],
"linterOptions": {
"exclude": [
"config/**/*.js",
"node_modules/**/*.ts"
]
},
"interface-name" : [true, "never-prefix"]
} |
Nevermind, I figured it out: {
"extends": [
"tslint:recommended",
"tslint-react",
"tslint-config-prettier"
],
"linterOptions": {
"exclude": [
"config/**/*.js",
"node_modules/**/*.ts"
]
},
"rules": {
"interface-name" : [true, "never-prefix"]
}
} |
For some reason |
@vasilev-alex |
I'm still getting this is my tslint.json:
What am I doing wrong? |
@offg777 Nothing obvious. Link to repo? |
The config looks correct to me - are you sure theres nothing else overriding it? The rule is definitely working properly for me |
@offg777
From where do you get this error? From your IDE or when running a CLI? |
厉害 |
Does eslint support that already? |
Setting
results in Maybe this rule exists for a reason? Should every interface have a meaningful name obviously different from an implementing class? |
This is bloody annoying idea of forcing the rest of the world following your preferences outside the your own project. Obtrusion of your own naming conventions in programming tools is a bug of the product developer neural network ;) |
Good thing TSLint is deprecated and this issue is no longer relevant, then! #4534 |
Bug Report
TypeScript code being linted
Actual behavior
[tslint] interface name must start with a capitalized I (interface-name)
Microsoft suggests interface names to not be prefixed with an I - https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#names
The text was updated successfully, but these errors were encountered: