Skip to content

Commit

Permalink
wip-bump-ts-es
Browse files Browse the repository at this point in the history
  • Loading branch information
deribaucourt committed Sep 13, 2024
1 parent c7fa0ac commit bb3cc66
Show file tree
Hide file tree
Showing 9 changed files with 5,616 additions and 2,793 deletions.
76 changes: 17 additions & 59 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
"@types/find": "^0.2.2",
"@types/vscode": "^1.92.0"
"@types/find": "^0.2.4",
"@types/vscode": "^1.93.0"
},
"workspaces": [
"src/lib"
Expand Down
86 changes: 17 additions & 69 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,77 +1,25 @@
import header from "eslint-plugin-header";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
// @ts-check

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';

export default [
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ["**/*.ts"],
ignores: [
"**/out",
"**/poky",
"**/.vscode-test",
"integration-tests/project-folder",
"client/server",
"__mocks__/vscode.ts",
"**/jest.config.js",
"**/eslint.config.mjs",
"**/*.js",
"integration-tests/project-folder/**",
"client/server/**",
],
},
...compat.extends(
"standard-with-typescript",
"plugin:deprecation/recommended"
),
{
plugins: {
header,
},

languageOptions: {
globals: {
...globals.browser,
},

ecmaVersion: "latest",
sourceType: "module",
},

rules: {
"header/header": [
2,
"block",
[
" --------------------------------------------------------------------------------------------",
{
pattern: " \\* Copyright \\(c\\) .*\\. All rights reserved\\.",
template:
" * Copyright (c) 2023 Savoir-faire Linux. All rights reserved.",
},
" * Licensed under the MIT License. See License.txt in the project root for license information.",
" * ------------------------------------------------------------------------------------------ ",
],
2,
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-explicit-any": "off"
},
},
{
files: ["**/*.ts"],

languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: 5,
sourceType: "commonjs",
},
},
];
sourceType: "module",
}
}
);
37 changes: 17 additions & 20 deletions integration-tests/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* ------------------------------------------------------------------------------------------ */

import * as path from 'path'
import glob from 'glob'
import {globSync} from 'glob'
import Mocha from 'mocha'

export async function run (): Promise<void> {
Expand All @@ -15,26 +15,23 @@ export async function run (): Promise<void> {
const testsRoot = path.resolve(__dirname, '../..')

await new Promise((_resolve, _reject) => {
glob('**/integration-tests/**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err !== undefined && err !== null) {
_reject(err); return
}
const jsfiles = globSync('../../**/integration-tests/**/**.test.js', { cwd: testsRoot })

// Add files to the test suite
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)))
// Add files to the test suite
jsfiles.forEach(f => mocha.addFile(path.resolve(testsRoot, f)))

try {
// Run the mocha test
mocha.run(failures => {
if (failures > 0) {
_reject(new Error(`${failures} tests failed.`))
} else {
_resolve('All tests passed.')
}
})
} catch (err) {
_reject(err)
}
})
try {
// Run the mocha test
mocha.run(failures => {
if (failures > 0) {
_reject(new Error(`${failures} tests failed.`))
} else {
_resolve('All tests passed.')
}
})
} catch (error) {
// Handle the error
console.error(error)
}
})
}
Loading

0 comments on commit bb3cc66

Please sign in to comment.