Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

npm dep update and eslint fix #132

Merged
merged 5 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 31 additions & 10 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/recommended",
"prettier",
"prettier/@typescript-eslint"
],
Expand All @@ -22,10 +23,7 @@
"project": "./tsconfig.json",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"plugins": ["@typescript-eslint", "prettier", "import"],
"rules": {
"camelcase": 2,
"consistent-return": 0,
Expand All @@ -47,6 +45,32 @@
"mjs": "never"
}
],
"import/first": [
"off"
],
"import/order": ["error",
{
"groups": [
"builtin",
"external",
"sibling",
"parent",
"internal",
"index",
"object"
],
"pathGroups": [
{
"pattern": "~/**",
"group": "internal"
}
],
"alphabetize": {
"order": "asc" /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */,
"caseInsensitive": true /* ignore case. Options: [true, false] */
}
}
],
"import/no-default-export": "off",
"import/no-duplicates": ["error"],
"import/no-unresolved": ["error"],
Expand All @@ -60,7 +84,8 @@
"no-else-return": ["error"],
"no-global-strict": 0,
"no-irregular-whitespace": ["error"],
"no-shadow": ["error"],
"no-shadow": ["off"],
"@typescript-eslint/no-shadow": "error",
"no-underscore-dangle": 0,
"@typescript-eslint/no-use-before-define": 2,
"@typescript-eslint/await-thenable": "error",
Expand All @@ -73,18 +98,14 @@
},
"settings": {
"import/core-modules": ["vscode"],
"import/extensions": [
".ts",
".tsx"
],
"import/extensions": [".ts", ".tsx"],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"extensions": [".ts"]
},
"": {},
"node": {
"extensions": [".ts", ".js", ".jsx"]
}
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
"serviceaccount",
"sinkbindings",
"sinonjs",
"spawnargs",
"spawnfile",
"subresources",
"thenable",
"triggerb",
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Patch to allow locally built versions of the `kn` cli tool.
- Patch to add a `Refresh` button the explorer.
- Patch to fix the `Report Issue` button in the exporer.
- Patch to fix the `Report Issue` button in the explorer.
- Patch to add a default value when no Service is found.

## 0.1.3 (2020/03/08)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[Knative](https://knative.tips/intro/knative/) (pronounced kay-native) is a set of open source components for Kubernetes that implements functionality to:

* run stateless workloads such as microservices
* run stateless workloads such as micro-services
* event subscription, delivery and handling

on Kubernetes clusters.
Expand Down
27 changes: 15 additions & 12 deletions build/install-vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*-----------------------------------------------------------------------------------------------*/

import { downloadAndUnzipVSCode } from 'vscode-test';
import { execSync } from 'child_process';
import { dirname, join } from 'path';
import { platform } from 'os';
import { dirname, join } from 'path';
import { downloadAndUnzipVSCode } from 'vscode-test';

downloadAndUnzipVSCode().then((executable: string): void => {
let exe: string = executable;
if (platform() === 'darwin') {
exe = `'${join(exe.substring(0, exe.indexOf('.app') + 4), 'Contents', 'Resources', 'app', 'bin', 'code')}'`;
} else {
exe = join(dirname(exe), 'bin', 'code');
}
execSync(`${exe} --install-extension ms-kubernetes-tools.vscode-kubernetes-tools`);
execSync(`${exe} --install-extension redhat.vscode-yaml`);
});
downloadAndUnzipVSCode()
.then((executable: string): void => {
let exe: string = executable;
if (platform() === 'darwin') {
exe = `'${join(exe.substring(0, exe.indexOf('.app') + 4), 'Contents', 'Resources', 'app', 'bin', 'code')}'`;
} else {
exe = join(dirname(exe), 'bin', 'code');
}
execSync(`${exe} --install-extension ms-kubernetes-tools.vscode-kubernetes-tools`);
execSync(`${exe} --install-extension redhat.vscode-yaml`);
})
// eslint-disable-next-line no-console, @typescript-eslint/restrict-template-expressions
.catch((err) => console.log(`There was an error while downloading and unzipping, error = ${err}`));
1 change: 1 addition & 0 deletions build/unit-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ async function main(): Promise<void> {
}
}

// eslint-disable-next-line @typescript-eslint/no-floating-promises
main();
13 changes: 9 additions & 4 deletions build/verify-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

// import { CancellationToken } from 'vscode';
import { exec } from 'child_process';
import { tmpdir } from 'os';
import { join, resolve } from 'path';
import { existsSync } from 'fs-extra';
import { fromFile } from 'hasha';
import { sync } from 'mkdirp';
import { tmpdir } from 'os';
import { join, resolve } from 'path';
// import { Config } from '../src/cli/cli-config';
import configData = require('../src/cli/cli-config.json');
import { DownloadUtil } from '../src/util/download';
// import { Config } from '../src/cli/cli-config';
// import loadJSON from '../src/util/parse';

// const configData = '../src/cli/cli-config.json';
import configData = require('../src/cli/cli-config.json');

async function downloadFileAndCreateSha256(
targetFolder: string,
Expand All @@ -41,12 +41,17 @@ async function downloadFileAndCreateSha256(

function verifyTools(): void {
Object.keys(configData).forEach((key) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Object.keys(configData[key].platform).forEach((OS) => {
const targetFolder = resolve(tmpdir(), OS);
// eslint-disable-next-line @typescript-eslint/no-floating-promises
downloadFileAndCreateSha256(
targetFolder,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
configData[key].platform[OS].dlFileName,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
configData[key].platform[OS].url,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
configData[key].platform[OS].sha256sum,
);
});
Expand Down
Loading