1.35.1 • Published 9 days ago

repo-check v1.35.1

Weekly downloads
53
License
GPL-3.0
Repository
github
Last release
9 days ago

Repo Checker

Project license Code Climate maintainability npm version npm monthly downloads

Package Quality Publish size Install size

logo

Usage

Choose your favorite method :

  1. Via npx : npx repo-check
  2. Via npm locally : npm install repo-check then run npx repo-check or use it in your package.json scripts
  3. Via local installation : clone this repository, cd into the folder and use pnpm start, pnpm start -- --target=../my-other-project for single run or pnpm dev, pnpm dev -- --target=../my-other-project

Pro tip : init repo-checker before fixing files.

Parameters

target

--target=path/to/folder tells repo-checker which directory it should scan. If no target is specified, repo-checker will scan current directory. Target can be a relative or absolute path, can contain one project or more.

fix

--fix kindly ask repo-checker to try to create missing files or update problematic ones. For example, repo-checker will check for a README.md, if it does not exists, the file will be created and filled with data accordingly to the README.md template (templates/README.md). Repo-checker will try to grab as much info as possible from the project folder to create this file. If it's not enough, you'll be prompt to init. If you want to fix already existing files, use --force to overwrite it.

init

--init ask repo-checker to initialize a data config file in the current directory. If file already exists, use --force to overwrite it.

quiet

--quiet repo-checker will works silently without output-ing to console, will only output to log file.

Todo

  • if website : check static folder : should have "_headers" & "favicon.ico" and "manifest.json" files inside
  • compute build/dist/folder/public size for maxSize compliance
  • check rel="noopener" or rel="noreferrer" to any <a external links to improve performance and prevent security vulnerabilities
  • check width and height attributes to any <img or <video to ensures that the browser can allocate the correct amount of space in the document
  • add nbFixes to the report
  • check last tag, suggest to tag if last one is old
  • extends unit tests to src/files (remove c8 ignore start temporary exclusions)
  • prepare a json schema for .repo-checker.json
  • try to avoid using class in this project and remove eslint-disable-next-line no-restricted-syntax

Benchmarks

Each bench result is from hyperfine --runs 20 --warmup 3 'COMMAND_TO_BENCH'.

command aliasdatemain lib targeteddelaynodeoscomment
vitest-v82023-07-17npx & vitest & v82,16 s18.16Linux
vitest2023-07-17npx & vitest 0.331,97 s18.16Linux
esbuild2023-07-17esbuild 0.1812 ms18.16Linux
repo-check2023-07-17repo-checker 1.3355 ms18.16Linux
repo-check2023-06-19repo-checker 1.3160 ms18.16Linux
esbuild2023-06-19esbuild 0.1812 ms18.16Linux
tsc-no-emit2023-06-19typescript 5.1760 ms18.16Linux
eslint2023-06-19eslint 8.437,4 s18.16Linux
vitest-v82023-06-19npx & vitest & v81,9 s18.16Linux
vitest2023-06-19npx & vitest 0.321,8 s18.16Linux

Command aliases :

  • repo-check : node dist/repo-check.min.cjs
  • repo-check-no-out : node dist/repo-check.min.cjs --quiet --no-report
  • esbuild : node_modules/.bin/esbuild src/index.ts --target=esnext --bundle --platform=node --minify --outfile=dist/repo-check.min.cjs
  • ts-run : node node_modules/typescript-run/src/index.js src
  • tsc-no-emit : node node_modules/typescript/bin/tsc --noEmit
  • npx-tsc-no-emit : npx tsc --noEmit
  • eslint : node node_modules/eslint/bin/eslint --fix --ignore-path .gitignore --ext .js,.ts .
  • eslint-ts-src-only : node node_modules/eslint/bin/eslint src/ --ext .ts
  • uvu : node node_modules/uvu/bin -r tsm tests
  • c8-uvu : node node_modules/c8/bin/c8 node_modules/uvu/bin -r tsm tests
  • vitest : npx vitest --run
  • vitest-c8 : npx vitest --run --coverage
  • vitest-v8 : npx vitest --run --coverage

Old method

Each task is run 3 times via time npm run <task> to get the average execution time in seconds.

tasklibsecondscomment
buildtsup10 config, 1 dep only, super fast
buildrollup2,7lots of deps (plugins) & config to do the same job
buildesbuild0,2amazing 👍
checkrepo-checker3,2 (2019)can surely be reduced ^^
checkrepo-checker0,8 (2021)
lintxo2,7
linteslint3,5
testava9
testmocha7,4a bit faster, same amount of setup
testuvu1,2amazing 👍
test + covava + c8167 seconds for c8 coverage ? wtf
test + covmocha + c8127 seconds for c8 coverage ? wtf
test + covmocha + nyc9,62 seconds for coverage seems more reasonable
test + covuvu + c81,6amazing 👍

Thanks

  • Arg : un-opinionated, no-frills CLI argument parser
  • Dependency-cruiser : handy tool to validate and visualize dependencies
  • Esbuild : an extremely fast JavaScript bundler and minifier
  • Eslint : super tool to find & fix problems
  • Github : for all their great work year after year, pushing OSS forward
  • Repo-checker : eslint cover /src code and this tool the rest ^^
  • Shields.io : for the nice badges on top of this readme
  • Shuutils : collection of pure JS utils
  • V8 : simple & effective cli for code coverage
  • Vitest : super fast vite-native testing framework
  • Watchlist : recursively watch a list of directories & run a command on any file system
1.35.1

9 days ago

1.35.0

3 months ago

1.34.0

6 months ago

1.32.0

11 months ago

1.33.0

10 months ago

1.30.0

1 year ago

1.30.1

1 year ago

1.31.0

1 year ago

1.29.0

2 years ago

1.27.0

2 years ago

1.28.0

2 years ago

1.26.0

2 years ago

1.25.0

2 years ago

1.24.3

2 years ago

1.24.4

2 years ago

1.23.0

2 years ago

1.24.1

2 years ago

1.24.2

2 years ago

1.24.0

2 years ago

1.21.0

2 years ago

1.20.1

2 years ago

1.22.0

2 years ago

1.19.0

3 years ago

1.18.0

3 years ago

1.17.0

3 years ago

1.16.0

3 years ago

1.15.0

3 years ago

1.15.1

3 years ago

1.14.8

3 years ago

1.14.7

3 years ago

1.14.6

3 years ago

1.14.5

3 years ago

1.14.4

3 years ago

1.14.3

3 years ago

1.14.1

3 years ago

1.14.0

3 years ago

1.14.2

3 years ago

1.13.0

3 years ago

1.12.0

3 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.3

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago