变量声明时,要求一次仅声明一个变量。该规则仅检查.ets文件类型。
let a: string = 'hello';
let b: string = 'world';
a += 'my';
b += 'my';
const c: string = 'hello';
const d: string = 'world';
console.info(`a: ${a}, b: ${b}, c: ${c}, d: ${d}`); // Split 'const' declarations into multiple statements. const a: string = 'hello', b: string = 'world';
"plugin:@hw-stylistic/recommended" "plugin:@hw-stylistic/all"
Code Linter代码检查规则的配置指导请参考Code Linter代码检查(ArkTS/TS)。