Skip to content

Commit

Permalink
fix(workspace): add syncpack for dep mgmt and update root eslint to f…
Browse files Browse the repository at this point in the history
…ix errors
  • Loading branch information
waldronmatt committed Sep 12, 2023
1 parent 90aa320 commit 879bdf7
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
16 changes: 14 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
module.exports = {
root: true,
extends: ['custom/js.cjs'],
// only lint monorepo root and configs files
env: {
node: true,
es2020: true,
},
extends: ['eslint:recommended', 'plugin:import/recommended', 'airbnb-base'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
},
],
'linebreak-style': 0,
},
ignorePatterns: ['apps/**', 'packages/**'],
};
24 changes: 24 additions & 0 deletions .syncpackrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"semverRange": "^",
"source": [
"package.json",
"apps/*/package.json",
"configs/*/package.json",
"packages/*/package.json"
],
"semverGroups": [
{
"packages": [
"@waldronmatt/**",
"eslint-config-custom",
"tsconfig-config",
"jest-config",
"vite-project"
],
"dependencies": [
"**"
],
"isIgnored": true
}
]
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pnpm dev

Lint files:

**Note**: Since `vite-project` depends on linked packages, a linting error will occur if `pnpm build` has not run at least once first.

```bash
pnpm lint
```
Expand Down Expand Up @@ -126,7 +128,7 @@ Delete workspace root `node_modules` and `pnpm-lock.yaml` files:
pnpm clear
```

Lint root and `configs/` `js/cjs` files, check for secrets, validate published packages, and verify monorepo best practices:
Lint root and `configs/` `js/cjs` files, check for secrets, lint dependency versions, validate published packages, and verify monorepo best practices:

```bash
pnpm lint:mr
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,8 @@
"lint:secrets": "npx secretlint **/*",
"lint:publish": "npx publint",
"lint:package": "npx manypkg check",
"lint:mr": "run-p lint:js lint:secrets lint:publish lint:package",
"lint:deps": "syncpack lint-semver-ranges --config .syncpackrc",
"lint:mr": "run-p lint:js lint:secrets lint:deps lint:publish lint:package",
"dev": "npx nx run-many -t dev",
"lint": "npx nx run-many -t lint",
"test": "npx nx run-many -t test",
Expand All @@ -44,12 +45,11 @@
"@lerna-lite/version": "^2.5.1",
"@manypkg/cli": "^0.21.0",
"@nrwl/cli": "^15.9.3",
"@nrwl/nx-cloud": "16.4.0",
"@nrwl/nx-cloud": "^16.4.0",
"@secretlint/secretlint-rule-preset-recommend": "^7.0.7",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.49.0",
"eslint-config-custom": "workspace:^",
"husky": "^8.0.3",
"lint-staged": "^13.3.0",
"npm-run-all": "^4.1.5",
Expand Down
5 changes: 1 addition & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 879bdf7

Please sign in to comment.