2.4.0 • Published 2 years ago

wttj-config-front v2.4.0

Weekly downloads
185
License
ISC
Repository
github
Last release
2 years ago

wttj-config-front

Install

yarn add --dev wttj-config-front

Eslint

// .eslintrc.js
module.exports = {
  extends: './node_modules/wttj-config-front/lib/eslint',
  // or if you want typescript configuration
  // extends: './node_modules/wttj-config-front/lib/eslint/eslintrc-typescript',
  // or if you want cypress configuration
  // extends: './node_modules/wttj-config-front/lib/eslint/eslintrc-cypress',
}

Prettier

// prettier.config.js
module.exports = require('wttj-config-front/lib/prettier')

Stylelint

// stylelint.config.js
module.exports = {
  extends: './node_modules/wttj-config-front/lib/stylelint',
}

Tsconfig

// tsconfig.json
{
  "extends": "wttj-config-front/lib/tsconfig/tsconfig.json",
  "compilerOptions": {
    "baseUrl": "src"
  },
  "include": ["src"]
}

Scripts

// package.json
{
  "scripts": {
    // ...
    "lint": "yarn lint:js && yarn lint:css && yarn lint:ts",
    "lint:js": "eslint src --max-warnings 0",
    "lint:css": "stylelint 'src/**/styles.ts' --allow-empty-input",
    "lint:ts": "tsc --noEmit"
  }
},

VSCode

Install eslint and prettier extensions

// your settings.json
{
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}