Skip to content

Commit e583367

Browse files
committed
chore: update infra dependencies
1 parent 1252fc1 commit e583367

File tree

13 files changed

+1065
-880
lines changed

13 files changed

+1065
-880
lines changed

.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

.eslintignore renamed to .prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
node_modules
2-
.vscode-test
2+
vscode-test
33
out
44
fixtures
55
*.log

.vscode-test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const { defineConfig } = require('@vscode/test-cli');
2+
3+
module.exports = defineConfig({
4+
files: 'out/test/**/*.test.js',
5+
});

eslint.config.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const typescriptEslint = require('@typescript-eslint/eslint-plugin');
2+
const tsParser = require('@typescript-eslint/parser');
3+
4+
module.exports = {
5+
files: ['**/*.ts'],
6+
languageOptions: {
7+
parser: tsParser,
8+
},
9+
plugins: {
10+
'@typescript-eslint': typescriptEslint,
11+
},
12+
rules: {
13+
semi: [2, 'always'],
14+
'@typescript-eslint/no-unused-vars': 0,
15+
'@typescript-eslint/no-explicit-any': 0,
16+
'@typescript-eslint/explicit-module-boundary-types': 0,
17+
'@typescript-eslint/no-non-null-assertion': 0,
18+
},
19+
ignores: [
20+
'node_modules',
21+
'.vscode-test',
22+
'out',
23+
'fixtures',
24+
'*.log',
25+
'azure-pipelines.yml',
26+
'yarn.lock',
27+
],
28+
};

package.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@
6969
"items": {
7070
"type": "string"
7171
},
72-
"default": ["node_modules", ".git"],
72+
"default": [
73+
"node_modules",
74+
".git"
75+
],
7376
"description": "The glob patterns of ignored path while generate tree string for directory"
7477
},
7578
"asciiTreeGenerator.directoryMaxDepth": {
@@ -128,22 +131,23 @@
128131
"vscode:prepublish": "yarn run compile",
129132
"compile": "tsc -p ./",
130133
"watch": "tsc -watch -p ./",
131-
"test": "yarn run compile && node ./out/test/runTest.js",
132134
"lint": "eslint src",
133-
"prettify": "prettier --ignore-path .eslintignore '**/*.{js,jsx,ts,tsx,json,html,css,yml}' --write"
135+
"prettify": "prettier '**/*.{js,jsx,ts,tsx,json,html,css,yml}' --write",
136+
"pretest": "yarn run compile && yarn run lint",
137+
"test": "vscode-test"
134138
},
135139
"devDependencies": {
136140
"@types/glob": "^7.1.1",
137-
"@types/mocha": "8",
138-
"@types/node": "12",
141+
"@types/mocha": "^10.0.10",
142+
"@types/node": "16",
139143
"@types/vscode": "^1.50.0",
140-
"@typescript-eslint/eslint-plugin": "^4.16.0",
141-
"@typescript-eslint/parser": "^4.16.0",
142-
"eslint": "^7.21.0",
143-
"mocha": "8",
144-
"prettier": "^2.3.1",
145-
"typescript": "4",
146-
"vscode-test": "^1.5.2"
144+
"@typescript-eslint/eslint-plugin": "^8.17.0",
145+
"@typescript-eslint/parser": "^8.17.0",
146+
"@vscode/test-cli": "^0.0.10",
147+
"@vscode/test-electron": "^2.4.1",
148+
"eslint": "^9.16.0",
149+
"prettier": "^3.4.2",
150+
"typescript": "^5.7.2"
147151
},
148152
"dependencies": {
149153
"glob": "^7.1.3"

src/config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ import { IVsCodeConfig } from './lib/interface';
33

44
export function getConfig(): IVsCodeConfig {
55
const config: IVsCodeConfig = {
6-
directoryIgnore: vscode.workspace.getConfiguration().get<string[]>('asciiTreeGenerator.directoryIgnore'),
7-
directoryMaxDepth: vscode.workspace.getConfiguration().get<number>('asciiTreeGenerator.directoryMaxDepth'),
6+
directoryIgnore: vscode.workspace
7+
.getConfiguration()
8+
.get<string[]>('asciiTreeGenerator.directoryIgnore'),
9+
directoryMaxDepth: vscode.workspace
10+
.getConfiguration()
11+
.get<number>('asciiTreeGenerator.directoryMaxDepth'),
812
rootCharCode: vscode.workspace
913
.getConfiguration()
1014
.get<number>('asciiTreeGenerator.rootElement'),

src/extension.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ import * as path from 'path';
66

77
import { formatFileTreeItemsFromDirectory } from './lib/directory';
88
import { generate } from './lib/generator';
9-
import { getUserEOL, createWebview, revertTreeString, getCharCodesFromConfig, getDirectoryIgnoreFromConfig, getDirectoryMaxDepthFromConfig } from './utils';
9+
import {
10+
getUserEOL,
11+
createWebview,
12+
revertTreeString,
13+
getCharCodesFromConfig,
14+
getDirectoryIgnoreFromConfig,
15+
getDirectoryMaxDepthFromConfig,
16+
} from './utils';
1017
import { formatFileTreeItemsFromText } from './lib/text';
1118

1219
export function activate(context: vscode.ExtensionContext) {

src/lib/generator.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ function createTreeString(start: string, fill: string, size = 3) {
1616

1717
/** generate tree string */
1818
export function generate(items: IFileTreeItem[], options: IFormatOptions = {}) {
19-
const {
20-
eol = EOL,
21-
charset = defaultCharset,
22-
fillLeft = true,
23-
} = options;
19+
const { eol = EOL, charset = defaultCharset, fillLeft = true } = options;
2420
let leftSpace = '';
2521
if (fillLeft) {
2622
const minLeft = items.length

src/test/runTest.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/test/suite.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)