/
.eslintrc.js
58 lines (57 loc) · 1.46 KB
/
.eslintrc.js
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
54
55
56
57
58
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:vue/vue3-essential',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier',
'./.eslintrc-auto-import.json',
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
parser: {
'<template>': 'espree',
ts: '@typescript-eslint/parser',
js: '@typescript-eslint/parser',
},
tsconfigRootDir: __dirname,
project: ['./tsconfig.json', './tsconfig.config.json'],
extraFileExtensions: ['.vue'],
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
{
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
},
],
rules: {
'@typescript-eslint/no-unnecessary-condition': ['error'],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'vue/multi-word-component-names': 'warn',
'vue/no-parsing-error': 'warn', // enable template {{ }} using !
'prefer-const': 'error',
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
},
ignorePatterns: [
'dist',
'src/graphql/API.ts',
'.eslintrc.js',
'src/locales/*',
'tailwind.config.*',
'postcss.config.js',
],
}