mediamonks/pota

[Linting] add lint-scripts

Opened this issue · 0 comments

psimk commented

@pota/lint-scripts

Commands

  • fix - runs all fix commands synchronously or in parallel
  • fix:scripts - runs a JavaScript/TypeScript code linter, with auto-fixing
  • fix:style - runs a CSS/SASS/Styled Components code linter, with auto-fixing
  • lint - runs all lint commands synchronously or in parallel
  • lint:scripts - runs a JavaScript/TypeScript code linter
  • lint:style - runs a CSS/SASS/Styled Components code linter

Description

We have already been using a setup similar to this in most of our templates, for example the @pota/muban-template:

package.json

"scripts": {
  "fix": "run-s fix:* && npm run format",
  "fix:eslint": "npm run lint:eslint -- --fix",
  "lint": "run-s lint:*",
  "lint:eslint": "eslint . --ext .ts,.tsx --cache --cache-location node_modules/.cache/.eslintcache"
},

The fix and lint commands are implemented using npm-run-all, and fix:eslint is just running lint with an additional --fix argument for eslint.

scripts linting can be implemented using eslint and style linting can be implemented using stylelint.


See #39 for context