Skip to content

Commit

Permalink
chore(repo): replace dep check script with new lint rule (nrwl#18060)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo authored Jul 19, 2023
1 parent b73f980 commit 28df205
Show file tree
Hide file tree
Showing 52 changed files with 643 additions and 740 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ jobs:
pnpm nx-cloud record -- nx format:check --base=$NX_BASE --head=$NX_HEAD &
pids+=($!)
pnpm nx run-many -t check-imports check-commit check-lock-files depcheck check-codeowners documentation --parallel=1 --no-dte &
pnpm nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dte &
pids+=($!)
pnpm nx affected --target=lint --base=$NX_BASE --head=$NX_HEAD --parallel=3 &
Expand Down
1 change: 0 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ pnpm-lock.yaml @nrwl/nx-pipelines-reviewers
/CODEOWNERS @FrozenPandaz @AgentEnder

# Scripts
/scripts/depcheck @FrozenPandaz @vsavkin @jaysoo
/scripts/documentation @nrwl/nx-docs-reviewers
/scripts/angular-support-upgrades @nrwl/nx-angular-reviewers

Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"nx-release": "ts-node -P ./scripts/tsconfig.release.json ./scripts/nx-release",
"prepublishOnly": "node ./scripts/update-package-group.js",
"version": "pnpm prettier lerna.json --write",
"depcheck": "ts-node -P ./scripts/tsconfig.scripts.json ./scripts/depcheck",
"local-registry": "nx local-registry @nx/nx-source",
"documentation": "ts-node -P scripts/tsconfig.scripts.json ./scripts/documentation/generators/main.ts && pnpm check-documentation-map",
"submit-plugin": "node ./scripts/submit-plugin.js",
Expand Down Expand Up @@ -153,7 +152,6 @@
"cytoscape-popper": "^2.0.0",
"cz-git": "^1.4.0",
"czg": "^1.4.0",
"depcheck": "^1.3.1",
"detect-port": "^1.5.1",
"dotenv": "~10.0.0",
"ejs": "^3.1.7",
Expand Down Expand Up @@ -352,7 +350,6 @@
"check-imports",
"check-lock-files",
"check-codeowners",
"depcheck",
"documentation"
]
},
Expand Down
61 changes: 61 additions & 0 deletions packages/angular/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,67 @@
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": [
"nx",
"eslint",
"rxjs",
"semver",
// These are installed by ensurePackage so missing in package.json
"@nx/cypress",
"@nx/jest",
"@nx/rollup",
"@nx/storybook",
"@nx/vite",
"@nx/webpack",
"prettier",
"typescript",
// These are installed by generators
"@angular-devkit/core",
"@angular-devkit/architect",
"@angular-devkit/build-angular",
"@angular-devkit/schematics",
"@angular/compiler",
"@angular/compiler-cli",
"@angular/core",
"@angular/router",
"@ngrx/effects",
"@ngrx/router-store",
"@ngrx/store",
"@storybook/angular",
"@module-federation/node",
// installed dynamically by the library generator
"ng-packagr",
// ng-packagr deps, some are handled if not installed
"injection-js",
"browserslist",
"cacache",
"less",
"node-sass",
"node-sass-tilde-importer",
"ora",
"convert-source-map",
"postcss",
"postcss-import",
"postcss-preset-env",
"postcss-url",
"sass",
"stylus",
"tailwindcss",
// used in the CT angular plugin where Cy is already installed to use it.
"cypress"
]
}
]
}
}
]
}
5 changes: 2 additions & 3 deletions packages/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@
"@phenomnomnominal/tsquery": "~5.0.1",
"@typescript-eslint/type-utils": "^5.36.1",
"chalk": "^4.1.0",
"chokidar": "^3.5.1",
"find-cache-dir": "^3.3.2",
"http-server": "^14.1.0",
"ignore": "^5.0.4",
"magic-string": "~0.26.2",
"minimatch": "3.0.5",
"semver": "7.5.3",
"tslib": "^2.3.0",
"webpack": "^5.80.0",
"webpack-merge": "5.7.3",
"webpack-merge": "^5.8.0",
"enquirer": "^2.3.6",
"@nx/cypress": "file:../cypress",
"@nx/devkit": "file:../devkit",
Expand Down
12 changes: 12 additions & 0 deletions packages/create-nx-plugin/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"]
}
]
}
}
]
}
1 change: 1 addition & 0 deletions packages/create-nx-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"create-nx-workspace": "file:../create-nx-workspace",
"chalk": "^4.1.0",
"enquirer": "~2.3.6",
"tslib": "^2.3.0",
"yargs": "^17.6.2"
},
"publishConfig": {
Expand Down
12 changes: 12 additions & 0 deletions packages/create-nx-workspace/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"]
}
]
}
}
]
}
20 changes: 20 additions & 0 deletions packages/cypress/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": [
"nx",
"typescript",
// Type imports only
"eslint",
"rollup",
"vite"
]
}
]
}
}
],
"ignorePatterns": ["!**/*"]
Expand Down
3 changes: 2 additions & 1 deletion packages/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
},
"dependencies": {
"@phenomnomnominal/tsquery": "~5.0.1",
"detect-port": "^1.5.1",
"dotenv": "~10.0.0",
"semver": "7.5.3",
"detect-port": "^1.5.1",
"tslib": "^2.3.0",
"@nx/devkit": "file:../devkit",
"@nx/js": "file:../js",
"@nx/linter": "file:../linter"
Expand Down
13 changes: 13 additions & 0 deletions packages/detox/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": ["nx", "typescript", "detox"]
}
]
}
}
]
}
3 changes: 2 additions & 1 deletion packages/detox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"@nx/jest": "file:../jest",
"@nx/js": "file:../js",
"@nx/linter": "file:../linter",
"@nx/react": "file:../react"
"@nx/react": "file:../react",
"tslib": "^2.3.0"
},
"peerDependencies": {
"detox": "^20.9.0"
Expand Down
23 changes: 23 additions & 0 deletions packages/devkit/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,29 @@
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": [
"nx",
"typescript",
"prettier",
// Installed to workspace by plugins
"rxjs",
"@angular-devkit/core",
"@angular-devkit/architect",
"@angular-devkit/schematics",
"webpack"
]
}
]
}
}
]
}
13 changes: 13 additions & 0 deletions packages/esbuild/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": ["nx", "typescript", "esbuild"]
}
]
}
}
]
}
20 changes: 20 additions & 0 deletions packages/eslint-plugin/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": [
"nx",
"typescript",
// Installed to workspace by plugins
"@typescript-eslint/parser",
"eslint-config-prettier",
"@angular-eslint/eslint-plugin"
]
}
]
}
}
]
}
3 changes: 2 additions & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
"chalk": "^4.1.0",
"confusing-browser-globals": "^1.0.9",
"jsonc-eslint-parser": "^2.1.0",
"semver": "7.5.3"
"semver": "7.5.3",
"tslib": "^2.3.0"
},
"publishConfig": {
"access": "public"
Expand Down
24 changes: 24 additions & 0 deletions packages/expo/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": [
"nx",
"@nx/rollup",
"@nx/webpack",
"typescript",
"eslint",
"expo",
"react",
"@expo/cli",
"eas-cli",
"util" // This is coming from @storybook/builder-manager since it uses the browser polyfill
]
}
]
}
}
]
}
1 change: 1 addition & 0 deletions packages/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"metro-resolver": "0.76.7",
"node-fetch": "^2.6.7",
"tar-fs": "^2.1.1",
"tslib": "^2.3.0",
"tsconfig-paths": "^4.1.2",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"@nx/detox": "file:../detox",
Expand Down
19 changes: 19 additions & 0 deletions packages/express/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@
"rules": {
"@nx/nx-plugin-checks": "error"
}
},
{
"files": ["./package.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": [
"error",
{
"buildTargets": ["build-base"],
"ignoredDependencies": [
"nx",
"@nx/linter",
"typescript",
"eslint",
"express"
]
}
]
}
}
]
}
Loading

0 comments on commit 28df205

Please sign in to comment.