eslint config for vampire project(react-ts based on xo)
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.
{
"overrides": [
{
"files": ["**/*.{ts,tsx,mts,mtsx}"],
// your rules here
"rules": {}
}
]
}
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.