diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c6c8b36 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.github/workflows/bb.yml b/.github/workflows/bb.yml new file mode 100644 index 0000000..0198fc3 --- /dev/null +++ b/.github/workflows/bb.yml @@ -0,0 +1,13 @@ +name: bb +on: + issues: + types: [opened, reopened, edited, closed, labeled, unlabeled] + pull_request_target: + types: [opened, reopened, edited, closed, labeled, unlabeled] +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: unifiedjs/beep-boop-beta@main + with: + repo-token: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..05032de --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,24 @@ +name: main +on: + - pull_request + - push +jobs: + main: + name: '${{matrix.node}} on ${{matrix.os}}' + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v2 + - uses: dcodeIO/setup-node-nvm@master + with: + node-version: ${{matrix.node}} + - run: npm install + - run: npm test + - uses: codecov/codecov-action@v1 + strategy: + matrix: + os: + - ubuntu-latest + - windows-latest + node: + - lts/erbium + - node diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..cebe81f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +coverage/ +*.md diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 2d761d1..bf1e36e 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -1,27 +1,29 @@ # Configuration -The default settings are **roughly**[(see the exact configuration)](#default-settings) equal to: +The default settings are **roughly** +[(see the exact configuration)](#default-settings) equal to: ```json { - "retext-english": { - "plugins": [ - ["#retext-profanities"], - ["#retext-spell", "#dictionary-en-gb"] - ], - }, - "remark-parse": { - "plugins": [ - ["#remark-preset-lint-markdown-style-guide"] - ["#remark-retext", "#parse-latin"], - ["#retext-profanities"], - ["#retext-spell", "#dictionary-en-gb"] - ] - } + "retext-english": { + "plugins": [ + ["#retext-profanities"], + ["#retext-spell", "#dictionary-en-gb"] + ], + }, + "remark-parse": { + "plugins": [ + ["#remark-preset-lint-markdown-style-guide"] + ["#remark-retext", "#parse-latin"], + ["#retext-profanities"], + ["#retext-spell", "#dictionary-en-gb"] + ] + } } ``` -Your text editors (if they are [LSP clients](https://langserver.org/)) can be configured to override these settings. +Your text editors (if they are [LSP clients](https://langserver.org/)) can be +configured to override these settings. ## Configuration for text editors @@ -36,18 +38,18 @@ and the file `/home/aecepoglu/.settings.json` would be: ```json { - "unified-language-server": { - "retext-english": { - "plugins": [ - ... - ] - }, - "remark-parse": { - "plugins": [ - ... - ] - } - } + "unified-language-server": { + "retext-english": { + "plugins": [ + ... + ] + }, + "remark-parse": { + "plugins": [ + ... + ] + } + } } ``` @@ -55,63 +57,67 @@ and the file `/home/aecepoglu/.settings.json` would be: (TODO) --------------------- +*** ## Re-Using Settings -If I wanted to use `retext-redundant-acronyms`, `retext-overuse`, `retext-intensify` and `retext-repeated-words` plugins for my text files and markdown files, I would do: +If I wanted to use `retext-redundant-acronyms`, `retext-overuse`, +`retext-intensify` and `retext-repeated-words` plugins for my text files and +markdown files, I would do: ```json { - "unified-language-server": { - "retext-english": { - "plugins": [ - ["#retext-redundant-acronyms"], - ["#retext-overuse"], - ["#retext-intensify"], - ["#retext-repeated-words"], - ["#retext-spell", "#dictionary-en-gb"] - ] - }, - "remark-parse": { - "plugins": [ - ["#remark-preset-lint-markdown-style-guide"], - ["#remark-retext", "#parse-latin"], - ["#retext-redundant-acronyms"], - ["#retext-overuse"], - ["#retext-intensify"], - ["#retext-repeated-words"], - ["#retext-spell", "#dictionary-en-gb"] - ] - } - } + "unified-language-server": { + "retext-english": { + "plugins": [ + ["#retext-redundant-acronyms"], + ["#retext-overuse"], + ["#retext-intensify"], + ["#retext-repeated-words"], + ["#retext-spell", "#dictionary-en-gb"] + ] + }, + "remark-parse": { + "plugins": [ + ["#remark-preset-lint-markdown-style-guide"], + ["#remark-retext", "#parse-latin"], + ["#retext-redundant-acronyms"], + ["#retext-overuse"], + ["#retext-intensify"], + ["#retext-repeated-words"], + ["#retext-spell", "#dictionary-en-gb"] + ] + } + } } ``` -*BUT*, I (as a sane person) want my markdown rules to just follow my `retext-english` rules. I could enable that with: +*BUT*, I (as a sane person) want my markdown rules to just follow my +`retext-english` rules. +I could enable that with: ```json { - "unified-language-server": { - "retext-english": { - "plugins": [ - ["#retext-redundant-acronyms"], - ["#retext-overuse"], - ["#retext-intensify"], - ["#retext-repeated-words"], - ["#retext-spell", "#dictionary-en-gb"] - ] - }, - "remark-parse": { - "plugins": [ - ["#remark-preset-lint-markdown-style-guide"] - ], - "checkTextWith": { - "setting": "retext-english", - "mutator": ["#remark-retext", "#parse-latin"] - } - } - } + "unified-language-server": { + "retext-english": { + "plugins": [ + ["#retext-redundant-acronyms"], + ["#retext-overuse"], + ["#retext-intensify"], + ["#retext-repeated-words"], + ["#retext-spell", "#dictionary-en-gb"] + ] + }, + "remark-parse": { + "plugins": [ + ["#remark-preset-lint-markdown-style-guide"] + ], + "checkTextWith": { + "setting": "retext-english", + "mutator": ["#remark-retext", "#parse-latin"] + } + } + } } ``` @@ -121,52 +127,56 @@ And in fact, this is how the default configuration actually is: ```json { - "unified-language-server": { - "retext-english": { - "plugins": [ - ["#retext-spell", "#dictionary-en-gb"] - ] - }, - "remark-parse": { - "plugins": [ - ["#remark-preset-lint-markdown-style-guide"] - ], - "checkTextWith": { - "setting": "retext-english", - "mutator": ["#remark-retext", "#parse-latin"] - } - }, - } + "unified-language-server": { + "retext-english": { + "plugins": [ + ["#retext-spell", "#dictionary-en-gb"] + ] + }, + "remark-parse": { + "plugins": [ + ["#remark-preset-lint-markdown-style-guide"] + ], + "checkTextWith": { + "setting": "retext-english", + "mutator": ["#remark-retext", "#parse-latin"] + } + }, + } } ``` ## Applying Settings Partially -When you omit any of the parsers in your configuration the default configuration will be used in its place. +When you omit any of the parsers in your configuration the default configuration +will be used in its place. -If are happy with what `remark-parse` does but you want `remark-english` to be different, you could: +If are happy with what `remark-parse` does but you want `remark-english` to be +different, you could: ```json { - "unified-language-server": { - "retext-english": { - "plugins": [ - ["#retext-repeated-words"], - ["#retext-spell", "#dictionary-en-gb"] - ] - } - } + "unified-language-server": { + "retext-english": { + "plugins": [ + ["#retext-repeated-words"], + ["#retext-spell", "#dictionary-en-gb"] + ] + } + } } ``` -# The Format +## The Format (TODO) -We rely entirely on [UnifiedJS parsers and processors](https://github.com/unifiedjs/unified#list-of-processors). +We rely entirely on +[UnifiedJS parsers and processors](https://github.com/unifiedjs/unified#list-of-processors). The command line `--parser` option is used to parse the data. -If a string value starts with `#`, then the module with that name will be required. +If a string value starts with `#`, then the module with that name will be +required. If a string value starts with `//`, then the file with that path will be read. diff --git a/README.md b/README.md index 06319c9..62159ab 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,15 @@ A [language server](http://langserver.org) for text. It supports all formats [Unified.JS](https://unified.js.org) can understand: -- plain text -- markdown -- HTML -- and [other syntax](https://github.com/unifiedjs/awesome#syntaxes) +* plain text +* markdown +* HTML +* and [other syntax](https://github.com/unifiedjs/awesome#syntaxes) And it provides: -- prose and syntax checking -- formatting *(in progress)* +* prose and syntax checking +* formatting *(in progress)* ## Install @@ -26,8 +26,8 @@ npm install -g unified-language-server And configure your text editor to use: -- `unified-language-server --parser=retext-english --stdio` for `text` -- `unified-language-server --parser=remark-parse --stdio` for `markdown` +* `unified-language-server --parser=retext-english --stdio` for `text` +* `unified-language-server --parser=remark-parse --stdio` for `markdown` ### For NeoVim @@ -39,39 +39,41 @@ let g:LanguageClient_serverCommands = { \ } ``` -And you're ready to go! +And you’re ready to go! ## Configuration -The server has default configurations for `remark-parse`(for markdown) and `remark-english`(for text): +The server has default configurations for `remark-parse`(for markdown) and +`remark-english` (for text): ```json { - "retext-english": { - "plugins": [ - ["#retext-profanities"], - ["#retext-spell", "#dictionary-en-gb"] - ], - }, - "remark-parse": { - "plugins": [ - ["#remark-preset-lint-markdown-style-guide"] - ["#remark-retext", "#parse-latin"], - ["#retext-profanities"], - ["#retext-spell", "#dictionary-en-gb"] - ] - } + "retext-english": { + "plugins": [ + ["#retext-profanities"], + ["#retext-spell", "#dictionary-en-gb"] + ], + }, + "remark-parse": { + "plugins": [ + ["#remark-preset-lint-markdown-style-guide"] + ["#remark-retext", "#parse-latin"], + ["#retext-profanities"], + ["#retext-spell", "#dictionary-en-gb"] + ] + } } ``` So, for a markdown file: -1. because we launched it with `--parser=remark-parse`, it finds the setting with the same name -2. applies all the plugins: - 1. `remark-preset-lint-markdown-style-guide` checks for markdown usage - 2. `remark-retext` extracts the texts from markdown - 3. `retext-profanities` about usage of profanity words - 4. `retext-spell` does spellcheck +1. because we launched it with `--parser=remark-parse`, it finds the setting + with the same name +2. applies all the plugins: + 1. `remark-preset-lint-markdown-style-guide` checks for markdown usage + 2. `remark-retext` extracts the texts from markdown + 3. `retext-profanities` about usage of profanity words + 4. `retext-spell` does spellcheck More detail on configuration is available at [CONFIGURATION.md](CONFIGURATION.md) @@ -79,8 +81,7 @@ More detail on configuration is available at [CONFIGURATION.md](CONFIGURATION.md To contribute, please: -- Report any and all issues that you have -- In your issues make sure to mention: - - what version of the server you are running - - your configurations (if you have any) - +* Report any and all issues that you have +* In your issues make sure to mention: + * what version of the server you are running + * your configurations (if you have any) diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index ec00464..0000000 --- a/package-lock.json +++ /dev/null @@ -1,1477 +0,0 @@ -{ - "name": "unified-language-server", - "version": "0.3.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@sinonjs/commons": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.3.0.tgz", - "integrity": "sha512-j4ZwhaHmwsCb4DlDOIWnI5YyKDNMoNThsmwEpfHx6a1EpsGZ9qYLxP++LMlmBRjtGptGHFsGItJ768snllFWpA==", - "dev": true, - "requires": { - "type-detect": "4.0.8" - } - }, - "@sinonjs/formatio": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.1.0.tgz", - "integrity": "sha512-ZAR2bPHOl4Xg6eklUGpsdiIJ4+J1SNag1DHHrG/73Uz/nVwXqjgUtRPLoS+aVyieN9cSbc0E4LsU984tWcDyNg==", - "dev": true, - "requires": { - "@sinonjs/samsam": "^2 || ^3" - } - }, - "@sinonjs/samsam": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.0.2.tgz", - "integrity": "sha512-m08g4CS3J6lwRQk1pj1EO+KEVWbrbXsmi9Pw0ySmrIbcVxVaedoFgLvFsV8wHLwh01EpROVz3KvVcD1Jmks9FQ==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.0.2", - "array-from": "^2.1.1", - "lodash.get": "^4.4.2" - } - }, - "@types/node": { - "version": "10.12.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", - "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==" - }, - "@types/unist": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.2.tgz", - "integrity": "sha512-iHI60IbyfQilNubmxsq4zqSjdynlmc2Q/QvH9kjzg9+CCYVVzq1O6tc7VBzSygIwnmOt07w80IG6HDQvjv3Liw==" - }, - "@types/vfile": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/vfile/-/vfile-3.0.2.tgz", - "integrity": "sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw==", - "requires": { - "@types/node": "*", - "@types/unist": "*", - "@types/vfile-message": "*" - } - }, - "@types/vfile-message": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/vfile-message/-/vfile-message-1.0.1.tgz", - "integrity": "sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA==", - "requires": { - "@types/node": "*", - "@types/unist": "*" - } - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "array-iterate": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-1.1.2.tgz", - "integrity": "sha512-1hWSHTIlG/8wtYD+PPX5AOBtKWngpDFjrsrHgZpe+JdgNGz0udYu6ZIkAa/xuenIUEqFv7DvE2Yr60jxweJSrQ==" - }, - "bail": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.3.tgz", - "integrity": "sha512-1X8CnjFVQ+a+KW36uBNMTU5s8+v5FzeqrP7hTG5aTb4aPreSbZJlhwPon9VKMuEVgV++JM+SQrALY3kr7eswdg==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "character-entities": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.2.tgz", - "integrity": "sha512-sMoHX6/nBiy3KKfC78dnEalnpn0Az0oSNvqUWYTtYrhRI5iUIYsROU48G+E+kMFQzqXaJ8kHJZ85n7y6/PHgwQ==" - }, - "character-entities-legacy": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.2.tgz", - "integrity": "sha512-9NB2VbXtXYWdXzqrvAHykE/f0QJxzaKIpZ5QzNZrrgQ7Iyxr2vnfS8fCBNVW9nUEZE0lo57nxKRqnzY/dKrwlA==" - }, - "character-reference-invalid": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.2.tgz", - "integrity": "sha512-7I/xceXfKyUJmSAn/jw8ve/9DyOP7XxufNYLI9Px7CmsKgEUaZLUTax6nZxGQtaoiZCjpu6cHPj20xC/vqRReQ==" - }, - "co": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/co/-/co-3.1.0.tgz", - "integrity": "sha1-TqVOpaCJOBUxheFSEMaNkJK8G3g=" - }, - "collapse-white-space": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.4.tgz", - "integrity": "sha512-YfQ1tAUZm561vpYD+5eyWN8+UsceQbSrqqlc/6zDY2gtAE+uZLSdkkovhnGpmCThsvKBFakq4EdY/FF93E8XIw==" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", - "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", - "dev": true - }, - "define-properties": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "dev": true, - "requires": { - "object-keys": "^1.0.12" - } - }, - "defined": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", - "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", - "dev": true - }, - "dictionary-en-gb": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dictionary-en-gb/-/dictionary-en-gb-2.0.0.tgz", - "integrity": "sha512-Li5KnDPOVMlDYaeNoLP/tNzmqrbhnzVfV8skCAR0hwsxKjOWFP/SVQVnltXtpsjBLDxpdiunztViLZIBkHU/+A==" - }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "es-abstract": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", - "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", - "dev": true, - "requires": { - "es-to-primitive": "^1.2.0", - "function-bind": "^1.1.1", - "has": "^1.0.3", - "is-callable": "^1.1.4", - "is-regex": "^1.0.4", - "object-keys": "^1.0.12" - } - }, - "es-to-primitive": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", - "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", - "dev": true, - "requires": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "requires": { - "is-callable": "^1.1.3" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true - }, - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "has-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", - "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" - }, - "irregular-plurals": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-2.0.0.tgz", - "integrity": "sha512-Y75zBYLkh0lJ9qxeHlMjQ7bSbyiSqNW/UOPWDmzC7cXskL1hekSITh1Oc6JV0XCWWZ9DE8VYSB71xocLk3gmGw==" - }, - "is-alphabetical": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.2.tgz", - "integrity": "sha512-V0xN4BYezDHcBSKb1QHUFMlR4as/XEuCZBzMJUU4n7+Cbt33SmUnSol+pnXFvLxSHNq2CemUXNdaXV6Flg7+xg==" - }, - "is-alphanumerical": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.2.tgz", - "integrity": "sha512-pyfU/0kHdISIgslFfZN9nfY1Gk3MquQgUm1mJTjdkEPpkAKNWuBTSqFwewOpR7N351VkErCiyV71zX7mlQQqsg==", - "requires": { - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0" - } - }, - "is-buffer": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", - "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==" - }, - "is-callable": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", - "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", - "dev": true - }, - "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", - "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", - "dev": true - }, - "is-decimal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.2.tgz", - "integrity": "sha512-TRzl7mOCchnhchN+f3ICUCzYvL9ul7R+TYOsZ8xia++knyZAJfv/uA1FvQXsAnYIl1T3B2X5E/J7Wb1QXiIBXg==" - }, - "is-hexadecimal": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.2.tgz", - "integrity": "sha512-but/G3sapV3MNyqiDBLrOi4x8uCIw0RY3o/Vb5GT0sMFHrVV7731wFSVy41T5FO1og7G0gXLJh0MkgPRouko/A==" - }, - "is-plain-obj": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" - }, - "is-regex": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", - "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", - "dev": true, - "requires": { - "has": "^1.0.1" - } - }, - "is-symbol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", - "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", - "dev": true, - "requires": { - "has-symbols": "^1.0.0" - } - }, - "is-whitespace-character": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz", - "integrity": "sha512-SzM+T5GKUCtLhlHFKt2SDAX2RFzfS6joT91F2/WSi9LxgFdsnhfPK/UIA+JhRR2xuyLdrCys2PiFDrtn1fU5hQ==" - }, - "is-word-character": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.2.tgz", - "integrity": "sha512-T3FlsX8rCHAH8e7RE7PfOPZVFQlcV3XRF9eOOBQ1uf70OxO7CjjSOjeImMPCADBdYWcStAbVbYvJ1m2D3tb+EA==" - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "just-extend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.0.2.tgz", - "integrity": "sha512-FrLwOgm+iXrPV+5zDU6Jqu4gCRXbWEQg2O3SKONsWE4w7AXFRkryS53bpWdaL9cNol+AmR3AEYz6kn+o0fCPnw==", - "dev": true - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, - "lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" - }, - "lolex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-3.0.0.tgz", - "integrity": "sha512-hcnW80h3j2lbUfFdMArd5UPA/vxZJ+G8vobd+wg3nVEQA0EigStbYcrG030FJxL6xiDDPEkoMatV9xIh5OecQQ==", - "dev": true - }, - "markdown-escapes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.2.tgz", - "integrity": "sha512-lbRZ2mE3Q9RtLjxZBZ9+IMl68DKIXaVAhwvwn9pmjnPLS0h/6kyBMgNhqi1xFJ/2yv6cSyv0jbiZavZv93JkkA==" - }, - "mdast-comment-marker": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/mdast-comment-marker/-/mdast-comment-marker-1.0.3.tgz", - "integrity": "sha512-FZXxBBYeJ/R6k9zgyVGygHWka6FDJdzSbP6kcvB+L4Yqz62po57rZlnA2I14LIKsb3XPEky4vgP0Y83tZXTw7Q==" - }, - "mdast-util-heading-style": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mdast-util-heading-style/-/mdast-util-heading-style-1.0.4.tgz", - "integrity": "sha512-n4fUvwpR5Uj1Ti658KxYDq9gR0UF3FK1UVTVig12imrSOssQU2OpUysje8nps5Cb85b6eau5akpWW7Zkxtv1XA==" - }, - "mdast-util-to-nlcst": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/mdast-util-to-nlcst/-/mdast-util-to-nlcst-3.2.2.tgz", - "integrity": "sha512-TmJlri8dHt7duRU6jfWBMqf5gW+VZ6o/8GHaWzwdxslseB2lL8bSOiox6c8VwYX5v2E4CzUWm/1GkAYqgbNw9A==", - "requires": { - "nlcst-to-string": "^2.0.0", - "repeat-string": "^1.5.2", - "unist-util-position": "^3.0.0", - "vfile-location": "^2.0.0" - } - }, - "mdast-util-to-string": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-1.0.5.tgz", - "integrity": "sha512-2qLt/DEOo5F6nc2VFScQiHPzQ0XXcabquRJxKMhKte8nt42o08HUxNDPk7tt0YPxnWjAT11I1SYi0X0iPnfI5A==" - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - }, - "nise": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.8.tgz", - "integrity": "sha512-kGASVhuL4tlAV0tvA34yJYZIVihrUt/5bDwpp4tTluigxUr2bBlJeDXmivb6NuEdFkqvdv/Ybb9dm16PSKUhtw==", - "dev": true, - "requires": { - "@sinonjs/formatio": "^3.1.0", - "just-extend": "^4.0.2", - "lolex": "^2.3.2", - "path-to-regexp": "^1.7.0", - "text-encoding": "^0.6.4" - }, - "dependencies": { - "lolex": { - "version": "2.7.5", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.5.tgz", - "integrity": "sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==", - "dev": true - } - } - }, - "nlcst-is-literal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/nlcst-is-literal/-/nlcst-is-literal-1.1.2.tgz", - "integrity": "sha512-eFdFvG7XE/YwPFbRk3ryzinTVGWpAEBQNH/FWc4sVSHXUumZtdSVaJYsz0axK4uF1pmlIAWgYWhzDuQ8NTf79A==", - "requires": { - "nlcst-to-string": "^2.0.0" - } - }, - "nlcst-to-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-2.0.2.tgz", - "integrity": "sha512-DV7wVvMcAsmZ5qEwvX1JUNF4lKkAAKbChwNlIH7NLsPR7LWWoeIt53YlZ5CQH5KDXEXQ9Xa3mw0PbPewymrtew==" - }, - "nspell": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/nspell/-/nspell-2.1.1.tgz", - "integrity": "sha512-ubFjxhpFSHbYVAKFgRarIPQ5H5GfFNVQAjv0bYd+vnG+O2nXZJg8o9rXyIzyXdsOZDEhR/PC/GcINXaW7PEnNw==", - "requires": { - "is-buffer": "^2.0.0" - } - }, - "object-inspect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", - "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", - "dev": true - }, - "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "parse-english": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/parse-english/-/parse-english-4.1.1.tgz", - "integrity": "sha512-g7hegR9AFIlGXl5645mG8nQeeWW7SrK7lgmgIWR0KKWvGyZO5mxa4GGoNxRLm6VW2LGpLnn6g4O9yyLJQ4IzQw==", - "requires": { - "nlcst-to-string": "^2.0.0", - "parse-latin": "^4.0.0", - "unist-util-modify-children": "^1.0.0", - "unist-util-visit-children": "^1.0.0" - } - }, - "parse-entities": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.0.tgz", - "integrity": "sha512-XXtDdOPLSB0sHecbEapQi6/58U/ODj/KWfIXmmMCJF/eRn8laX6LZbOyioMoETOOJoWRW8/qTSl5VQkUIfKM5g==", - "requires": { - "character-entities": "^1.0.0", - "character-entities-legacy": "^1.0.0", - "character-reference-invalid": "^1.0.0", - "is-alphanumerical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-hexadecimal": "^1.0.0" - } - }, - "parse-latin": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-4.1.1.tgz", - "integrity": "sha512-9fPVvDdw6G8LxL3o/PL6IzSGNGpF+3HEjCzFe0dN83sZPstftyr+McP9dNi3+EnR7ICYOHbHKCZ0l7JD90K5xQ==", - "requires": { - "nlcst-to-string": "^2.0.0", - "unist-util-modify-children": "^1.0.0", - "unist-util-visit-children": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", - "dev": true - }, - "path-to-regexp": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", - "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", - "dev": true, - "requires": { - "isarray": "0.0.1" - } - }, - "plur": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/plur/-/plur-3.0.1.tgz", - "integrity": "sha512-lJl0ojUynAM1BZn58Pas2WT/TXeC1+bS+UqShl0x9+49AtOn7DixRXVzaC8qrDOIxNDmepKnLuMTH7NQmkX0PA==", - "requires": { - "irregular-plurals": "^2.0.0" - } - }, - "quotation": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/quotation/-/quotation-1.1.1.tgz", - "integrity": "sha512-bjz7kEsfg6D3uMeed+VbeypnooGlX7enMnDbx0KLYEEM8J1k24jk2pc+1nyQ1sExnERz8xKXRSZ0EYNIwLM83g==" - }, - "remark-lint": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/remark-lint/-/remark-lint-6.0.4.tgz", - "integrity": "sha512-miD6SKhjEkLgdJXgAmNhGsdY1yIGAzwpoGIn/59MR6nZhshdxSm9/pLPiw9fK3loNASA3j7k//kea6x5vHb+jQ==", - "requires": { - "remark-message-control": "^4.0.0" - } - }, - "remark-lint-blockquote-indentation": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-blockquote-indentation/-/remark-lint-blockquote-indentation-1.0.2.tgz", - "integrity": "sha512-u3ruA+4ZZOpt3YmTCdCOcYiGBMSQ/b/iJvZs/fibF6rwSBmkod48aGGJVoOLMuIuTYYbbXpzigxS+PeJwN0CDQ==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "plur": "^3.0.0", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-code-block-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-code-block-style/-/remark-lint-code-block-style-1.0.2.tgz", - "integrity": "sha512-fTSCga/lJ710zBaD808NwqzAatVoLQFizvXWpetygKwoAfXCyMYQ9DUdDE5jdDhwOu2JPnKbxY+4t6m4SrKKWA==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-definition-case": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-definition-case/-/remark-lint-definition-case-1.0.3.tgz", - "integrity": "sha512-ORRDV+ETVWnXoPE3fX0zXFGC5NQvdsB1Ihjeqmw38IWVKnOR34f5s/9BZNnbflBzdKWnLVg1g3IwQLf8eVBsow==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.4.0" - } - }, - "remark-lint-definition-spacing": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-definition-spacing/-/remark-lint-definition-spacing-1.0.3.tgz", - "integrity": "sha512-8lFBtgSE3xbvvSuO95B6lUiD6Ph1wZr5xevKokwwfKoyfOkXDpN85wh7JepIZnUj1OnTXvupCwr7yYUEji/Rrw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.4.0" - } - }, - "remark-lint-emphasis-marker": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-emphasis-marker/-/remark-lint-emphasis-marker-1.0.2.tgz", - "integrity": "sha512-c+uvvnYesMaqy/X0dU62dbI6/rk+4dxMXdnfLC/NKBA8GU+4kljWqluW797S6nBG94QZjKIv8m49zJl38QfImQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-fenced-code-flag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-flag/-/remark-lint-fenced-code-flag-1.0.2.tgz", - "integrity": "sha512-6/412zYtz+qKpFJryEPSMurWr6tO5MTVohJF3byFc3+3SSEZLWY3Dg8gbwFlumZ9T4HgmfUm/LT7Idm96zj0nw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-fenced-code-marker": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-fenced-code-marker/-/remark-lint-fenced-code-marker-1.0.2.tgz", - "integrity": "sha512-yAP59Q1JoI1jjOFCn0GoNx4uDji99ROLvdwvmz7+9YR9guDArBcR4i9Wem/wN6apauWPk2DbAZFavHvbZaT8HQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-file-extension": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-file-extension/-/remark-lint-file-extension-1.0.2.tgz", - "integrity": "sha512-qx0uki74rmALIKE3r5J3neasbXnz6h+l88OngvpwWkELsnJmfk81JdxfEd0tZ++uTj6CN0TZuhMKad9smfNtRw==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-final-definition": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-final-definition/-/remark-lint-final-definition-1.0.2.tgz", - "integrity": "sha512-F+n8eauYOJGdcSrnD7w2YgQSERx1rAwXTxStaJ2tLmoXlT7eQgpVGHz1U4Y76cg8OANbq8pT0KTNJ85JNqkq4g==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-hard-break-spaces": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-hard-break-spaces/-/remark-lint-hard-break-spaces-1.0.3.tgz", - "integrity": "sha512-GiC0uXeFwef6/Pfo+EYBN0WIVlEFffh+9TdeJ4uLt89ZweaRVDPCTJQqkkuXoiXSPnZGD7cGHdkWCfXU1PaU7Q==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-heading-increment": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-heading-increment/-/remark-lint-heading-increment-1.0.2.tgz", - "integrity": "sha512-CE3MmARKFk6LK+nBuOUubhr64LnbJfLNx1gA8XgxWJ4s/gf8yZO23KsaWk3ftVmmwk0d8Eqh4qKg8vvvaMyrWQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-heading-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-heading-style/-/remark-lint-heading-style-1.0.2.tgz", - "integrity": "sha512-d0aIbL8PU5LWfZVI8p49vEV5wWIfD/DdUjc+O8j5E0UWUgcRgPGB66xznkOb8AiniXpcaYggRW8hGZsxoYNt1g==", - "requires": { - "mdast-util-heading-style": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-link-title-style": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-link-title-style/-/remark-lint-link-title-style-1.0.3.tgz", - "integrity": "sha512-1cJ/gNoIwX36FB0w8TiT+/Cy0evSJRyn0uV0jeB5Ik+fX+tVxHRkuX/DtmFw0fGImQW882r/3eaZHaKabVR1yg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-list-item-content-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-content-indent/-/remark-lint-list-item-content-indent-1.0.2.tgz", - "integrity": "sha512-I7VkspA/jeMmIWZ4cGmW/4oWnT6fP8pn5n11MR7azRMKgooj3N2qGF084UqrWHh/dLJcakJUNl3NTXv1XCS1Mw==", - "requires": { - "plur": "^3.0.0", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-list-item-indent": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-indent/-/remark-lint-list-item-indent-1.0.3.tgz", - "integrity": "sha512-/IcVUPIxQ2X/oCKzqiAtH85CS8An3xQbcMD0DRBHZjBrIUO0Ot7lBiQedSHwCg9lnh7pDOTvHrmNS3FaWjVQqw==", - "requires": { - "plur": "^3.0.0", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-list-item-spacing": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/remark-lint-list-item-spacing/-/remark-lint-list-item-spacing-1.1.2.tgz", - "integrity": "sha512-IhG28ofW85o/2+eVH1ft1zgQmjxqDhNp3+217EQLQviPt/+jVcMsua4W4ZQECPg0E9473yiY9TKbBodp2kOMkg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-maximum-heading-length": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-heading-length/-/remark-lint-maximum-heading-length-1.0.2.tgz", - "integrity": "sha512-kDdwgRItpVGhxdUC+kbWn5YisCrtF4KggP8z36z26tBmDuPj1ohjQvfMWY0oKL8I0Y6UuXyE0vQx3m4R8Qrj+A==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-maximum-line-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/remark-lint-maximum-line-length/-/remark-lint-maximum-line-length-1.1.1.tgz", - "integrity": "sha512-lqvUBSkKNZJyDnZGlg765OKDNtUgYEPma7BzxdF5JFoYxxOR2V0WyAfnw7VbuZxEmX4UjHmrfAmgOKmybP1hbA==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.4.0" - } - }, - "remark-lint-no-auto-link-without-protocol": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-auto-link-without-protocol/-/remark-lint-no-auto-link-without-protocol-1.0.2.tgz", - "integrity": "sha512-3GtkSxOyd6we4b8JdtJsNgt8+3UN+hpw1UiMoE9X96ahc1rqsCFm6miorNUnF/gfPQ1liHBvZUed2SIenDmpkg==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-blockquote-without-marker": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-blockquote-without-marker/-/remark-lint-no-blockquote-without-marker-2.0.2.tgz", - "integrity": "sha512-jkfZ4hFiviZttEo7Ac7GZWFgMQ/bdVPfSluLeuf+qwL8sQvR4ClklKJ0Xbkk3cLRjvlGsc8U8uZR8qqH5MSLoA==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1", - "vfile-location": "^2.0.1" - } - }, - "remark-lint-no-consecutive-blank-lines": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-consecutive-blank-lines/-/remark-lint-no-consecutive-blank-lines-1.0.2.tgz", - "integrity": "sha512-KbOm6EX5Yl9uzRC93soTB+HlqtCzu9XJWsV9CVcoDKtNnpKfyTwQOy6dmUbQrLp4xBdNk4s9S9CsemRaHEkFGA==", - "requires": { - "plur": "^3.0.0", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-duplicate-headings": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-duplicate-headings/-/remark-lint-no-duplicate-headings-1.0.2.tgz", - "integrity": "sha512-RO3/eQxLjUoHirHIVC+bE5Abzl+gWiJcdPr48gGSP34xfwCeaBAaeorOAxY/hOqOQ/EVNTTA/JHCBVSNPZWIeg==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-stringify-position": "^1.1.2", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-emphasis-as-heading": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-emphasis-as-heading/-/remark-lint-no-emphasis-as-heading-1.0.2.tgz", - "integrity": "sha512-lKlwiRQOFOoPSwjbZf065RaUr6RZmO82zZYjXhVT9xwMkWXIAQyG0GJuLB2/+rlMEtlgoUD3ePch+Pzf+KrSJQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-file-name-articles": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-articles/-/remark-lint-no-file-name-articles-1.0.2.tgz", - "integrity": "sha512-5FuxJ0Hd2AgVSP1javG51qPbMBWxma1LrCKI6JmBsu/GM7ZYOgemMyH5v4I1ejTPGj7P30xmIjMNSnV8IBMq3g==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-consecutive-dashes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-consecutive-dashes/-/remark-lint-no-file-name-consecutive-dashes-1.0.2.tgz", - "integrity": "sha512-VvCxG3AfRm6ROFNJ8+tdOOkk61mEKj+PytB8xg5WNQypKWhhJ734mJ3GzXD4XEov7Bdd1GVXJFXlLFtfoAewHw==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-irregular-characters": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-irregular-characters/-/remark-lint-no-file-name-irregular-characters-1.0.2.tgz", - "integrity": "sha512-8A+DYXsiPBu0q4cvqtYwzRj6SWrKnPh+oI1H1t64pCQiSnLmG9e3mAUXMxH9PiM6y5OW7Vw8Xh4KYsnRwGEuMQ==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-mixed-case": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-mixed-case/-/remark-lint-no-file-name-mixed-case-1.0.2.tgz", - "integrity": "sha512-OMH2kpjvDAsyyw8ar9h6WI1kUXSpQ2r2c5JZv3NBNYxwzTBfhCR2MSQq+eEI7yUmD2ehqNUY5LwZTQZG6cK4vw==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-file-name-outer-dashes": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-no-file-name-outer-dashes/-/remark-lint-no-file-name-outer-dashes-1.0.3.tgz", - "integrity": "sha512-imUWm8Bi9PxV+IQtQC2/BV1Yj0VboC9hPMZh3sae8pZvCjXquTyYiSFa7hQxX6KWCNUiRPHMSlaSVvfvM2e4pQ==", - "requires": { - "unified-lint-rule": "^1.0.0" - } - }, - "remark-lint-no-heading-punctuation": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-heading-punctuation/-/remark-lint-no-heading-punctuation-1.0.2.tgz", - "integrity": "sha512-nYc2a0ihQ5cPy7elaM0lRPYKEMpEK6EjyJH6pHYlgG8NQwjKXhsVaek0fmAm12PaYoYOGW1pDxfzxnFUocU20g==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-inline-padding": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-no-inline-padding/-/remark-lint-no-inline-padding-1.0.3.tgz", - "integrity": "sha512-zEe7LjM13kQshdBtPnSzzCUNzGIX/XiGspMb7HZBCDWYsPJ73s01X+m+YI99Dz7wKvB3EUTZ7/MFhTUIvqcGRw==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.4.0" - } - }, - "remark-lint-no-literal-urls": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-literal-urls/-/remark-lint-no-literal-urls-1.0.2.tgz", - "integrity": "sha512-+mWZIJA4yAqpKIclcFP5wRy/6hxcPnfU9Xmgp4fR7OD4JQ4JHkKq9O7MUbda14PLez1aMX+Is0O0hWI7OuqsSw==", - "requires": { - "mdast-util-to-string": "^1.0.2", - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-multiple-toplevel-headings": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-multiple-toplevel-headings/-/remark-lint-no-multiple-toplevel-headings-1.0.2.tgz", - "integrity": "sha512-Zxkw7wIyMOyYQb5C5NTswSttZPCLqm/60Wnt0TEWzXVDkVk5DrxrCCxbMKgpXve1Co5CXPmMixNr/xYBqzxzWg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-stringify-position": "^1.1.2", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-shell-dollars": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-shell-dollars/-/remark-lint-no-shell-dollars-1.0.2.tgz", - "integrity": "sha512-eIjBebX9iOFWbMdjol5JJBXI7ku+7UyJpNrd++rl8QenLLZ76beh+xONCzJw/k5dhEw5voBmQLh7VK9HPU/ang==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-shortcut-reference-image": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-image/-/remark-lint-no-shortcut-reference-image-1.0.2.tgz", - "integrity": "sha512-IVYv5pgyf70jYcrn+BNHVO37BuQJg26rFOLzi2mj+/8EdFpolJiJcTvkChJgz5yip7317DmQQSNLX6gCExuDrQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-shortcut-reference-link": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-no-shortcut-reference-link/-/remark-lint-no-shortcut-reference-link-1.0.3.tgz", - "integrity": "sha512-v5mk4wYQL+YRmlOTqi8avpzhoGZg+P42dDRda2jedysDIx7TJBEXUH6oMFEbo/qV6PMmtr7fr066M3RrOrLpiQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-no-table-indentation": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-no-table-indentation/-/remark-lint-no-table-indentation-1.0.3.tgz", - "integrity": "sha512-argI2JADlVrlwsdORdbmE89QXB9XtBtAy2YBHZv/q/d247CyL+h+hw9wpg06P1lLQwbllxYJD5u1bNtfgv3XVg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.4.0" - } - }, - "remark-lint-ordered-list-marker-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-style/-/remark-lint-ordered-list-marker-style-1.0.2.tgz", - "integrity": "sha512-4EHuHxZqy8IT4k+4Vc8P38I34AiZfgl07fS5/iqGhCdoSMCvvxdOuzTWTgpDFbx/W2QpHelBfJ+FtOp+E0J4Lg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-ordered-list-marker-value": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-ordered-list-marker-value/-/remark-lint-ordered-list-marker-value-1.0.2.tgz", - "integrity": "sha512-vIPD07u+FBjTjEETZ+UWUp2nydzvOe5AHIX812JlNXWuHYuCybq8DGnkYUcoiK3HbIE+KdG+e7C5xHkim0PSjw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-rule-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-rule-style/-/remark-lint-rule-style-1.0.2.tgz", - "integrity": "sha512-D9mMPKA7rtCe4Yx+ryip6FyfNG9uGOaHxRgJClfte7D66QzxiiWtHYyNCXI4rkv8Ax9PrEdpWCPcIl3D2LrXhw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-strong-marker": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-strong-marker/-/remark-lint-strong-marker-1.0.2.tgz", - "integrity": "sha512-oUSKqYJVLgbXe25NmcTOfQ8wsFasc+qhEoGjPEGPuJMV2aZIGuOEbGVqD5B1ckYGBEwbTuet3btvMohz8HaBDQ==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-table-cell-padding": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/remark-lint-table-cell-padding/-/remark-lint-table-cell-padding-1.0.3.tgz", - "integrity": "sha512-beXwMK8KAGIDQWixf7wzte4GhyB9w33DxTGgmP4HWOWMVXHvBnufJvnIozBBOH9nOsi1fP8NYRb/01hrgjNnmw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.4.0" - } - }, - "remark-lint-table-pipe-alignment": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipe-alignment/-/remark-lint-table-pipe-alignment-1.0.2.tgz", - "integrity": "sha512-gLJwduvBI2soR7Dyf39KGUl3M9ZCK/7pFfWBeOv8J27D7px/1lXooqlX4Y9NQ/+9jc7DyLF9upPxh7UWm7UXGg==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-table-pipes": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-table-pipes/-/remark-lint-table-pipes-1.0.2.tgz", - "integrity": "sha512-BGKcOviuUC6fILIOPYFe6awqk57ApzNJpK3OYBrweGoFF55nZ/qf3q6JpzA0chd6wKj7VrcfQEd3QSQQ+8Wcrw==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-lint-unordered-list-marker-style": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/remark-lint-unordered-list-marker-style/-/remark-lint-unordered-list-marker-style-1.0.2.tgz", - "integrity": "sha512-qdnF9JuMWzFJzGIfdAWfOHyjad8dqIQSs+cTzqMlNZHOGrrCJdTUWzybzcZMGn1yuwreklZdHKhOglXQFwSD3A==", - "requires": { - "unified-lint-rule": "^1.0.0", - "unist-util-generated": "^1.1.0", - "unist-util-position": "^3.0.0", - "unist-util-visit": "^1.1.1" - } - }, - "remark-message-control": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/remark-message-control/-/remark-message-control-4.1.1.tgz", - "integrity": "sha512-DojJPPeSux/U7aHCN6GUWBgp6F1EQFPUNvnk2gfuGgiMCHVubz/xAC3TkvPaf5w1F0PEGaOEpCtvxJK6O4Kmiw==", - "requires": { - "mdast-comment-marker": "^1.0.0", - "unified-message-control": "^1.0.0", - "xtend": "^4.0.1" - } - }, - "remark-parse": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-6.0.3.tgz", - "integrity": "sha512-QbDXWN4HfKTUC0hHa4teU463KclLAnwpn/FBn87j9cKYJWWawbiLgMfP2Q4XwhxxuuuOxHlw+pSN0OKuJwyVvg==", - "requires": { - "collapse-white-space": "^1.0.2", - "is-alphabetical": "^1.0.0", - "is-decimal": "^1.0.0", - "is-whitespace-character": "^1.0.0", - "is-word-character": "^1.0.0", - "markdown-escapes": "^1.0.0", - "parse-entities": "^1.1.0", - "repeat-string": "^1.5.4", - "state-toggle": "^1.0.0", - "trim": "0.0.1", - "trim-trailing-lines": "^1.0.0", - "unherit": "^1.0.4", - "unist-util-remove-position": "^1.0.0", - "vfile-location": "^2.0.0", - "xtend": "^4.0.1" - } - }, - "remark-preset-lint-markdown-style-guide": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/remark-preset-lint-markdown-style-guide/-/remark-preset-lint-markdown-style-guide-2.1.2.tgz", - "integrity": "sha512-0mYeeO084o3ZuDSQCvj5vpMZEGQ/HxPcO5vdNpicu+wKpuGNKV2hYZeHbXa/uZV0gjiQeuRmCHIDgNaDsMj5fg==", - "requires": { - "remark-lint": "^6.0.0", - "remark-lint-blockquote-indentation": "^1.0.0", - "remark-lint-code-block-style": "^1.0.0", - "remark-lint-definition-case": "^1.0.0", - "remark-lint-definition-spacing": "^1.0.0", - "remark-lint-emphasis-marker": "^1.0.0", - "remark-lint-fenced-code-flag": "^1.0.0", - "remark-lint-fenced-code-marker": "^1.0.0", - "remark-lint-file-extension": "^1.0.0", - "remark-lint-final-definition": "^1.0.0", - "remark-lint-hard-break-spaces": "^1.0.0", - "remark-lint-heading-increment": "^1.0.0", - "remark-lint-heading-style": "^1.0.0", - "remark-lint-link-title-style": "^1.0.0", - "remark-lint-list-item-content-indent": "^1.0.0", - "remark-lint-list-item-indent": "^1.0.0", - "remark-lint-list-item-spacing": "^1.0.0", - "remark-lint-maximum-heading-length": "^1.0.0", - "remark-lint-maximum-line-length": "^1.0.0", - "remark-lint-no-auto-link-without-protocol": "^1.0.0", - "remark-lint-no-blockquote-without-marker": "^2.0.0", - "remark-lint-no-consecutive-blank-lines": "^1.0.0", - "remark-lint-no-duplicate-headings": "^1.0.0", - "remark-lint-no-emphasis-as-heading": "^1.0.0", - "remark-lint-no-file-name-articles": "^1.0.0", - "remark-lint-no-file-name-consecutive-dashes": "^1.0.0", - "remark-lint-no-file-name-irregular-characters": "^1.0.0", - "remark-lint-no-file-name-mixed-case": "^1.0.0", - "remark-lint-no-file-name-outer-dashes": "^1.0.0", - "remark-lint-no-heading-punctuation": "^1.0.0", - "remark-lint-no-inline-padding": "^1.0.0", - "remark-lint-no-literal-urls": "^1.0.0", - "remark-lint-no-multiple-toplevel-headings": "^1.0.0", - "remark-lint-no-shell-dollars": "^1.0.0", - "remark-lint-no-shortcut-reference-image": "^1.0.0", - "remark-lint-no-shortcut-reference-link": "^1.0.0", - "remark-lint-no-table-indentation": "^1.0.0", - "remark-lint-ordered-list-marker-style": "^1.0.0", - "remark-lint-ordered-list-marker-value": "^1.0.0", - "remark-lint-rule-style": "^1.0.0", - "remark-lint-strong-marker": "^1.0.0", - "remark-lint-table-cell-padding": "^1.0.0", - "remark-lint-table-pipe-alignment": "^1.0.0", - "remark-lint-table-pipes": "^1.0.0", - "remark-lint-unordered-list-marker-style": "^1.0.0" - } - }, - "remark-retext": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/remark-retext/-/remark-retext-3.1.2.tgz", - "integrity": "sha512-+48KzJdSXvsPupY5pj5AY7oBUSiDOqFPZBKebX5WemrMyIG+RImIt9hgeqelluVDd1kooHen33K/aybTPyoI9g==", - "requires": { - "mdast-util-to-nlcst": "^3.2.0" - } - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "replace-ext": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", - "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=" - }, - "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - }, - "resumer": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", - "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", - "dev": true, - "requires": { - "through": "~2.3.4" - } - }, - "retext": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/retext/-/retext-6.0.1.tgz", - "integrity": "sha512-+AdE0+PxijN3jswdMlg0xJHb3cBKCeNJ+a+k+leB6mE6q7X2wSG3IPkCFiaghrsV5vL0a2h2XmTazsqyIRAFTw==", - "requires": { - "retext-latin": "^2.0.0", - "retext-stringify": "^2.0.0", - "unified": "^7.0.0" - } - }, - "retext-english": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/retext-english/-/retext-english-3.0.2.tgz", - "integrity": "sha512-iWffdWUvJngqaRlE570SaYRgQbn4/QVBfGa/XseEBuBazymnyW24o37oLPY0vm+PJdLmDghnjZX0UbkZSZF0Cg==", - "requires": { - "parse-english": "^4.0.0", - "unherit": "^1.0.4" - } - }, - "retext-latin": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-2.0.2.tgz", - "integrity": "sha512-7eIuQ23AepCmIbWPoJY/1YBPKYkfR81Pcr0daU6GWWenxF/UM6WUvKGHLtko4g9wrrQiu8XyDSfQ9jAV6rbKyg==", - "requires": { - "parse-latin": "^4.0.0", - "unherit": "^1.0.4" - } - }, - "retext-spell": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/retext-spell/-/retext-spell-2.4.0.tgz", - "integrity": "sha512-k3YHCcHUGESEi6AckQBi8ID3ySsYE8DKRMlnnWhGFiJnHfWKwk+jCLMsxwgRygC0qI91WpYwaeO9wP9kKBECAw==", - "requires": { - "lodash.includes": "^4.2.0", - "nlcst-is-literal": "^1.0.0", - "nlcst-to-string": "^2.0.0", - "nspell": "^2.0.0", - "quotation": "^1.1.0", - "unist-util-visit": "^1.0.0" - } - }, - "retext-stringify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-2.0.2.tgz", - "integrity": "sha512-SphWgEipyuEVXRsKqxhUN6+h7H6GNFFjPDxNJs4ZX7HEhizmaXUdHSSuOyRjbY764SH2mMVf+kj8NNpMksfgUA==", - "requires": { - "nlcst-to-string": "^2.0.0" - } - }, - "sinon": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.2.2.tgz", - "integrity": "sha512-WLagdMHiEsrRmee3jr6IIDntOF4kbI6N2pfbi8wkv50qaUQcBglkzkjtoOEbeJ2vf1EsrHhLI+5Ny8//WHdMoA==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.2.0", - "@sinonjs/formatio": "^3.1.0", - "@sinonjs/samsam": "^3.0.2", - "diff": "^3.5.0", - "lolex": "^3.0.0", - "nise": "^1.4.7", - "supports-color": "^5.5.0" - } - }, - "sliced": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", - "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" - }, - "state-toggle": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.1.tgz", - "integrity": "sha512-Qe8QntFrrpWTnHwvwj2FZTgv+PKIsp0B9VxLzLLbSpPXWOgRgc5LVj/aTiSfK1RqIeF9jeC1UeOH8Q8y60A7og==" - }, - "string.prototype.trim": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", - "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", - "dev": true, - "requires": { - "define-properties": "^1.1.2", - "es-abstract": "^1.5.0", - "function-bind": "^1.0.2" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - }, - "tape": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.2.tgz", - "integrity": "sha512-lPXKRKILZ1kZaUy5ynWKs8ATGSUO7HAFHCFnBam6FaGSqPdOwMWbxXHq4EXFLE8WRTleo/YOMXkaUTRmTB1Fiw==", - "dev": true, - "requires": { - "deep-equal": "~1.0.1", - "defined": "~1.0.0", - "for-each": "~0.3.3", - "function-bind": "~1.1.1", - "glob": "~7.1.2", - "has": "~1.0.3", - "inherits": "~2.0.3", - "minimist": "~1.2.0", - "object-inspect": "~1.6.0", - "resolve": "~1.7.1", - "resumer": "~0.0.0", - "string.prototype.trim": "~1.1.2", - "through": "~2.3.8" - } - }, - "text-encoding": { - "version": "0.6.4", - "resolved": "https://registry.npmjs.org/text-encoding/-/text-encoding-0.6.4.tgz", - "integrity": "sha1-45mpgiV6J22uQou5KEXLcb3CbRk=", - "dev": true - }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "trim": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", - "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" - }, - "trim-trailing-lines": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.1.tgz", - "integrity": "sha512-bWLv9BbWbbd7mlqqs2oQYnLD/U/ZqeJeJwbO0FG2zA1aTq+HTvxfHNKFa/HGCVyJpDiioUYaBhfiT6rgk+l4mg==" - }, - "trough": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/trough/-/trough-1.0.3.tgz", - "integrity": "sha512-fwkLWH+DimvA4YCy+/nvJd61nWQQ2liO/nF/RjkTpiOGi+zxZzVkhb1mvbHIIW4b/8nDsYI8uTmAlc0nNkRMOw==" - }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true - }, - "unherit": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unherit/-/unherit-1.1.1.tgz", - "integrity": "sha512-+XZuV691Cn4zHsK0vkKYwBEwB74T3IZIcxrgn2E4rKwTfFyI1zCh7X7grwh9Re08fdPlarIdyWgI8aVB3F5A5g==", - "requires": { - "inherits": "^2.0.1", - "xtend": "^4.0.1" - } - }, - "unified": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/unified/-/unified-7.1.0.tgz", - "integrity": "sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw==", - "requires": { - "@types/unist": "^2.0.0", - "@types/vfile": "^3.0.0", - "bail": "^1.0.0", - "extend": "^3.0.0", - "is-plain-obj": "^1.1.0", - "trough": "^1.0.0", - "vfile": "^3.0.0", - "x-is-string": "^0.1.0" - } - }, - "unified-lint-rule": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/unified-lint-rule/-/unified-lint-rule-1.0.3.tgz", - "integrity": "sha512-6z+HH3mtlFdj/w3MaQpObrZAd9KRiro370GxBFh13qkV8LYR21lLozA4iQiZPhe7KuX/lHewoGOEgQ4AWrAR3Q==", - "requires": { - "wrapped": "^1.0.1" - } - }, - "unified-message-control": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unified-message-control/-/unified-message-control-1.0.4.tgz", - "integrity": "sha512-e1dEtN4Z/TvLn/qHm+xeZpzqhJTtfZusFErk336kkZVpqrJYiV9ptxq+SbRPFMlN0OkjDYHmVJ929KYjsMTo3g==", - "requires": { - "trim": "0.0.1", - "unist-util-visit": "^1.0.0", - "vfile-location": "^2.0.0" - } - }, - "unist-util-generated": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.3.tgz", - "integrity": "sha512-qlPeDqnQnd84KIqwphzOR+l02cxjDzvEYEBl84EjmKRrX4eUmjyAo8xJv1SCDhJqNjyHRnBMZWNKAiBtXE6hBg==" - }, - "unist-util-is": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-2.1.2.tgz", - "integrity": "sha512-YkXBK/H9raAmG7KXck+UUpnKiNmUdB+aBGrknfQ4EreE1banuzrKABx3jP6Z5Z3fMSPMQQmeXBlKpCbMwBkxVw==" - }, - "unist-util-modify-children": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-1.1.3.tgz", - "integrity": "sha512-Aw3Us+NPrJGYWyLhcaqYzgxd/pryIanDNHVVvwdtTEEQ3Yfa/+sjnT2EeAAHbtTMAaYEdPW3XN6jxbzVWAo/BQ==", - "requires": { - "array-iterate": "^1.0.0" - } - }, - "unist-util-position": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.0.2.tgz", - "integrity": "sha512-npmFu92l/+b1Ao6uGP4I1WFz9hsKv7qleZ4aliw6x0RVu6A9A3tAf57NMpFfzQ02jxRtJZuRn+C8xWT7GWnH0g==" - }, - "unist-util-remove-position": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-1.1.2.tgz", - "integrity": "sha512-XxoNOBvq1WXRKXxgnSYbtCF76TJrRoe5++pD4cCBsssSiWSnPEktyFrFLE8LTk3JW5mt9hB0Sk5zn4x/JeWY7Q==", - "requires": { - "unist-util-visit": "^1.1.0" - } - }, - "unist-util-stringify-position": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-1.1.2.tgz", - "integrity": "sha512-pNCVrk64LZv1kElr0N1wPiHEUoXNVFERp+mlTg/s9R5Lwg87f9bM/3sQB99w+N9D/qnM9ar3+AKDBwo/gm/iQQ==" - }, - "unist-util-visit": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-1.4.0.tgz", - "integrity": "sha512-FiGu34ziNsZA3ZUteZxSFaczIjGmksfSgdKqBfOejrrfzyUy5b7YrlzT1Bcvi+djkYDituJDy2XB7tGTeBieKw==", - "requires": { - "unist-util-visit-parents": "^2.0.0" - } - }, - "unist-util-visit-children": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-1.1.2.tgz", - "integrity": "sha512-q4t6aprUcSQ2/+xlswuh2wUKwUUuMmDjSkfwkMjeVwCXc8NqX8g0FSmNf68CznCmbkrsOPDUR0wj14bCFXXqbA==" - }, - "unist-util-visit-parents": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-2.0.1.tgz", - "integrity": "sha512-6B0UTiMfdWql4cQ03gDTCSns+64Zkfo2OCbK31Ov0uMizEz+CJeAp0cgZVb5Fhmcd7Bct2iRNywejT0orpbqUA==", - "requires": { - "unist-util-is": "^2.1.2" - } - }, - "vfile": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.1.tgz", - "integrity": "sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ==", - "requires": { - "is-buffer": "^2.0.0", - "replace-ext": "1.0.0", - "unist-util-stringify-position": "^1.0.0", - "vfile-message": "^1.0.0" - } - }, - "vfile-location": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-2.0.4.tgz", - "integrity": "sha512-KRL5uXQPoUKu+NGvQVL4XLORw45W62v4U4gxJ3vRlDfI9QsT4ZN1PNXn/zQpKUulqGDpYuT0XDfp5q9O87/y/w==" - }, - "vfile-message": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-1.1.1.tgz", - "integrity": "sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA==", - "requires": { - "unist-util-stringify-position": "^1.1.1" - } - }, - "vscode-jsonrpc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz", - "integrity": "sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==" - }, - "vscode-languageserver": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-5.2.1.tgz", - "integrity": "sha512-GuayqdKZqAwwaCUjDvMTAVRPJOp/SLON3mJ07eGsx/Iq9HjRymhKWztX41rISqDKhHVVyFM+IywICyZDla6U3A==", - "requires": { - "vscode-languageserver-protocol": "3.14.1", - "vscode-uri": "^1.0.6" - } - }, - "vscode-languageserver-protocol": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz", - "integrity": "sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==", - "requires": { - "vscode-jsonrpc": "^4.0.0", - "vscode-languageserver-types": "3.14.0" - } - }, - "vscode-languageserver-types": { - "version": "3.14.0", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz", - "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==" - }, - "vscode-uri": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.6.tgz", - "integrity": "sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==" - }, - "wrapped": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrapped/-/wrapped-1.0.1.tgz", - "integrity": "sha1-x4PZ2Aeyc+mwHoUWgKk4yHyQckI=", - "requires": { - "co": "3.1.0", - "sliced": "^1.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "x-is-string": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz", - "integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI=" - }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" - } - } -} diff --git a/package.json b/package.json index e713174..cb84b0d 100644 --- a/package.json +++ b/package.json @@ -2,27 +2,51 @@ "name": "unified-language-server", "version": "0.3.0", "description": "A language server for spoken languages using retext", - "homepage": "https://github.com/aecepoglu/retext-language-server", + "homepage": "https://github.com/unifiedjs/unified-language-server", + "repository": "unifiedjs/unified-language-server", + "bugs": "https://github.com/unifiedjs/unified-language-serve/issues", "main": "src/index.js", "author": "aecepoglu", "license": "MIT", - "bin": { - "unified-language-server": "./src/server.js" - }, + "sideEffects": false, + "bin": "unified-language-server", "scripts": { - "test": "tape src/**/*.spec.js" + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-coverage": "tape src/**/*.spec.js", + "test": "npm run format && npm run test-coverage" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "rules": { + "no-new": "off", + "no-warning-comments": "off", + "unicorn/prefer-module": "off" + } + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] }, "dependencies": { "dictionary-en-gb": "^2.0.0", - "parse-latin": "^4.1.1", - "remark-parse": "^6.0.3", - "remark-preset-lint-markdown-style-guide": "^2.1.2", - "remark-retext": "^3.1.2", - "retext": "^6.0.1", - "retext-english": "^3.0.2", - "retext-spell": "^2.4.0", - "unified": "^7.1.0", - "vscode-languageserver": "^5.2.1" + "parse-latin": "^4.0.0", + "remark-parse": "^6.0.0", + "remark-preset-lint-markdown-style-guide": "^2.0.0", + "remark-retext": "^3.0.0", + "retext": "^6.0.0", + "retext-english": "^3.0.0", + "retext-spell": "^2.0.0", + "unified": "^7.0.0", + "vscode-languageserver": "^5.0.0" }, "keywords": [ "LSP", @@ -37,7 +61,12 @@ "unified" ], "devDependencies": { - "sinon": "^7.2.2", - "tape": "^4.9.2" + "prettier": "^2.0.0", + "remark-cli": "^10.0.1", + "remark-preset-wooorm": "^9.0.0", + "sinon": "^7.0.0", + "tape": "^4.0.0", + "vfile-message": "^1.0.0", + "xo": "^0.47.0" } } diff --git a/src/index.js b/src/index.js index a5a5a27..f3d042f 100644 --- a/src/index.js +++ b/src/index.js @@ -1,119 +1,122 @@ -const {readFileSync} = require("fs"); -const LangServer = require("vscode-languageserver"); +const {readFileSync} = require('fs') +const LangServer = require('vscode-languageserver') const { - Diagnostic, - Position, - //TextDocument, - TextDocumentSyncKind, -} = require("vscode-languageserver-protocol"); - -// convertPosition :: VFilePosition -> Position -const convertPosition = ({line, column}) => Position.create(line - 1, column - 1); - -const parsePlugins = obj => - typeof(obj) !== "undefined" - ? JSON.parse(JSON.stringify(obj), (k, v) => { - if (typeof(v) == "string") { - if (v.startsWith("#")) { - return require(v.slice("#".length)); - } else if (v.startsWith("//")) { - return readFileSync(v.slice("//".length), "utf8"); - } else { - return v.trim(); - } - } - - return v; - }) - : obj; + Diagnostic, + Position, + TextDocumentSyncKind +} = require('vscode-languageserver') + +// ConvertPosition :: VFilePosition -> Position +const convertPosition = ({line, column}) => + Position.create(line - 1, column - 1) + +const parsePlugins = (object) => + typeof object === 'undefined' + ? object + : JSON.parse(JSON.stringify(object), (k, v) => { + if (typeof v !== 'string') { + return v + } + + if (v.startsWith('#')) { + return require(v.slice('#'.length)) + } + + if (v.startsWith('//')) { + return readFileSync(v.slice('//'.length), 'utf8') + } + + return v.trim() + }) class UnifiedLangServerBase { - constructor(connection, documents, processor0) { - this._connection = connection; - this._documents = documents; - this._processor0 = processor0; - this._processor = processor0; - - connection.onInitialize(_capabilities => ({ - capabilities: { - textDocumentSync: TextDocumentSyncKind.Full, - } - })); - - documents.onDidChangeContent(_ => this.validate(_)); - } - - setProcessor(x) { - this._processor = x; - - return this; - } - - configureWith(f) { - //TODO check if client supports configuration? - this._connection.onDidChangeConfiguration(change => { - try { - this.setProcessor(this.createProcessor(f(change))); - - this._documents.all().forEach(d => this.validate({document: d})) - } catch(err) { - this.log(err); - } - }); - - return this; - } - - // sets some callbacks and listening to the connection - start() { - this._documents.listen(this._connection); - this._connection.listen(); - } - - createProcessor(settings) { - return parsePlugins(settings.plugins).reduce( - (it, [plugin, options]) => it.use(plugin, options), - this._processor0() - ); - } - - // {document: TextDocument} - validate({document}) { - return this._processor.process( - document.getText() - ) - .then(vfile => - vfile.messages - .map(msg => Diagnostic.create( - /*range*/ { - start: convertPosition(msg.location.start), - end: convertPosition(msg.location.end), - }, - /* message */ msg.reason, - /* severity */ LangServer.DiagnosticSeverity.Hint, - /* code */ msg.actual, - /* source */ msg.source - )) - .sort(_ => _.range.start.line) - ) - .then(diagnostics => { - this._connection.sendDiagnostics({ - uri: document.uri, - diagnostics, - }); - - return diagnostics; - }) - .catch(this.log); - } - - log(x) { - this._connection.console.log( - x.toString - ? x.toString() - : JSON.stringify(x) - ); - } + constructor(connection, documents, processor0) { + this._connection = connection + this._documents = documents + this._processor0 = processor0 + this._processor = processor0 + + connection.onInitialize((_capabilities) => ({ + capabilities: { + textDocumentSync: TextDocumentSyncKind.Full + } + })) + + documents.onDidChangeContent((_) => this.validate(_)) + } + + setProcessor(x) { + this._processor = x + + return this + } + + configureWith(f) { + // TODO check if client supports configuration? + this._connection.onDidChangeConfiguration((change) => { + try { + this.setProcessor(this.createProcessor(f(change))) + + for (const document of this._documents.all()) { + this.validate({document}) + } + } catch (error) { + this.log(error) + } + }) + + return this + } + + // Sets some callbacks and listening to the connection + start() { + this._documents.listen(this._connection) + this._connection.listen() + } + + createProcessor(settings) { + const processor = this._processor0() + for (const [plugin, options] of parsePlugins(settings.plugins)) { + processor.use(plugin, options) + } + + return processor + } + + // {document: TextDocument} + validate({document}) { + return this._processor + .process(document.getText()) + .then((vfile) => + vfile.messages + .map((message) => + Diagnostic.create( + { + start: convertPosition(message.location.start), + end: convertPosition(message.location.end) + }, + message.reason, + LangServer.DiagnosticSeverity.Hint, + message.actual, + message.source + ) + ) + .sort((_) => _.range.start.line) + ) + .then((diagnostics) => { + this._connection.sendDiagnostics({ + uri: document.uri, + diagnostics + }) + + return diagnostics + }) + .catch(this.log) + } + + log(x) { + this._connection.console.log(x.toString ? x.toString() : JSON.stringify(x)) + } } -module.exports = UnifiedLangServerBase; +module.exports = UnifiedLangServerBase diff --git a/src/index.spec.js b/src/index.spec.js index 4f7c6b3..2196ea7 100644 --- a/src/index.spec.js +++ b/src/index.spec.js @@ -1,302 +1,309 @@ -const Base = require("./index"); -const Test = require("tape"); //TODO try 'ava' instead -const unified = require("unified"); +const test = require('tape') // TODO try 'ava' instead +const unified = require('unified') const { - TextDocumentSyncKind, - DiagnosticSeverity, -} = require("vscode-languageserver-protocol"); -const {spy} = require("sinon"); -const VMessage = require("vfile-message"); + TextDocumentSyncKind, + DiagnosticSeverity +} = require('vscode-languageserver-protocol') +const {spy} = require('sinon') +const VMessage = require('vfile-message') + +const parser = require('retext-english') +const Base = require('./index.js') -const parser = require("retext-english"); function compiler() { - this.Compiler = () => "compiler's output"; + this.Compiler = () => "compiler's output" +} + +const messagePushingAttacher = (vMessage) => () => (tree, file) => { + file.messages.push(vMessage) } -const msgPushingAttacher = vMsg => options => (tree, file) => { - file.messages.push(vMsg); -}; -const textProcessor = unified() - .use(parser) - .use(compiler) - .freeze(); +const textProcessor = unified().use(parser).use(compiler).freeze() const createMockConnection = () => ({ - console: { - log: spy() - }, - listen: spy(), - onInitialize: spy(), - onDidChangeConfiguration: spy(), - sendDiagnostics: spy(), -}); + console: { + log: spy() + }, + listen: spy(), + onInitialize: spy(), + onDidChangeConfiguration: spy(), + sendDiagnostics: spy() +}) const createMockDocuments = (docs) => ({ - all: () => docs || [], - listen: spy(), - onDidChangeContent: spy(), -}); + all: () => docs || [], + listen: spy(), + onDidChangeContent: spy() +}) const createMockDocument = (txt, props) => - Object.assign( - props || {}, - { - getText: () => txt, - } - ); - -const waitUntilCalled = (spy, timeout) => new Promise((resolve, reject) => { - timeout = timeout || 1000; - let timePassed = 0; - - let timer = setInterval(() => { - timePassed += 200; - if (timePassed > timeout) { - clearInterval(timer); - reject("waited for the spy to be called but it wasn't"); - } else if (spy.called) { - clearInterval(timer); - resolve(); - } - }, 200); -}); - -Test("the constructor", t => { - t.plan(3); - - let connection = createMockConnection(); - let documents = createMockDocuments(); - - let base = new Base(connection, documents, textProcessor); - - t.ok(connection.listen.notCalled, "listen() shouldn't be done implicitly"); - t.ok(documents.listen.notCalled, "listen() shouldn't be done implicitly"); - - t.deepEqual( - connection.onInitialize.firstCall.args[0] (/*client capabilities*/), - { - capabilities: { - textDocumentSync: TextDocumentSyncKind.Full, - }, - }, - "server must report correct capabilities" - ); -}); - -Test("setProcessor()", async t => { - t.plan(2); - - const plugin1 = msgPushingAttacher(new VMessage( - "msg one", - { - start: {line: 1, column: 5}, - end: {line: 2, column: 10}, - }, - "attacher1:rule1" - )); - const plugin2 = msgPushingAttacher(new VMessage( - "msg two", - { - start: {line: 3, column: 6}, - end: {line: 4, column: 8}, - }, - "attacher2:rule1" - )); - - const processor1 = textProcessor().use(plugin1); - const processor2 = textProcessor().use(plugin2); - - let base = new Base( - createMockConnection(), - createMockDocuments(), - processor1 - ); - - let doc = { - document: createMockDocument("", {uri: "uri-01"}) - }; - - t.deepEqual( - await(base.validate(doc)), - [{ - range: { - start: { line: 0, character: 4 }, - end: { line: 1, character: 9 }, - }, - message: "msg one", - severity: DiagnosticSeverity.Hint, - source: "attacher1", - }], - ); - - base.setProcessor(processor2); - - t.deepEqual( - await(base.validate(doc)), - [{ - range: { - start: { line: 2, character: 5 }, - end: { line: 3, character: 7 }, - }, - message: "msg two", - severity: DiagnosticSeverity.Hint, - source: "attacher2", - }], - ); -}); - -Test("createProcessor()", t => { - let connection = createMockConnection(); - let documents = createMockDocuments(); - let TEXT = [ - "spellinggg misstakes alll overr", - "and carrot is spelled correctly but my personal dictionary dislikes it", - ].join("\n"); - - let base = new Base(connection, documents, textProcessor); - - [ - ["empty settings", {}], - ["nonexistent modules", { - plugins: [ - ["#some-unknown-module-by-aecepoglu"] - ] - }], - ["nonexistent file", { - plugins: [ - ["//i-bet-this-file-doesnt-exist.txt"] - ] - }] - ].forEach(([description, settings]) => { - t.test(description, st => { - st.plan(1); - st.throws(() => { - base.createProcessor({}); - }, `error thrown for ${description}`); - }); - }); - - t.test("defining modules with '#'", async st => { - st.plan(1); - - let myProcessor = base.createProcessor({ - plugins: [ - ["#retext-spell", "#dictionary-en-gb"] - ] - }); - - let abc = await(myProcessor.process(TEXT)) - st.deepEqual( - abc - .messages - .map(_ => _.actual), - ["spellinggg", "misstakes", "alll", "overr"] - ); - }); - - t.test("defining files with '//'", async st => { - st.plan(1); - - let myProcessor = base.createProcessor({ - plugins: [ - ["#retext-spell", { - dictionary: "#dictionary-en-gb", - personal: "//./sample-dict.txt", - }] - ] - }); - - let abc = await(myProcessor.process(TEXT)) - st.deepEqual( - abc - .messages - .map(_ => _.actual), - ["spellinggg", "misstakes", "alll", "overr", "carrot"] - ); - }); -}); - -Test("start() listens to connections", t => { - t.plan(2); - - let connection = createMockConnection(); - let documents = createMockDocuments(); - - let base = new Base(connection, documents, textProcessor); - - base.start(); - - t.ok(connection.listen.called); - t.ok(documents.listen.calledWith(connection)); -}); - -Test("configureWith() is used to listen to changes in settings and updating the processor with them", async t => { - t.plan(1); - - let connection = createMockConnection(); - let documents = createMockDocuments([ - createMockDocument("text with a spellingg mistake", {uri: "uri-01"}), - createMockDocument("proper text.", {uri: "uri-02"}), - ]); - - let base = new Base(connection, documents, textProcessor) - .configureWith(settings => settings.some.obscure.path); - - connection.onDidChangeConfiguration.args[0][0] ({some: {obscure: {path: - { - plugins: [ - ["#retext-spell", "#dictionary-en-gb"], - ] - } - }}}); - - await(waitUntilCalled(connection.sendDiagnostics)); - - t.deepEqual( - connection.sendDiagnostics.args.sort(_ => _.uri), - [ - [{ - uri: "uri-01", - diagnostics: [{ - range: { - start: { line: 0, character: 12, }, - end: { line: 0, character: 12 + "spellingg".length, }, - }, - message: "`spellingg` is misspelt; did you mean `spelling`, `spellings`?", - severity: DiagnosticSeverity.Hint, - code: "spellingg", - source: "retext-spell", - }] - }], - [{ - uri: "uri-02", - diagnostics: [] - }] - ], - "diagnostics must be sent for all documents" - ); -}); - -Test("the cb given to configureWith() throws an error", t => { - t.plan(2); - - let connection = createMockConnection(); - let documents = createMockDocuments([ - createMockDocument("text with a spellingg mistake", {uri: "uri-01"}), - createMockDocument("proper text.", {uri: "uri-02"}), - ]); - - let base = new Base(connection, documents, textProcessor) - .configureWith(() => { - throw new Error("the error thrown by the configuration filter function"); - }); - - t.doesNotThrow(() => { - connection.onDidChangeConfiguration.args[0][0] ("settings from the client"); - }); - - t.ok( - connection.console.log.calledWith( - "Error: the error thrown by the configuration filter function" - ), - "error must be logged" - ); -}); + Object.assign(props || {}, { + getText: () => txt + }) + +const waitUntilCalled = (spy, timeout) => + new Promise((resolve, reject) => { + timeout = timeout || 1000 + let timePassed = 0 + + const timer = setInterval(() => { + timePassed += 200 + if (timePassed > timeout) { + clearInterval(timer) + reject(new Error("waited for the spy to be called but it wasn't")) + } else if (spy.called) { + clearInterval(timer) + resolve() + } + }, 200) + }) + +test('the constructor', (t) => { + t.plan(3) + + const connection = createMockConnection() + const documents = createMockDocuments() + + new Base(connection, documents, textProcessor) + + t.ok(connection.listen.notCalled, "listen() shouldn't be done implicitly") + t.ok(documents.listen.notCalled, "listen() shouldn't be done implicitly") + + t.deepEqual( + connection.onInitialize.firstCall.args[0](/* client capabilities */), + { + capabilities: { + textDocumentSync: TextDocumentSyncKind.Full + } + }, + 'server must report correct capabilities' + ) +}) + +test('setProcessor()', async (t) => { + t.plan(2) + + const plugin1 = messagePushingAttacher( + new VMessage( + 'msg one', + { + start: {line: 1, column: 5}, + end: {line: 2, column: 10} + }, + 'attacher1:rule1' + ) + ) + const plugin2 = messagePushingAttacher( + new VMessage( + 'msg two', + { + start: {line: 3, column: 6}, + end: {line: 4, column: 8} + }, + 'attacher2:rule1' + ) + ) + + const processor1 = textProcessor().use(plugin1) + const processor2 = textProcessor().use(plugin2) + + const base = new Base( + createMockConnection(), + createMockDocuments(), + processor1 + ) + + const doc = { + document: createMockDocument('', {uri: 'uri-01'}) + } + + t.deepEqual(await base.validate(doc), [ + { + range: { + start: {line: 0, character: 4}, + end: {line: 1, character: 9} + }, + message: 'msg one', + severity: DiagnosticSeverity.Hint, + source: 'attacher1' + } + ]) + + base.setProcessor(processor2) + + t.deepEqual(await base.validate(doc), [ + { + range: { + start: {line: 2, character: 5}, + end: {line: 3, character: 7} + }, + message: 'msg two', + severity: DiagnosticSeverity.Hint, + source: 'attacher2' + } + ]) +}) + +test('createProcessor()', (t) => { + const connection = createMockConnection() + const documents = createMockDocuments() + const TEXT = [ + 'spellinggg misstakes alll overr', + 'and carrot is spelled correctly but my personal dictionary dislikes it' + ].join('\n') + + const base = new Base(connection, documents, textProcessor) + + for (const [description] of [ + ['empty settings', {}], + [ + 'nonexistent modules', + { + plugins: [['#some-unknown-module-by-aecepoglu']] + } + ], + [ + 'nonexistent file', + { + plugins: [['//i-bet-this-file-doesnt-exist.txt']] + } + ] + ]) { + t.test(description, (st) => { + st.plan(1) + st.throws(() => { + base.createProcessor({}) + }, `error thrown for ${description}`) + }) + } + + t.test("defining modules with '#'", async (st) => { + st.plan(1) + + const myProcessor = base.createProcessor({ + plugins: [['#retext-spell', '#dictionary-en-gb']] + }) + + const abc = await myProcessor.process(TEXT) + st.deepEqual( + abc.messages.map((_) => _.actual), + ['spellinggg', 'misstakes', 'alll', 'overr'] + ) + }) + + t.skip("defining files with '//'", async (st) => { + st.plan(1) + + const myProcessor = base.createProcessor({ + plugins: [ + [ + '#retext-spell', + { + dictionary: '#dictionary-en-gb', + personal: '//./sample-dict.txt' + } + ] + ] + }) + + const abc = await myProcessor.process(TEXT) + st.deepEqual( + abc.messages.map((_) => _.actual), + ['spellinggg', 'misstakes', 'alll', 'overr', 'carrot'] + ) + }) +}) + +test('start() listens to connections', (t) => { + t.plan(2) + + const connection = createMockConnection() + const documents = createMockDocuments() + + const base = new Base(connection, documents, textProcessor) + + base.start() + + t.ok(connection.listen.called) + t.ok(documents.listen.calledWith(connection)) +}) + +test('configureWith() is used to listen to changes in settings and updating the processor with them', async (t) => { + t.plan(1) + + const connection = createMockConnection() + const documents = createMockDocuments([ + createMockDocument('text with a spellingg mistake', {uri: 'uri-01'}), + createMockDocument('proper text.', {uri: 'uri-02'}) + ]) + + new Base(connection, documents, textProcessor).configureWith( + (settings) => settings.some.obscure.path + ) + + connection.onDidChangeConfiguration.args[0][0]({ + some: { + obscure: { + path: { + plugins: [['#retext-spell', '#dictionary-en-gb']] + } + } + } + }) + + await waitUntilCalled(connection.sendDiagnostics) + + t.deepEqual( + connection.sendDiagnostics.args.sort((_) => _.uri), + [ + [ + { + uri: 'uri-01', + diagnostics: [ + { + range: { + start: {line: 0, character: 12}, + end: {line: 0, character: 12 + 'spellingg'.length} + }, + message: + '`spellingg` is misspelt; did you mean `spelling`, `spellings`?', + severity: DiagnosticSeverity.Hint, + code: 'spellingg', + source: 'retext-spell' + } + ] + } + ], + [ + { + uri: 'uri-02', + diagnostics: [] + } + ] + ], + 'diagnostics must be sent for all documents' + ) +}) + +test('the cb given to configureWith() throws an error', (t) => { + t.plan(2) + + const connection = createMockConnection() + const documents = createMockDocuments([ + createMockDocument('text with a spellingg mistake', {uri: 'uri-01'}), + createMockDocument('proper text.', {uri: 'uri-02'}) + ]) + + new Base(connection, documents, textProcessor).configureWith(() => { + throw new Error('the error thrown by the configuration filter function') + }) + + t.doesNotThrow(() => { + connection.onDidChangeConfiguration.args[0][0]('settings from the client') + }) + + t.ok( + connection.console.log.calledWith( + 'Error: the error thrown by the configuration filter function' + ), + 'error must be logged' + ) +}) diff --git a/src/sample-servers/retext.js b/src/sample-servers/retext.js index a88dbde..fbeb4a2 100644 --- a/src/sample-servers/retext.js +++ b/src/sample-servers/retext.js @@ -1,23 +1,20 @@ #!/usr/bin/node -const LangServer = require("vscode-languageserver"); -const retext = require("retext"); +const LangServer = require('vscode-languageserver') +const retext = require('retext') -const Base = require("./unified-language-server"); +const Base = require('../unified-language-server/index.js') const DEFAULT_SETTINGS = { - plugins: [ - ["#retext-profanities"], - ["#retext-spell", "#dictionary-en-gb"], - ], -}; + plugins: [['#retext-profanities'], ['#retext-spell', '#dictionary-en-gb']] +} -const connection = LangServer.createConnection(LangServer.ProposedFeatures.all); -const documents = new LangServer.TextDocuments(); +const connection = LangServer.createConnection(LangServer.ProposedFeatures.all) +const documents = new LangServer.TextDocuments() -let server = new Base(connection, documents, retext); -server.setProcessor(server.createProcessor(DEFAULT_SETTINGS)); -server.configureWith(change => - change.settings["retext-language-server"] || DEFAULT_SETTINGS -); -server.start(); +const server = new Base(connection, documents, retext) +server.setProcessor(server.createProcessor(DEFAULT_SETTINGS)) +server.configureWith( + (change) => change.settings['retext-language-server'] || DEFAULT_SETTINGS +) +server.start() diff --git a/src/server.js b/src/server.js index 2abe224..66b6696 100755 --- a/src/server.js +++ b/src/server.js @@ -1,158 +1,142 @@ #!/usr/bin/env node -const Base = require("./index"); -const LangServer = require("vscode-languageserver"); -const unified = require("unified"); +const process = require('process') +const LangServer = require('vscode-languageserver') +const unified = require('unified') + +const Base = require('./index.js') const ALL_SETTINGS = { - "retext-english": { - plugins: [ - ["#retext-spell", "#dictionary-en-gb"] - ], - }, - "remark-parse": { - plugins: [ - ["#remark-preset-lint-markdown-style-guide"] - ], - checkTextWith: { - setting: "retext-english", - mutator: ["#remark-retext", "#parse-latin"], - } - }, -}; + 'retext-english': { + plugins: [['#retext-spell', '#dictionary-en-gb']] + }, + 'remark-parse': { + plugins: [['#remark-preset-lint-markdown-style-guide']], + checkTextWith: { + setting: 'retext-english', + mutator: ['#remark-retext', '#parse-latin'] + } + } +} function stringify() { - this.Compiler = () => ""; + this.Compiler = () => '' } -const withCommas = list => list.map(x => `"${x}"`).join(", "); +const withCommas = (list) => list.map((x) => `"${x}"`).join(', ') -const mapObj = (obj, f) => - Object.keys(obj).reduce( - (acc, k) => ({ - [k]: f(obj[k], k), - ...acc - }), - {} - ); +const mapObject = (object, f) => { + const result = {} + for (const [key, value] of Object.entries(object)) { + result[key] = f(value) + } + + return result +} const getArg = (prefix, isOptional) => { - let arg = process.argv.slice(2).find(_ => _.startsWith(prefix)); - - if (arg) { - return arg.slice(prefix.length); - } else if (isOptional) { - return undefined; - } else { - throw new Error( - `Command line argument "${prefix}..." couldn't be found` - ); - } -}; - -const populateTextPlugins = settings => - mapObj(settings, ({ checkTextWith, plugins, ...rest }) => ({ - plugins: [ - ...plugins, - ...(checkTextWith - ? [ - checkTextWith.mutator, - ...settings[checkTextWith.setting].plugins, - ] - : [] - ) - ], - ...rest, - })); - -const validateSettings = settings => - mapObj(settings, ({checkTextWith, plugins, ...rest}, name) => { - if (Object.keys(rest).length > 0) { - console.warn( - "The keys: " - + withCommas(Object.keys(rest)) - + " are not supported" - ); - } - - if (!Array.isArray(plugins)) { - throw new Error(`${name}.plugins should be a list`); - } - if (!plugins.every(Array.isArray)) { - throw new Error(`every item in ${name}.plugins should be a list.`); - } - - if (checkTextWith !== undefined) { - if (typeof(checkTextWith) != "object") { - //TODO make error more verbose - throw new Error( - "checkTextWith must be undefined or an object with 2 fields:" - + "\"setting\" and \"mutator\"." - ); - } - if (settings[checkTextWith.setting] === undefined) { - throw new Error( - "checkTextWith.setting should be the name of an entry in your settings." - + " Candidates are: " - + withCommas(Object.keys(settings)) - ); - } - if (!Array.isArray(settings[checkTextWith.mutator]) !== true) { - throw new Error( - "checkTextWith.mutator should be a plugin definition" - + " (like those in \"plugins\")" - ); - } - } - - return {checkTextWith, plugins}; - }); - -const validateAndProcessSettings = s => { - let resp = ( - populateTextPlugins( - validateSettings( - Object.assign({}, ALL_SETTINGS, s) - ) - ) - )[parserName] - - if (resp) { - return resp; - } else { - throw new Error(`I don't know what the settings for ${parserName} is`); - } -}; - -const parserName = getArg("--parser=") -const processor0 = (function() { - let parser = require(parserName); - - if (parser.Parser === undefined) { - throw new Error( - `The parser you have supplied (${parserName}) is not a valid unifiedJS parser.\n` - + "The module needs to have a \"Parser\" method as described here: " - + "https://github.com/unifiedjs/unified#processorparser" - ); - } - - return unified() - .use(parser) - .use(stringify) - .freeze(); -})(); - -const connection = LangServer.createConnection(LangServer.ProposedFeatures.all); -const documents = new LangServer.TextDocuments(); - -let server = new Base(connection, documents, processor0()); + const arg = process.argv.slice(2).find((_) => _.startsWith(prefix)) + + if (arg) { + return arg.slice(prefix.length) + } + + if (isOptional) { + return + } + + throw new Error(`Command line argument "${prefix}..." couldn't be found`) +} + +const populateTextPlugins = (settings) => + mapObject(settings, ({checkTextWith, plugins, ...rest}) => ({ + plugins: [ + ...plugins, + ...(checkTextWith + ? [checkTextWith.mutator, ...settings[checkTextWith.setting].plugins] + : []) + ], + ...rest + })) + +const validateSettings = (settings) => + mapObject(settings, ({checkTextWith, plugins, ...rest}, name) => { + if (Object.keys(rest).length > 0) { + console.warn( + 'The keys: ' + withCommas(Object.keys(rest)) + ' are not supported' + ) + } + + if (!Array.isArray(plugins)) { + throw new TypeError(`${name}.plugins should be a list`) + } + + if (!plugins.every((plugin) => Array.isArray(plugin))) { + throw new Error(`every item in ${name}.plugins should be a list.`) + } + + if (checkTextWith !== undefined) { + if (typeof checkTextWith !== 'object') { + // TODO make error more verbose + throw new TypeError( + 'checkTextWith must be undefined or an object with 2 fields:' + + '"setting" and "mutator".' + ) + } + + if (settings[checkTextWith.setting] === undefined) { + throw new Error( + 'checkTextWith.setting should be the name of an entry in your settings.' + + ' Candidates are: ' + + withCommas(Object.keys(settings)) + ) + } + + if (!Array.isArray(settings[checkTextWith.mutator]) !== true) { + throw new TypeError( + 'checkTextWith.mutator should be a plugin definition' + + ' (like those in "plugins")' + ) + } + } + + return {checkTextWith, plugins} + }) + +const validateAndProcessSettings = (s) => { + const resp = populateTextPlugins( + validateSettings(Object.assign({}, ALL_SETTINGS, s)) + )[parserName] + + if (resp) { + return resp + } + + throw new Error(`I don't know what the settings for ${parserName} is`) +} + +const parserName = getArg('--parser=') +const processor0 = (function () { + const parser = require(parserName) + + if (parser.Parser === undefined) { + throw new Error( + `The parser you have supplied (${parserName}) is not a valid unifiedJS parser.\n` + + 'The module needs to have a "Parser" method as described here: ' + + 'https://github.com/unifiedjs/unified#processorparser' + ) + } + + return unified().use(parser).use(stringify).freeze() +})() + +const connection = LangServer.createConnection(LangServer.ProposedFeatures.all) +const documents = new LangServer.TextDocuments() + +const server = new Base(connection, documents, processor0()) server.setProcessor( - server.createProcessor( - validateAndProcessSettings(undefined) - ) -); -server.configureWith(change => - validateAndProcessSettings( - change.settings["unified-language-server"] - ) -); -server.start(); + server.createProcessor(validateAndProcessSettings(undefined)) +) +server.configureWith((change) => + validateAndProcessSettings(change.settings['unified-language-server']) +) +server.start() diff --git a/src/server.spec.js b/src/server.spec.js deleted file mode 100644 index e69de29..0000000