Skip to content

Commit

Permalink
fix: adjusts some dependency-cruiser rules to allow eslint configs to…
Browse files Browse the repository at this point in the history
… link to devDependencies. Vets a new OS license.
  • Loading branch information
sverweij committed Nov 24, 2024
1 parent ef09774 commit b8009f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .dependency-cruiser.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fileURLToPath } from "node:url";

const defaultStrictRules = fileURLToPath(
new URL("./configs/recommended-strict.cjs", import.meta.url),
new URL("configs/recommended-strict.cjs", import.meta.url),
);
/** @type {import('./').IConfiguration} */
export default {
Expand Down Expand Up @@ -203,7 +203,7 @@ export default {
comment:
"In production code do not depend on external ('npm') modules not declared in your package.json's dependencies - otherwise a production only install (i.e. 'npm ci') will break. If this rule triggers on something that's only used during development, adapt the 'from' of the rule in the dependency-cruiser configuration.",
from: {
pathNot: ["^test/", "^tools/"],
pathNot: ["^test/", "^tools/", "^types/eslint[.]config[.]mjs"],
},
to: {
dependencyTypes: ["npm-dev"],
Expand All @@ -214,7 +214,6 @@ export default {
"triple-slash-type-reference",
"npm",
],
pathNot: ["node_modules/@types/"],
},
},
{
Expand Down Expand Up @@ -246,12 +245,12 @@ export default {
to: { dependencyTypes: ["npm-peer"] },
},
{
name: "no-unvetted-license",
name: "no-non-vetted-license",
comment:
"This module uses an external dependency that has license that's not vetted. The license itself might be OK, but bigcorp legal departments might get jittery over anything other than MIT (or ISC).",
severity: "error",
from: {},
to: { licenseNot: "MIT|ISC|Apache-2[.]0" },
to: { licenseNot: "MIT|ISC|Apache-2[.]0|BSD-2-Clause" },
},
{
name: "not-unreachable-from-cli",
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{matrix.node-version}}
- name: remove .npmrc on node 18 so that the npm install works
if: matrix.node-version == '18.x'
run: |
rm -f .npmrc
npm config set package-lock=true
npm config set save-exact=true
- name: install & build
run: |
sudo apt-get update
Expand Down

0 comments on commit b8009f0

Please sign in to comment.