Skip to content

Commit e553e4e

Browse files
author
Leonid Buneev
committed
Fix lint issues; bump version
1 parent 0000153 commit e553e4e

File tree

6 files changed

+47
-16
lines changed

6 files changed

+47
-16
lines changed

.eslintrc.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,27 @@ module.exports = {
22
root: true,
33
extends: ['plugin:tyrecheck/recommended'],
44
rules: {
5+
'md/remark': [
6+
'error',
7+
{
8+
plugins: [
9+
'preset-lint-markdown-style-guide',
10+
'frontmatter',
11+
// Disable rules handled by Prettier
12+
['lint-maximum-line-length', false],
13+
['lint-emphasis-marker', false],
14+
['lint-list-item-indent', false],
15+
['lint-list-item-spacing', false],
16+
['lint-ordered-list-marker-value', false],
17+
['lint-no-consecutive-blank-lines', false],
18+
['lint-table-cell-padding', false],
19+
['lint-link-title-style', false],
20+
['lint-no-shortcut-reference-link', false],
21+
['lint-no-shortcut-reference-link', false],
22+
['lint-no-duplicate-headings', false],
23+
],
24+
},
25+
],
526
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
627
'no-console': [process.env.NODE_ENV === 'production' ? 'error' : 'off', { allow: ['warn', 'error'] }],
728
},

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased
66

7+
## 2.2.0 (2021-04-04)
8+
9+
### Added
10+
11+
- Ability to pass-through flexSearch configuration (@echojoshchen in #44)
12+
13+
### Changed
14+
15+
- Fixed #41 - HTML parsing by updating dependency on html-to-text (@echojoshchen in #42)
16+
- updated dependencies
17+
718
## 2.1.0 (2020-10-22)
819

920
### Added

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,15 @@ async function onGoToSuggestion(index: number, suggestion: Suggestion, queryStri
116116

117117
### Additional configuration
118118

119-
You can set additional configuration options in the config file. For `tokenize`, `split`, and
120-
`encode`, see the [flexsearch documentation][flexsearch-options] for more details.
119+
You can set additional configuration options in the config file. For `tokenize`, `split`, and `encode`, see the
120+
[flexsearch documentation][flexsearch-options] for more details.
121121

122-
* `tokenize`: The indexing mode (tokenizer). Choose one of the built-ins or pass a custom tokenizer
123-
function.
124-
* `split`: The rule to split words when using non-custom tokenizer (built-ins e.g. "forward"). Use a
125-
string/char or use a regular expression (default: `/\W+/`).
126-
* `encode`: The encoding type. Choose one of the built-ins or pass a custom encoding function.
122+
- `tokenize`: The indexing mode (tokenizer). Choose one of the built-ins or pass a custom tokenizer function.
123+
- `split`: The rule to split words when using non-custom tokenizer (built-ins e.g. "forward"). Use a string/char or use
124+
a regular expression (default: `/\W+/`).
125+
- `encode`: The encoding type. Choose one of the built-ins or pass a custom encoding function.
127126

128-
The built-in `searchMaxSuggestions` will be used if set in the
129-
[theme config][search-max-suggestions].
127+
The built-in `searchMaxSuggestions` will be used if set in the [theme config][search-max-suggestions].
130128

131129
For example:
132130

@@ -144,9 +142,10 @@ module.exports = {
144142
],
145143
themeConfig: {
146144
searchMaxSuggestions: 10,
147-
}
145+
},
148146
}
149147
```
150148

151-
[flexsearch-options]: [https://github.com/nextapps-de/flexsearch#initialize-index]
152-
[search-max-suggestions]: https://vuepress.vuejs.org/theme/default-theme-config.html#built-in-search
149+
[flexsearch-options][https://github.com/nextapps-de/flexsearch#initialize-index]
150+
151+
[search-max-suggestions][https://vuepress.vuejs.org/theme/default-theme-config.html#built-in-search]

components/SearchBox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export default {
9090
},
9191
/* global OPTIONS */
9292
mounted() {
93-
const options = OPTIONS || {};
93+
const options = OPTIONS || {}
9494
flexsearchSvc.buildIndex(this.$site.pages, options)
9595
this.placeholder = this.$site.themeConfig.searchPlaceholder || ''
9696
document.addEventListener('keydown', this.onHotkey)

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function getCustomTitles(globalCtx) {
9999
}
100100
return result
101101
} catch (e) {
102-
console.log('[fulltext-search] Error while getting sidebar paths:', e)
102+
console.error('[fulltext-search] Error while getting sidebar paths:', e)
103103
return {}
104104
}
105105
}
@@ -110,7 +110,7 @@ function normalizePath(rawPath) {
110110
const parsedPath = path.parse(rawPath)
111111
return path.join(parsedPath.dir, parsedPath.name)
112112
} catch (e) {
113-
console.log(`[fulltext-search] Error while normalizing path ${rawPath}:`, e)
113+
console.error(`[fulltext-search] Error while normalizing path ${rawPath}:`, e)
114114
return null
115115
}
116116
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-plugin-fulltext-search",
3-
"version": "2.1.0",
3+
"version": "2.2.0",
44
"description": "Adds full-text search capabilities to your vuepress site with a help of flexsearch library.",
55
"main": "index.js",
66
"repository": "https://github.com/leo-buneev/vuepress-plugin-fulltext-search.git",

0 commit comments

Comments
 (0)