File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 153
153
"coc.nvim" : " ^0.0.80"
154
154
},
155
155
"devDependencies" : {
156
+ "@commitlint/cli" : " ^13.1.0" ,
157
+ "@commitlint/config-conventional" : " ^13.1.0" ,
156
158
"@luma-dev/eslint-config-base" : " ^0.5.0" ,
157
159
"@luma-dev/eslint-config-jest" : " ^0.2.3" ,
158
160
"@luma-dev/prettier-config" : " ^0.1.0" ,
167
169
"@types/jest" : " ^27.0.1" ,
168
170
"@types/node" : " 10.12.0" ,
169
171
"better-typescript-lib" : " ^1.1.0" ,
172
+ "commitlint" : " ^13.1.0" ,
170
173
"deep-equal" : " ^2.0.5" ,
171
174
"esbuild" : " ^0.12.28" ,
172
175
"esbuild-node-externals" : " ^1.3.0" ,
173
176
"eslint" : " ^7.32.0" ,
174
177
"husky" : " ^7.0.2" ,
175
178
"jest" : " ^27.2.0" ,
176
179
"npm-run-all" : " ^4.1.5" ,
177
- "@commitlint/cli" : " ^13.1.0" ,
178
- "@commitlint/config-conventional" : " ^13.1.0" ,
179
- "commitlint" : " ^13.1.0" ,
180
180
"onchange" : " ^7.1.0" ,
181
181
"prettier" : " ^2.4.0" ,
182
182
"semantic-release" : " ^17.4.7" ,
Original file line number Diff line number Diff line change 1
1
/* eslint-disable import/prefer-default-export */
2
2
import type { ExtensionContext } from 'coc.nvim' ;
3
3
import { workspace , commands } from 'coc.nvim' ;
4
- import assert from 'assert' ;
5
4
import { autoInitializeWorkspace , manualInitializeWorkspace } from '../commands' ;
6
5
import { EXTENSION_NS , getSettings } from '../settings' ;
7
6
@@ -21,7 +20,7 @@ const initialize = async (_context: ExtensionContext): Promise<void> => {
21
20
export const activate = async ( context : ExtensionContext ) : Promise < void > => {
22
21
// Setup vim runtime settings as vim plugin.
23
22
const rtp = await workspace . nvim . getOption ( 'runtimepath' ) ;
24
- assert ( typeof rtp === 'string' ) ;
23
+ if ( typeof rtp !== 'string' ) throw new Error ( '[coc-tsdetect] Failed to get runtimepath. ') ;
25
24
const paths = rtp . split ( ',' ) ;
26
25
if ( ! paths . includes ( context . extensionPath ) ) {
27
26
await workspace . nvim . command ( `execute 'noautocmd set runtimepath^='.fnameescape('${ context . extensionPath } ')` ) ;
Original file line number Diff line number Diff line change 1
1
import { workspace } from 'coc.nvim' ;
2
- import assert from 'assert' ;
3
2
4
3
export const EXTENSION_NS = 'tsdetect' ;
5
4
@@ -23,8 +22,9 @@ export const getSettings = (): Settings => {
23
22
const result : any = Object . create ( null ) ;
24
23
settingsKeys . forEach ( ( key ) => {
25
24
const value = settings . inspect ( key ) ;
26
- assert ( value ) ;
27
- result [ key ] = value . workspaceValue ?? value . globalValue ?? value . defaultValue ;
25
+ if ( value ) {
26
+ result [ key ] = value . workspaceValue ?? value . globalValue ?? value . defaultValue ;
27
+ }
28
28
} ) ;
29
29
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
30
30
return result ;
You can’t perform that action at this time.
0 commit comments