forked from gree/sf2synth.js
-
Notifications
You must be signed in to change notification settings - Fork 5
/
eslint.config.js
107 lines (105 loc) · 2.71 KB
/
eslint.config.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import globals from 'globals';
import eslintConfigPrettier from 'eslint-config-prettier';
import path from 'path';
import { fileURLToPath } from 'url';
import { FlatCompat } from '@eslint/eslintrc';
import pluginJs from '@eslint/js';
import pluginImport from 'eslint-plugin-import';
// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: pluginJs.configs.recommended,
});
export default [
{
ignores: [
'.vscode/',
'.yarn/',
'dist/',
'public/',
'docs/',
'src/**/*.generated.*',
'eslint.config.js',
],
},
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
...compat.extends('standard'),
{
languageOptions: {
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
plugins: {
import: pluginImport,
},
settings: {
// This will do the trick
'import/parsers': {
espree: ['.js', '.cjs', '.mjs', '.jsx'],
},
'import/resolver': {
node: true,
alias: {
map: [
['@', './src'],
['~', './node_modules'],
],
extensions: ['.js', '.jsx'],
},
},
vite: {
configPath: './vite.config.ts',
},
},
rules: {
camelcase: 'off',
'no-unused-vars': 'warn',
// Fix for Vue setup style
'import/default': 'off',
// Fix for Vue setup style
'import/no-default-export': 'off',
// Sort Import Order.
// see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/order.md#importorder-enforce-a-convention-in-module-import-order
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'parent',
'sibling',
'index',
'object',
'type',
],
pathGroups: [
// Vue Core
{
pattern:
'{vue,vue-router,vuex,@/stores,vue-i18n,pinia,vite,vitest,vitest/**,@vitejs/**,@vue/**}',
group: 'external',
position: 'before',
},
// Internal Codes
{
pattern: '{@/**}',
group: 'internal',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['builtin'],
alphabetize: {
order: 'asc',
},
'newlines-between': 'always',
},
],
},
},
// ...pluginVue.configs['flat/recommended'],
eslintConfigPrettier,
];