0.1.0 • Published 9 months ago

@vampire-rip/eslint-config v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

eslint config for vampire project(react-ts based on xo)

How to use

pnpm install -D @vampire-rip/eslint-config

then create .eslintrc at desired location with:

{
  "root": true,
  "extends": ["@vampire-rip"]
}

then create .prettierrc at desired location with:

{
  "$schema": "http://json.schemastore.org/prettierrc",
  "semi": true,
  "singleQuote": true,
  "arrowParens": "always",
  "trailingComma": "all",
  "tabWidth": 2,
  "useTabs": false,
  "printWidth": 120,
  "quoteProps": "as-needed",
  "jsxSingleQuote": false,
  "bracketSpacing": true,
  "endOfLine": "lf",
  "vueIndentScriptAndStyle": false
}

That's all.

FAQ

Overrides some existing rule

{
  "overrides": [
    {
      "files": ["**/*.{ts,tsx,mts,mtsx}"],
      // your rules here
      "rules": {}
    }
  ]
}

It complains about parserOptions.project has been set for ...

If add these files to tsconfig.json is not possible, create a new file tsconfig-eslint.json:

{
  "extends": "./tsconfig.json",
  // complaining files here:
  "include": [""]
}

change .eslintrc:

{
  "overrides": [
    {
      // complaining files here:
      "files": [""],
      "parserOptions": {
        "project": "./tsconfig-eslint.json"
      }
    }
  ]
}

Then it should be ok.