diff --git a/.github/DEVELOPMENT.md b/.github/DEVELOPMENT.md index 9c0cbaf..f059a81 100644 --- a/.github/DEVELOPMENT.md +++ b/.github/DEVELOPMENT.md @@ -17,6 +17,7 @@ - [Stylelint](#stylelint) - [Markdown](#markdown) - [Check Types](#check-types) + - [Check unused dependencies, exports \& types](#check-unused-dependencies-exports--types) - [Check Spelling](#check-spelling) - [Check package.json](#check-packagejson) - [Test](#test) @@ -27,9 +28,7 @@ Before you get started, you will need to have the following tools installed on your machine: - **[Node.js](https://nodejs.org/en/)** (version 12 or later) -- **[pnpm](https://pnpm.io/)** (version 5 or later) or - **[npm](https://www.npmjs.com/)** or **[yarn](https://yarnpkg.com/)** (version - 6 or later) +- **[pnpm](https://pnpm.io/)** (version 7 or later) - **[Git](https://git-scm.com/)** (optional, but recommended for version control) @@ -173,6 +172,15 @@ Markdown files `pnpm lint:types` +### Check unused dependencies, exports & types + +([knip](https://github.com/webpro/knip)): Checks all unused dependencies, +exports & types + +> Check the spelling errors + +`pnpm lint:knip` + ### Check Spelling ([cspell](https://cspell.org)): Spell checks across all source files diff --git a/.github/workflows/lint-knip.yml b/.github/workflows/lint-knip.yml new file mode 100644 index 0000000..fbd3a15 --- /dev/null +++ b/.github/workflows/lint-knip.yml @@ -0,0 +1,16 @@ +name: Check for unused dependencies, exports and types + +on: + pull_request: ~ + + push: + branches: + - main + +jobs: + knip: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/prepare + - run: pnpm lint:knip diff --git a/README.md b/README.md index 5baa74d..b6b8526 100644 --- a/README.md +++ b/README.md @@ -26,23 +26,25 @@ Built using the [Next.js framework](https://nextjs.org/) and written in TypeScript & other amazing technologies mentioned below to build a modern web application. -- [react](https://reactjs.org/) - [next.js](https://nextjs.org/) +- [react](https://reactjs.org/) - [typeScript](https://www.typescriptlang.org/) - [zod](https://github.com/colinhacks/zod) - [tailwindcss](https://tailwindcss.com/) +- [next-sitemap](https://github.com/iamvishnusankar/next-sitemap) +- [pnpm](https://pnpm.io/) - [eslint](https://eslint.org/) - [prettier](https://prettier.io/) - [stylelint](https://stylelint.io/) -- [jest](https://jestjs.io/) -- [react-testing-library](https://testing-library.com/docs/react-testing-library/intro/) -- [next-sitemap](https://github.com/iamvishnusankar/next-sitemap) -- [pnpm](https://pnpm.io/) +- [markdownlint](https://github.com/DavidAnson/markdownlint) +- [knip](https://github.com/webpro/knip) +- [cspell](https://cspell.org) +- [npm-package-json-lint](https://npmpackagejsonlint.org/) +- [release-it](https://github.com/release-it/release-it#readme) - [husky](https://typicode.github.io/husky/#/) - [lint-staged](https://github.com/okonet/lint-staged#readme) - [commitlint](https://commitlint.js.org/#/) - [gacp](https://github.com/vivaxy/gacp#readme) -- [release-it](https://github.com/release-it/release-it#readme) ## Development diff --git a/package.json b/package.json index a678fc7..2883e0e 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "lint:types": "tsc --noEmit", "lint:css": "stylelint '**/*.css' --cache --color -f verbose", "lint:md": "markdownlint **/*.md \".github/**/*.md\"", + "lint:knip": "knip --production", "lint:package-json": "npmPkgJsonLint .", "lint:spelling": "cspell --dot --gitignore --cache --no-progress check \"**/*\"", "format": "npm-run-all format:*",