-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
71 lines (63 loc) · 1.9 KB
/
Copy patheslint.config.js
File metadata and controls
71 lines (63 loc) · 1.9 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
import fs from 'node:fs';
import process from 'node:process';
import globals from 'globals';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import js from '@eslint/js';
import pluginVue from 'eslint-plugin-vue';
import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
// parsers
import vueParser from 'vue-eslint-parser';
const autoImportRc = JSON.parse(fs.readFileSync('./apps/map-mapbox/.eslintrc-auto-import.json'));
export default [
js.configs.recommended,
...pluginVue.configs['flat/recommended'],
{
languageOptions: {
parser: vueParser,
parserOptions: {
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
...autoImportRc.globals,
},
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-use-before-define': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'vue/multi-word-component-names': 'off',
'prettier/prettier': ['error', { endOfLine: 'auto' }],
semi: 2,
},
},
{
files: ['**/*.ts'],
languageOptions: {
parser: tsparser,
sourceType: 'module',
},
plugins: {
'@typescript-eslint': tseslint,
},
ignores: ['.node_modules/*', 'vite-env.d.ts'],
rules: {
...tseslint.configs.recommended.rules,
...pluginPrettierRecommended.rules,
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-console': 'warn',
semi: ['error', 'always'],
quotes: ['error', 'double'],
'prettier/prettier': 'error',
},
},
pluginPrettierRecommended,
];