JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29
  • Score
    100M100P100Q19782F
  • License MIT

"ESlint & Prettier Config by heyitsbash"

Package Exports

  • eslint-config-heyitsbash

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-heyitsbash) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Heyitsbash config for EZ linting

Local Install

  1. In your project folder type npm init , and
  2. npx install-peerdeps --dev eslint-config-heyitsbash
  3. Create .eslintrc.js file in the root of your projects folder
  4. Copy this in .eslintrc.js
module.exports = {
  'extends': [
    'heyitsbash',
  ]
};

Add these scripts in package.json

"scripts": {
  "lint": "eslint .",
  "lint:fix": "eslint . --fix"
},

Lint/pretty your code by running npm run lint and npm run lint:fix in the console

Now linting for commit also available

  1. Run npm install husky --save-dev to make sure husky is installed properly
  2. Create commitlint.config.js file in the root of your projects folder
  3. Paste that in commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional'],
  rules: {
    'subject-min-length': [2, 'always', 10],
  }
};

Add these lines in package.json

"husky": {
  "hooks": {
    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
    "pre-commit": "npm run lint:fix && git add ."
  }
}

Now all your commits will first be checked by linter rules and then with conventional commit rules, if any of these fail - changes will not get commited.

Be aware that this line in husky hook git add . will always stage all files, if you not commiting all your files at once, you should remove it.

Commit example:

  1. git commit -m "random commit bla bla bla" - this line will fail by conventional commit rules.
  2. git commit -m "chore: test commit with new modules" - this line will pass by conventional commit rules.