This repo contains all of the configuration for the examples shown in the presentation above.
Click the Actions tab above to check out the GitHub Actions CI workflows, also linked below.
https://nx.dev/nx/workspace-lint
The demo/workspace-lint
branch and this pull request show how you can prevent unexpected behavior by running npx nx workspace-lint
in CI.
See the following files for where we're applying that check:
https://nx.dev/core-features/enforce-project-boundaries
The demo/enforce-module-boundaries
branch and this pull request show how we can use these ESLint rules to enforce structure on our dependency graph.
https://nx.dev/packages/linter/generators/workspace-rule
The demo/workspace-eslint
branch and this pull request show how we can fail a PR if the code doesn't meet our custom ESLint rule.
- ESLint config
- Workspace Lint Rule barrel file
- Example lint rule - no-provided-in-any
- Example unit tests
Though I didn't really touch on it in the presentation (and it's not setup in this demo repo), all of these checks are meaningless if engineers can easily sidestep them. To prevent that, we use GitHub's CODEOWNERS
feature to apply a layer of protection to the Nx configuration files like the eslintrc.json
and our CI configuration.