Skip to content

Instantly share code, notes, and snippets.

@shubich
Last active October 27, 2020 15:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubich/ee8ff287037783981e6511531d001163 to your computer and use it in GitHub Desktop.
Save shubich/ee8ff287037783981e6511531d001163 to your computer and use it in GitHub Desktop.
#tslint #prettier #indent #jsxindent #tsxindent

tslint-config-prettier helps

List of tslint dev-dependencies:

  "tslint": "^5.12.1",
  "tslint-config-airbnb": "^5.11.1",
  "tslint-plugin-prettier": "^2.0.1",
  "tslint-react": "^3.6.0",

tslint.json:

{
  "defaultSeverity": "error",
  "extends": [
    "tslint-config-airbnb",
    "tslint-react",
    "tslint-plugin-prettier"
  ],
  "jsRules": {},
  "rules": {
    "prettier": [
      true,
      {
        "singleQuote": true,
        "trailingComma": "all"
      }]
  },
  "rulesDirectory": []
}

Note that some default rules of prettier may conflict with extended. You will need to reassign them inside of prettier config to avoid permanent errors.

Result: image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment