Skip to content

Commit

Permalink
build(npm): ⬆️ ajv, chalk, commander, eslint-config-prettier, eslint-…
Browse files Browse the repository at this point in the history
…plugin-unicorn, husky, lint-staged, prettier, semver, strip-json-comments, teamcity-service-messages, wrap-ansi
  • Loading branch information
sverweij committed Apr 25, 2020
1 parent af56484 commit 0dad358
Show file tree
Hide file tree
Showing 195 changed files with 1,900 additions and 1,889 deletions.
2 changes: 1 addition & 1 deletion bin/wrap-stream-in-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const wrap = require("../src/cli/tools/wrap-stream-in-html");
* interactive to use. Tailored to svg's generated by graphviz dot.
*/

wrap(process.stdin).then(pOutput => process.stdout.write(pOutput));
wrap(process.stdin).then((pOutput) => process.stdout.write(pOutput));
4 changes: 2 additions & 2 deletions configs/recommended-strict.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const recommended = require("./recommended");

module.exports = {
...recommended,
forbidden: recommended.forbidden.map(pRule => {
forbidden: recommended.forbidden.map((pRule) => {
pRule.severity = "error";
return pRule;
})
}),
};
4 changes: 2 additions & 2 deletions configs/recommended-warn-only.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const recommended = require("./recommended");

module.exports = {
...recommended,
forbidden: recommended.forbidden.map(pRule => {
forbidden: recommended.forbidden.map((pRule) => {
pRule.severity = "warn";
return pRule;
})
}),
};
10 changes: 5 additions & 5 deletions configs/recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
noDuplicateDependencyTypes,
noNonPackageJson,
notToDeprecated,
notToUnresolvable
notToUnresolvable,
],
options: {
doNotFollow: {
Expand All @@ -25,8 +25,8 @@ module.exports = {
"npm-optional",
"npm-peer",
"npm-bundled",
"npm-no-pkg"
]
}
}
"npm-no-pkg",
],
},
},
};
4 changes: 2 additions & 2 deletions configs/rules/no-circular.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
severity: "error",
from: {},
to: {
circular: true
}
circular: true,
},
};
4 changes: 2 additions & 2 deletions configs/rules/no-deprecated-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
from: {},
to: {
dependencyTypes: ["core"],
path: "^(punycode|domain|constants|sys|_linklist|_stream_wrap)$"
}
path: "^(punycode|domain|constants|sys|_linklist|_stream_wrap)$",
},
};
4 changes: 2 additions & 2 deletions configs/rules/no-duplicate-dependency-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ module.exports = {
severity: "warn",
from: {},
to: {
moreThanOneDependencyType: true
}
moreThanOneDependencyType: true,
},
};
4 changes: 2 additions & 2 deletions configs/rules/no-non-package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module.exports = {
"version. Fix it by adding the package to the dependencies in your package.json.",
from: {},
to: {
dependencyTypes: ["npm-no-pkg", "npm-unknown"]
}
dependencyTypes: ["npm-no-pkg", "npm-unknown"],
},
};
4 changes: 2 additions & 2 deletions configs/rules/no-orphans.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
severity: "warn",
from: {
orphan: true,
pathNot: "\\.d\\.ts$"
pathNot: "\\.d\\.ts$",
},
to: {}
to: {},
};
4 changes: 2 additions & 2 deletions configs/rules/not-to-deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
severity: "warn",
from: {},
to: {
dependencyTypes: ["deprecated"]
}
dependencyTypes: ["deprecated"],
},
};
4 changes: 2 additions & 2 deletions configs/rules/not-to-unresolvable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
severity: "error",
from: {},
to: {
couldNotResolve: true
}
couldNotResolve: true,
},
};
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"lint:eslint": "eslint bin/dependency-cruise.js src test configs utl --cache --cache-location .cache/eslint/",
"lint:eslint:fix": "eslint --fix bin src test configs utl --cache --cache-location .cache/eslint/",
"lint:fix": "npm-run-all lint:eslint:fix lint:prettier lint:types:fix",
"lint:prettier": "prettier --loglevel warn --write {utl,src,configs}/\\*\\*/\\*.{js,json} bin/\\* !**/*.template.js types/\\*.d.ts test/\\*\\*/\\*.{spec,utl}.js",
"lint:prettier:check": "prettier --loglevel warn --check {utl,src,configs}/\\*\\*/\\*.{js,json} bin/\\* !**/*.template.js types/\\*.d.ts test/\\*\\*/\\*.{spec,utl}.js",
"lint:prettier": "prettier --loglevel warn --write src/\\*\\*/\\*.{js,json} {utl,configs}/\\*\\*/\\*.js bin/\\* !**/*.template.js types/\\*.d.ts test/\\*\\*/\\*.{spec,utl}.js",
"lint:prettier:check": "prettier --loglevel warn --check src/\\*\\*/\\*.{js,json} {utl,configs}/\\*\\*/\\*.js bin/\\* !**/*.template.js types/\\*.d.ts test/\\*\\*/\\*.{spec,utl}.js",
"lint:types": "npm-run-all lint:types:tsc lint:types:tslint",
"lint:types:tsc": "tsc --noEmit --strict --types --noUnusedLocals --noUnusedParameters types/dependency-cruiser.d.ts",
"lint:types:tslint": "tslint types/dependency-cruiser.d.ts",
Expand Down Expand Up @@ -123,9 +123,9 @@
"acorn": "7.1.1",
"acorn-loose": "7.0.0",
"acorn-walk": "7.1.1",
"ajv": "6.12.0",
"chalk": "3.0.0",
"commander": "5.0.0",
"ajv": "6.12.2",
"chalk": "4.0.0",
"commander": "5.1.0",
"enhanced-resolve": "4.1.1",
"figures": "3.2.0",
"get-stream": "5.1.0",
Expand All @@ -136,34 +136,34 @@
"lodash": "4.17.15",
"pnp-webpack-plugin": "1.6.4",
"safe-regex": "2.1.1",
"semver": "6.3.0",
"semver": "7.3.2",
"semver-try-require": "3.0.0",
"strip-json-comments": "3.0.1",
"teamcity-service-messages": "0.1.10",
"strip-json-comments": "3.1.0",
"teamcity-service-messages": "0.1.11",
"tsconfig-paths-webpack-plugin": "3.2.0",
"wrap-ansi": "6.2.0"
"wrap-ansi": "7.0.0"
},
"devDependencies": {
"chai": "4.2.0",
"chai-json-schema": "1.5.1",
"coffeescript": "2.5.1",
"eslint": "6.8.0",
"eslint-config-moving-meadow": "1.3.0",
"eslint-config-prettier": "6.10.1",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-budapestian": "1.2.0",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-mocha": "6.3.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-security": "1.4.0",
"eslint-plugin-unicorn": "15.0.1",
"husky": "3.1.0",
"eslint-plugin-unicorn": "18.0.1",
"husky": "4.2.5",
"intercept-stdout": "0.1.2",
"lint-staged": "9.5.0",
"lint-staged": "10.1.7",
"mocha": "7.1.1",
"normalize-newline": "3.0.0",
"npm-run-all": "4.1.5",
"nyc": "15.0.1",
"prettier": "1.19.1",
"prettier": "2.0.5",
"shx": "0.3.2",
"symlink-dir": "3.1.2",
"tslint": "6.1.1",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/compile-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ function compileConfig(
pBaseDirectory,
normalizeResolveOptions(
{
extensions: [".js", ".json"]
extensions: [".js", ".json"],
},
{
externalModuleResolutionStrategy: getRunningProcessResolutionStrategy()
externalModuleResolutionStrategy: getRunningProcessResolutionStrategy(),
}
),
"cli"
Expand Down
16 changes: 8 additions & 8 deletions src/cli/compile-config/merge-configs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const _isEqual = require("lodash/isEqual");

function extendNamedRule(pExtendedRule, pForbiddenArrayBase) {
return pForbiddenArrayBase
.filter(pBaseRule => pBaseRule.name === pExtendedRule.name)
.filter((pBaseRule) => pBaseRule.name === pExtendedRule.name)
.reduce(
(pAll, pBaseRule) => ({
...pBaseRule,
...pAll
...pAll,
}),
pExtendedRule
);
Expand All @@ -34,13 +34,13 @@ function mergeForbidden(pForbiddenArrayExtended, pForbiddenArrayBase) {
let lAnonymousRules = _uniqWith(
pForbiddenArrayExtended
.concat(pForbiddenArrayBase)
.filter(pRule => !pRule.name),
.filter((pRule) => !pRule.name),
_isEqual
);

let lNamedRules = pForbiddenArrayExtended
.filter(pRule => pRule.name)
.map(pNamedRule => extendNamedRule(pNamedRule, pForbiddenArrayBase));
.filter((pRule) => pRule.name)
.map((pNamedRule) => extendNamedRule(pNamedRule, pForbiddenArrayBase));

// merge named rules based on unique name
lNamedRules = _uniqBy(
Expand All @@ -50,8 +50,8 @@ function mergeForbidden(pForbiddenArrayExtended, pForbiddenArrayBase) {

// the other concats (anonymous, allowed) don't need it
// but have it to be consistent with this
lNamedRules.concat(pForbiddenArrayBase).filter(pRule => pRule.name),
pRule => pRule.name
lNamedRules.concat(pForbiddenArrayBase).filter((pRule) => pRule.name),
(pRule) => pRule.name
);

return lNamedRules.concat(lAnonymousRules);
Expand Down Expand Up @@ -120,5 +120,5 @@ module.exports = (pConfigExtended, pConfigBase) => ({
options: mergeOptions(
_get(pConfigExtended, "options", {}),
_get(pConfigBase, "options", {})
)
),
});
2 changes: 1 addition & 1 deletion src/cli/compile-config/read-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require("fs");
const path = require("path");
const stripJSONComments = require("strip-json-comments");

module.exports = pConfigFileName => {
module.exports = (pConfigFileName) => {
if ([".js", ""].includes(path.extname(pConfigFileName))) {
/* eslint node/global-require:0, security/detect-non-literal-require:0, import/no-dynamic-require:0 */
return require(pConfigFileName);
Expand Down
2 changes: 1 addition & 1 deletion src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function extractTSConfigOptions(pOptions) {

function runCruise(pFileDirectoryArray, pOptions) {
pFileDirectoryArray
.filter(pFileOrDirectory => !glob.hasMagic(pFileOrDirectory))
.filter((pFileOrDirectory) => !glob.hasMagic(pFileOrDirectory))
.forEach(validateFileExistence);

pOptions = normalizeOptions(pOptions);
Expand Down
4 changes: 2 additions & 2 deletions src/cli/init-config/build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = function buildConfig(pNormalizedInitOptions) {
sourceLocationRE: folderNameArrayToRE(
pNormalizedInitOptions.sourceLocation
),
testLocationRE: folderNameArrayToRE(pNormalizedInitOptions.testLocation)
}
testLocationRE: folderNameArrayToRE(pNormalizedInitOptions.testLocation),
},
});
};
Loading

0 comments on commit 0dad358

Please sign in to comment.