@tdcerhverv/linting-rules

2.0.0 • Public • Published

Linting rules

Linting setup to unify coding, without nitpicking prettier.

Features

  • Eslint
  • Stylelint
  • Prettier

Setup

First install the package as a dependency:

npm install --save-dev @tdcerhverv/linting-rules

To keep things simple, add the following configs to package.json:

  "eslintConfig": {
    "extends": "./node_modules/@tdcerhverv/linting-rules/eslint.js"
  },
  "prettier": "@tdcerhverv/linting-rules/prettier.js",
  "stylelint": {
    "extends": "./node_modules/@tdcerhverv/linting-rules/stylelint.js"
  },

It's also possible to create individual config files, but for simplicity and to avoid clutter, we recommend adding the config in the package.json file. See the individual packages for instructions if you need individual config files.

Config

You will probably need to customize the configuration for your needs, e.g. setting up files that eslint should ignore, here's an example:

  "eslintIgnore": [
    "/.cache",
    "/.vscode",
    "/dist",
    "/build",
    "/deploy",
    "/docker",
    "/coverage",
    "static",
    "Dockerfile",
    "package-lock.json",
    "*.scss.d.ts",
    "*.svg.d.ts",
    "*.module.scss.d.ts"
  ],

... or adding special rules for eslint:

  "eslintConfig": {
    "extends": "./node_modules/@tdcerhverv/linting-rules/eslint.js",
    "rules": {
      "react-hooks/rules-of-hooks": "error",
    }
  },

Prettier config

The shared prettier config has the following settings:

  "singleQuote": true,
  "trailingComma": "all",
  "tabWidth": 2

Package Sidebar

Install

npm i @tdcerhverv/linting-rules

Weekly Downloads

44

Version

2.0.0

License

MIT

Unpacked Size

4.02 kB

Total Files

6

Last publish

Collaborators

  • antongb
  • dev_jonas
  • jeppebenjaminsen
  • ahhah
  • abdok
  • mikkv
  • clausr1990
  • tdc-sigbe
  • mdige
  • nuudaybot
  • tdc-olila
  • jeroen.dk.nl
  • renand
  • stegr
  • m84100
  • m92212
  • m87979
  • vertic
  • rasladev
  • muddz
  • tajsonik
  • linnt
  • molg