typescript-library-starter icon indicating copy to clipboard operation
typescript-library-starter copied to clipboard

Extract Jest, Prettier, commitlint, Husky... configuration from package.json

Open tkrotoff opened this issue 6 years ago • 0 comments

Make them independent .js files with @ts-check (or .ts files if easily possible):

  • jest.config.js
  • jest.setup.ts
  • babel.config.js
  • .browserslistrc
  • prettier.config.js
  • .prettierignore
  • .huskyrc.js
  • commitlint.config.js
  • tslint.json
  • .eslintrc.js
  • ...

  • This way you don't a fatty package.json that does multiple unrelated things
  • You can add comments in .js files
  • You can check the .js files with TypeScript and/or a linter
  • One file does one thing, ala UNIX philosophy

Downside is that you have multiple root files, well that's how JavaScript development is nowadays.

tkrotoff avatar Feb 23 '19 15:02 tkrotoff