fastify / fastify-request-context

Request-scoped storage support, based on Asynchronous Local Storage (with fallback to cls-hooked)
MIT License
154 stars 15 forks source link

fix linting #168

Closed Uzlopak closed 1 year ago

Uzlopak commented 1 year ago

Checklist

Uzlopak commented 1 year ago

If it would me, I would just rip out prettier and eslint and just use standard. but then people would complain that typescript files are not linted. So I just do this minimal patch, to get the CI green.

@gurgunday index.js contains code. Is it wrong?

gurgunday commented 1 year ago

Yeah but I thought eslint was using standard for .js files

gurgunday commented 1 year ago

@Eomm I'm really proud of this config that uses standard for everything except formatting, which prettier takes care of 😁

{
  "root": true,
  "extends": ["standard", "prettier"],
  "plugins": ["github", "prettier"],
  "rules": {
    "no-restricted-syntax": [
      "error",
      "MethodDefinition[kind='get']",
      "MethodDefinition[kind='set']",
      "VariableDeclaration[kind='var']",
      "WithStatement"
    ],
    "github/array-foreach": "error",
    "class-methods-use-this": "error",
    "prefer-const": "error",
    "prefer-destructuring": "error",
    "prefer-exponentiation-operator": "error",
    "prefer-named-capture-group": "error",
    "prefer-numeric-literals": "error",
    "prefer-object-has-own": "error",
    "prefer-object-spread": "error",
    "prefer-promise-reject-errors": "error",
    "prefer-regex-literals": "error",
    "prefer-rest-params": "error",
    "prefer-spread": "error",
    "prefer-template": "error",
    "prettier/prettier": "error",
    "arrow-body-style": "error",
    "curly": ["error", "all"],
    "quotes": ["error", "double", { "avoidEscape": true }]
  }
}
Fdawgs commented 1 year ago

I'm really proud of this config that uses standard for everything except formatting, which prettier takes care of 😁

https://github.com/prettier/eslint-config-prettier ?

Eomm commented 1 year ago

Here is my setup standard + typescript:

"lint:typescript": "standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin *.ts test/**/*.ts",