Skip to content

Commit e66a29d

Browse files
committed
Fix eslint errors
1 parent 271c75d commit e66a29d

File tree

13 files changed

+828
-841
lines changed

13 files changed

+828
-841
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@ coverage/
22
dist/
33
docs/dist
44
dist-es5-module/
5+
node_modules/
6+
assets
7+
.github
8+
scripts

.eslintrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* Using eslint-config-algolia */
22
/* eslint-disable import/no-commonjs */
33
module.exports = {
4-
extends: ['algolia', 'algolia/jest'],
4+
extends: ['algolia', 'algolia/jest', 'plugin:prettier/recommended'],
5+
plugins: ['prettier'],
56
rules: {
67
'no-console': 0,
78
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
89
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
9-
'comma-dangle': 0
10-
}
10+
},
1111
}

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"trailingComma": "none",
2+
"trailingComma": "all",
33
"tabWidth": 2,
44
"semi": false,
55
"singleQuote": true,

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ module.exports = {
33
bail: true,
44
resetMocks: true,
55
restoreMocks: true,
6-
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/docs/']
6+
testPathIgnorePatterns: ['/node_modules/', '/dist/', '/docs/'],
77
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"format:md": "prettier --write '**/*.md'",
1818
"playground": "yarn --cwd ./playgrounds/html && yarn --cwd ./playgrounds/html serve",
1919
"playground:js": "yarn --cwd ./playgrounds/javascript && yarn --cwd ./playgrounds/javascript serve",
20-
"lint": "eslint ./src ./*.js",
21-
"lint-fix": "eslint --fix ./src ./*.js",
20+
"lint": "eslint .",
21+
"lint:fix": "eslint --fix .",
2222
"prettier-ci": "prettier --check ./src/**/*.scss '**/*.md'",
2323
"test": "./scripts/test",
2424
"test:watch": "./scripts/test-watch"

playgrounds/javascript/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ docsSearchBar({
1414
console.info(datasetNumber)
1515
console.info(context)
1616
},
17-
debug: true // Set debug to true if you want to inspect the dropdown
17+
debug: true, // Set debug to true if you want to inspect the dropdown
1818
})

src/lib/DocsSearchBar.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DocsSearchBar {
3939
queryHook = false,
4040
handleSelected = false,
4141
enhancedSearchInput = false,
42-
layout = 'columns'
42+
layout = 'columns',
4343
}) {
4444
DocsSearchBar.checkArguments({
4545
hostUrl,
@@ -54,7 +54,7 @@ class DocsSearchBar {
5454
queryHook,
5555
handleSelected,
5656
enhancedSearchInput,
57-
layout
57+
layout,
5858
})
5959

6060
this.apiKey = apiKey
@@ -66,14 +66,14 @@ class DocsSearchBar {
6666
attributesToHighlight: ['*'],
6767
attributesToCrop: ['content'],
6868
cropLength: 30,
69-
...meilisearchOptions
69+
...meilisearchOptions,
7070
}
7171
this.queryDataCallback = queryDataCallback || null
7272
this.autocompleteOptions = {
7373
debug,
7474
hint: false,
7575
autoselect: true,
76-
...autocompleteOptions
76+
...autocompleteOptions,
7777
}
7878
const inputAriaLabel =
7979
this.input &&
@@ -87,15 +87,16 @@ class DocsSearchBar {
8787
this.autocompleteOptions.cssClasses.prefix || 'dsb'
8888
this.autocompleteOptions.cssClasses.root =
8989
this.autocompleteOptions.cssClasses.root || 'meilisearch-autocomplete'
90-
this.autocompleteOptions.keyboardShortcuts = this.parseHotkeysAutocompleteOptions(
91-
this.autocompleteOptions.keyboardShortcuts
92-
) || ['s', 191]
90+
this.autocompleteOptions.keyboardShortcuts =
91+
this.parseHotkeysAutocompleteOptions(
92+
this.autocompleteOptions.keyboardShortcuts
93+
) || ['s', 191]
9394

9495
this.isSimpleLayout = layout === 'simple'
9596

9697
this.client = new MeiliSearch({
9798
host: hostUrl,
98-
apiKey: this.apiKey
99+
apiKey: this.apiKey,
99100
})
100101

101102
if (enhancedSearchInput) {
@@ -108,9 +109,9 @@ class DocsSearchBar {
108109
templates: {
109110
suggestion: DocsSearchBar.getSuggestionTemplate(this.isSimpleLayout),
110111
footer: templates.footer,
111-
empty: DocsSearchBar.getEmptyTemplate()
112-
}
113-
}
112+
empty: DocsSearchBar.getEmptyTemplate(),
113+
},
114+
},
114115
])
115116

116117
const customHandleSelected = handleSelected
@@ -277,7 +278,7 @@ class DocsSearchBar {
277278
utils.getHighlightedValue(hit, 'lvl3'),
278279
utils.getHighlightedValue(hit, 'lvl4'),
279280
utils.getHighlightedValue(hit, 'lvl5'),
280-
utils.getHighlightedValue(hit, 'lvl6')
281+
utils.getHighlightedValue(hit, 'lvl6'),
281282
])
282283
.join(
283284
'<span class="aa-suggestion-title-separator" aria-hidden="true"> › </span>'
@@ -306,7 +307,7 @@ class DocsSearchBar {
306307
subcategory,
307308
title: displayTitle,
308309
text,
309-
url
310+
url,
310311
}
311312
})
312313
}

0 commit comments

Comments
 (0)