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
|
@ -18,6 +18,7 @@ import onePlural from './rules/onePlural';
|
|||
import noLegacyVariables from './rules/noLegacyVariables';
|
||||
import noNestedChoice from './rules/noNestedChoice';
|
||||
import noOffset from './rules/noOffset';
|
||||
import noOneChoice from './rules/noOneChoice';
|
||||
import noOrdinal from './rules/noOrdinal';
|
||||
import pluralPound from './rules/pluralPound';
|
||||
|
||||
|
@ -26,6 +27,7 @@ const RULES = [
|
|||
noLegacyVariables,
|
||||
noNestedChoice,
|
||||
noOffset,
|
||||
noOneChoice,
|
||||
noOrdinal,
|
||||
onePlural,
|
||||
pluralPound,
|
||||
|
@ -38,23 +40,34 @@ type Test = {
|
|||
|
||||
const tests: Record<string, Test> = {
|
||||
'icu:err1': {
|
||||
messageformat: '{a, plural, other {a}} {b, plural, other {b}}',
|
||||
messageformat:
|
||||
'{a, plural, one {a} other {as}} {b, plural, one {b} other {bs}}',
|
||||
expectErrors: ['onePlural'],
|
||||
},
|
||||
'icu:err2': {
|
||||
messageformat: '{a, plural, other {{b, plural, other {b}}}}',
|
||||
messageformat:
|
||||
'{a, plural, one {a} other {{b, plural, one {b} other {bs}}}}',
|
||||
expectErrors: ['noNestedChoice', 'onePlural'],
|
||||
},
|
||||
'icu:err3': {
|
||||
messageformat: '{a, select, other {{b, select, other {b}}}}',
|
||||
messageformat:
|
||||
'{a, select, one {a} other {{b, select, one {b} other {bs}}}}',
|
||||
expectErrors: ['noNestedChoice'],
|
||||
},
|
||||
'icu:err4': {
|
||||
messageformat: '{a, plural, offset:1 other {a}}',
|
||||
messageformat: '{a, plural, offset:1 one {a} other {as}}',
|
||||
expectErrors: ['noOffset'],
|
||||
},
|
||||
'icu:noOneChoice:1': {
|
||||
messageformat: '{a, plural, other {a}}',
|
||||
expectErrors: ['noOneChoice'],
|
||||
},
|
||||
'icu:noOneChoice:2': {
|
||||
messageformat: '{a, plural}',
|
||||
expectErrors: ['noOneChoice'],
|
||||
},
|
||||
'icu:err5': {
|
||||
messageformat: '{a, selectordinal, other {a}}',
|
||||
messageformat: '{a, selectordinal, one {a} other {as}}',
|
||||
expectErrors: ['noOrdinal'],
|
||||
},
|
||||
'icu:err6': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue