Commit 255d807
authored
Respect the original TSLint configuration of
* Respect `ban-types` configuration of TSLint
In the past, this tool didn't respect the TSLint configuration of `ban-types`,
it means even if TSLint specified `ban-types` with the argument, generated
ESLint configuration doesn't contain the detailed configuration of that.
For example, when the TSLint configuration is like the following:
```
{
"rules": {
"ban-types": [true,
["Object", "Use {} instead."],
]
}
}
```
then, older tool generates the following ESLint configuration:
```
"rules": {
"@typescript-eslint/ban-types": "error"
}
```
According to the official documentation, probably this generated result
doesn't make sense because each rule requires the type name (and the message).
https://github.com/typescript-eslint/typescript-eslint/blob/f3160b471f8247e157555b6cf5b40a1f6ccdc233/packages/eslint-plugin/docs/rules/ban-types.md
So this commit makes the generated ESLint configuration to be suitable to the certainly
working configuration, like so:
```
"rules": {
"@typescript-eslint/ban-types": [
"error",
{
"types": {
"Object": {
"message": "Use {} instead."
}
}
}
]
}
```
See also: https://palantir.github.io/tslint/rules/ban-types/
Related ticket: #352
* Use the Record type instead of traditional dict decralation
Fix: #353 (comment)
* Simplify a variable name for banned-types
Fix: #353 (comment)
* Rename an unclear variable name for banned-type to self-descriptive name
Fix: #353 (comment)
* Use short-hand notation for variable substitution
Fix: #353 (comment)
* Check whether a rule is array object or not on `ban-types` converterban-types (#353)1 parent 5051f98 commit 255d807
2 files changed
+93
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
4 | 26 | | |
5 | 27 | | |
6 | 28 | | |
7 | 29 | | |
| 30 | + | |
8 | 31 | | |
9 | 32 | | |
10 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
17 | 86 | | |
0 commit comments