Skip to content

Commit

Permalink
feat: drop node 6 support by no longer testing for it
Browse files Browse the repository at this point in the history
  • Loading branch information
lili2311 committed Mar 19, 2020
1 parent 55c050f commit 566a54b
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 61 deletions.
4 changes: 0 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,3 @@ workflows:
name: Test Node v8
context: nodejs-install
node_version: "8.17.0"
- test-all:
name: Test Node v6
context: nodejs-install
node_version: "6.17.1"
44 changes: 0 additions & 44 deletions .eslintrc.js

This file was deleted.

45 changes: 45 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parser": "@typescript-eslint/parser",
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/389
// parserOptions: {
// project: './tsconfig.json',
// },
"env": {
"node": true,
"es6": true,
"jest": true
},
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "warn",

// non-null assertions compromise the type safety somewhat, but many
// our types are still imprecisely defined and we don't use noImplicitAny
// anyway, so for the time being assertions are allowed
"@typescript-eslint/no-non-null-assertion": "warn",

"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-prototype-builtins": "off",
"require-atomic-updates": "off",
"no-buffer-constructor": "error"
},
"overrides": [
{
"files": ["*.ts"],
"rules": {
"id-blacklist": ["error", "exports"] // in TS, use "export" instead of Node's "module.exports"
}
}
]
}
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ node_js:
- "12.0.0"
- "10"
- "8"
- "6"
cache:
npm: false
directories:
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"snyk": "dist/cli/index.js"
},
"engines": {
"node": ">=6"
"node": ">=8"
},
"scripts": {
"build": "tsc",
Expand Down Expand Up @@ -105,11 +105,11 @@
"@types/diff": "^3.5.2",
"@types/lodash": "^4.14.136",
"@types/needle": "^2.0.4",
"@types/node": "^6.14.4",
"@types/node": "8.10.59",
"@types/sinon": "^7.5.0",
"@typescript-eslint/eslint-plugin": "2.18.0",
"@typescript-eslint/parser": "^2.0.0",
"eslint": "^5.16.0",
"eslint": "6.8.0",
"eslint-config-prettier": "^6.1.0",
"madge": "^3.4.4",
"nock": "^10.0.6",
Expand Down
10 changes: 4 additions & 6 deletions src/cli/commands/monitor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,21 @@ async function monitor(...args0: MethodArgs): Promise<any> {
// We send results from "all-sub-projects" scanning as different Monitor objects
// multi result will become default, so start migrating code to always work with it
let perProjectResult: MultiProjectResultCustom;
let foundProjectCount;

if (!pluginApi.isMultiResult(inspectResult)) {
foundProjectCount = getSubProjectCount(inspectResult);
perProjectResult = convertSingleResultToMultiCustom(inspectResult);
} else {
perProjectResult = convertMultiResultToMultiCustom(inspectResult);
}

// Post the project dependencies to the Registry
for (const projectDeps of perProjectResult.scannedProjects) {
const packageManager = extractPackageManager(
const extractedPackageManager = extractPackageManager(
projectDeps,
perProjectResult,
options as MonitorOptions & Options,
);
analytics.add('packageManager', packageManager);
analytics.add('packageManager', extractedPackageManager);
maybePrintDeps(options, projectDeps.depTree);

debug(`Processing ${projectDeps.depTree.name}...`);
Expand All @@ -166,7 +164,7 @@ async function monitor(...args0: MethodArgs): Promise<any> {
const res: MonitorResult = await promiseOrCleanup(
snykMonitor(
path,
generateMonitorMeta(options, packageManager),
generateMonitorMeta(options, extractedPackageManager),
projectDeps,
options,
projectDeps.plugin as PluginMetadata,
Expand All @@ -179,7 +177,7 @@ async function monitor(...args0: MethodArgs): Promise<any> {
const projectName = projectDeps.depTree.name;

const monOutput = formatMonitorOutput(
packageManager,
extractedPackageManager,
res,
options,
projectName,
Expand Down
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
"compilerOptions": {
"outDir": "./dist",
"pretty": true,
"target": "es2015",
"target": "es2017",
"lib": [
"es2015",
"es2016.array.include",
"es2017",
],
"module": "commonjs",
"allowJs": true,
Expand Down

0 comments on commit 566a54b

Please sign in to comment.