Skip to content

Commit 760f34a

Browse files
authored
feat(relevance): add some synonyms (#192)
This will allow obscure names like i18n an a11y show up, even if a user didn't _exactly_ type them. To be checked on a replica in advance of merging
1 parent 5527533 commit 760f34a

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

src/__tests__/__snapshots__/config.test.js.snap

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,34 @@ Object {
146146
],
147147
"type": "synonym",
148148
},
149+
Object {
150+
"objectID": "a11y",
151+
"synonyms": Array [
152+
"a11y",
153+
"accessibility",
154+
"accessible",
155+
],
156+
"type": "synonym",
157+
},
158+
Object {
159+
"objectID": "i18n",
160+
"synonyms": Array [
161+
"i18n",
162+
"internationalisation",
163+
"internationalization",
164+
"translation",
165+
"translate",
166+
],
167+
"type": "synonym",
168+
},
169+
Object {
170+
"objectID": "k8s",
171+
"synonyms": Array [
172+
"k8s",
173+
"kubernetes",
174+
],
175+
"type": "synonym",
176+
},
149177
],
150178
"jsDelivrHitsEndpoint": "https://data.jsdelivr.com/v1/stats/packages/month/all",
151179
"maxObjSize": 450000,

src/config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,27 @@ const defaultConfig = {
6363
synonyms: ['_', 'underscore'],
6464
objectID: 'underscore',
6565
},
66+
{
67+
type: 'synonym',
68+
synonyms: ['a11y', 'accessibility', 'accessible'],
69+
objectID: 'a11y',
70+
},
71+
{
72+
type: 'synonym',
73+
synonyms: [
74+
'i18n',
75+
'internationalisation',
76+
'internationalization',
77+
'translation',
78+
'translate',
79+
],
80+
objectID: 'i18n',
81+
},
82+
{
83+
type: 'synonym',
84+
synonyms: ['k8s', 'kubernetes'],
85+
objectID: 'k8s',
86+
},
6687
],
6788
indexRules: [
6889
{

0 commit comments

Comments
 (0)