forked from tobiasdiez/nuxt-graphql-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
53 lines (53 loc) · 2.06 KB
/
.eslintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
"extends": [
// TODO: Enable once its working... currently it just hangs
//"@nuxtjs/eslint-config-typescript",
// Enable typescript-specific recommended rules
"plugin:@typescript-eslint/recommended",
// Turns off all rules that are unnecessary or might conflict with Prettier (needs to be last)
"prettier"
],
"plugins": ["unused-imports"],
"rules": {
// Workaround for bug https://github.com/nuxt/eslint-config/issues/147
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "error",
// Don"t report unused imports (this is handled by prettier)
"unused-imports/no-unused-imports": "off",
// Report unused variables (except the ones prefixed with an underscore)
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
// Ensure void operator is not used, except for variable assignment or function return (might be handy for promises)
"no-void": ["error", { "allowAsStatement": true }],
// Demote this to warning as long as we are still using cjs modules
// "import/named": "warn",
// Import order is handled by prettier (which is incompatible with this rule: https://github.com/simonhaenisch/prettier-plugin-organize-imports/issues/65)
"import/order": "off"
},
"overrides": [
{
"files": ["*.ts", "*.vue"],
// Parser supporting vue files
"parser": "vue-eslint-parser",
"parserOptions": {
// Use ts parser for ts files and for the script tag in vue files
"parser": "@typescript-eslint/parser",
// Path to tsconfig to enable rules that require type information
"project": "./tsconfig.eslint.json",
// Correctly handle vue files
"extraFileExtensions": [".vue"]
},
"extends": [
// Enable recommended rules for typescript that use typing information (may be CPU intensive)
"plugin:@typescript-eslint/recommended-requiring-type-checking"
]
}
]
}