Add noOneChoice icu rule and fix broken string
This commit is contained in:
parent
5c1b5dcad8
commit
7c8dec4b21
3 changed files with 36 additions and 6 deletions
17
build/intl-linter/rules/noOneChoice.ts
Normal file
17
build/intl-linter/rules/noOneChoice.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { rule } from '../utils/rule';
|
||||
|
||||
export default rule('noOneChoice', context => {
|
||||
return {
|
||||
enterPlural(element) {
|
||||
if (Object.keys(element.options).length < 2) {
|
||||
context.report(
|
||||
'{plural} requires multiple options for Smartling',
|
||||
element.location
|
||||
);
|
||||
}
|
||||
},
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue