-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy patheslint.config.mjs
114 lines (111 loc) · 3.26 KB
/
eslint.config.mjs
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
108
109
110
111
112
113
114
/*
* Copyright (C) 2007-2025 Crafter Software Corporation. All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import prettier from 'eslint-plugin-prettier';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [{
ignores: [
'.git',
'**/*.ignore.*',
'**/build',
'**/node_modules',
'**/target',
'ui/models',
'ui/utils',
'ui/services',
'scripts/*',
'ui/app/public/*',
'ui/app/build',
'ui/app/build_tsc',
'ui/guest/build',
'ui/guest/build_tsc',
'static-assets/libs/ace/*',
'static-assets/components/cstudio-common/amplify-core.js',
'static-assets/components/cstudio-common/heatmap-support.js',
'static-assets/components/cstudio-preview-tools/mods/annotate',
'static-assets/components/cstudio-admin/mods/encrypt-tool.js',
'static-assets/components/cstudio-admin/mods/content-type-propsheet/contentTypes.js',
'static-assets/components/cstudio-admin/mods/content-type-propsheet/content-path-input.js',
'static-assets/components/cstudio-forms/controls/locale-selector.js',
'static-assets/components/cstudio-forms/data-sources/components.js',
'static-assets/libs/*',
'static-assets/js/*',
'static-assets/modules/*',
'static-assets/next/*',
'static-assets/scripts/craftercms-guest.umd.js',
'static-assets/scripts/craftercms-xb.umd.js',
'static-assets/scripts/preview-landing.umd.js',
'static-assets/yui/*',
'static-assets/jquery/*',
'ui/legacy/babel.config.js',
'ui/scss/scripts/*',
'ui/uppy/types/*',
'ui/uppy/lib/*',
'ui/uppy/lib/**',
'**/*.js',
'**/*.mjs',
'**/*.d.ts'
]
}, ...compat.extends('plugin:prettier/recommended').map((config) => ({
...config,
files: ['**/*.ts', '**/*.tsx']
})), {
files: ['**/*.ts', '**/*.tsx'],
plugins: {
prettier
},
languageOptions: {
globals: {
...globals.browser
},
ecmaVersion: 2015,
sourceType: 'script'
},
rules: {
'prettier/prettier': ['error'],
'spaced-comment': ['error', 'always', {
line: {
markers: ['/', '#']
},
block: {
markers: [
'!',
'*',
'#',
'function',
'const',
'if',
'export',
'interface',
'#__PURE__',
'@__PURE__'
],
exceptions: ['!', '*', '#'],
balanced: false
}
}]
}
}];