8
票
Accepted
TypeScript で文字列と数値の加算(連結)を禁止か検出したい
TSの機能としては見つけられませんでしたが、tslintならばそれっぽいルールが有りました。
restrict-plus-operands です。
ルールのテスト例: https://github.com/palantir/tslint/blob/master/test/rules/restrict-plus-operands/test.ts.lint
Only top scored, non community-wiki answers of a minimum length are eligible