Someone uses ESLint/TSLint for Pulumi? What are co...
# typescript
s
Someone uses ESLint/TSLint for Pulumi? What are configs you recommend?
b
I recommend using ESLint (TSLint is deprecated) and use the same config you use for all your other JS/TS code 🙂 probably with Prettier for formatting rules
n
+1 for prettier/eslint combo, using the
@typescript-eslint
plugin. if you are looking for something to get you started, this is our
.eslintrc.json
file
Copy code
{
  "parser": "@typescript-eslint/parser",
  "plugins": [
    "@typescript-eslint",
    "prettier"
  ],
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "prettier/@typescript-eslint",
    "plugin:prettier/recommended"
  ],
  "rules": {
    "@typescript-eslint/member-naming": [
      "error",
      {
        "private": "^__",
        "protected": "^_"
      }
    ],
    "@typescript-eslint/camelcase": [
      "error",
      {
        "properties": "never"
      }
    ],
    "camelcase": "off"
  },
  "env": {
    "node": true
  },
  "parserOptions": {
    "ecmaVersion": 2018,
    "sourceType": "module"
  }
}
and our prettierrc json
Copy code
{
  "$schema": "<http://json.schemastore.org/prettierrc>",
  "singleQuote": true,
  "trailingComma": "none",
  "endOfLine": "lf",
  "semi": false,
  "printWidth": 120
}
t
FWIW, we use tslint in Pulumi itself
a
I would consider moving away from it soon - Palantir has basically said it's no longer interested in maintaining it, so at some point it's going to block you from using new TypeScript features because TSLint won't parse
s
Thanks for all your input. @broad-helmet-79436 @nice-guitar-97142 @tall-librarian-49374 @ambitious-ram-5811
👍 1