wttj-config

3.0.0 • Public • Published

wttj-config

Install

yarn add --dev wttj-config

Eslint

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

Prettier

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

Stylelint

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

Tsconfig

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

Translations

We've added a script to run as a lint task that ensures that the keys in translation files are sorted alphabetically.

Scripts

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

VSCode

Install eslint and prettier extensions

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

How to release

yarn release

Then release-it create a new github tag who activate circle ci release action.

/wttj-config/

    Package Sidebar

    Install

    npm i wttj-config

    Weekly Downloads

    201

    Version

    3.0.0

    License

    ISC

    Unpacked Size

    12.5 kB

    Total Files

    17

    Last publish

    Collaborators

    • pxceccaldi
    • calvein
    • anucreative
    • mesniltheo
    • mleralec
    • wttjfront