-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy patheslint.config.js
More file actions
84 lines (80 loc) · 2.06 KB
/
eslint.config.js
File metadata and controls
84 lines (80 loc) · 2.06 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
72
73
74
75
76
77
78
79
80
81
82
83
84
import { defineConfig } from 'eslint/config'
import js from '@eslint/js'
import prettier from 'eslint-plugin-prettier'
import _import from 'eslint-plugin-import'
import { fixupPluginRules } from '@eslint/compat'
export default defineConfig([
// Ignore build and dependency folders
{
ignores: ['node_modules/**', 'lib/**']
},
// JavaScript linting
{
files: ['**/*.js'],
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
globals: {
// Browser and Node globals
document: 'readonly',
window: 'readonly',
console: 'readonly',
navigator: 'readonly',
Event: 'readonly',
HTMLElement: 'readonly',
setTimeout: 'readonly',
require: 'readonly',
__dirname: 'readonly',
global: 'readonly',
// Foundry globals
CONST: 'readonly',
CONFIG: 'readonly',
foundry: 'readonly',
game: 'readonly',
ui: 'readonly',
ChatMessage: 'readonly',
Hooks: 'readonly',
Handlebars: 'readonly',
fromUuidSync: 'readonly',
getDocumentClass: 'readonly',
Macro: 'readonly',
$: 'readonly',
FormApplication: 'readonly',
canvas: 'readonly',
Actor: 'readonly',
Item: 'readonly',
FormData: 'readonly',
// System globals
WOD5E: 'readonly',
jscolor: 'readonly',
JSColor: 'readonly',
SortingHelpers: 'readonly'
}
},
plugins: {
import: fixupPluginRules(_import),
prettier: fixupPluginRules(prettier)
},
rules: {
...js.configs.recommended.rules,
'no-extra-semi': 'error',
indent: 'off',
'prettier/prettier': [
'error',
{
semi: false,
tabWidth: 2,
useTabs: false
}
],
'import/extensions': ['error', 'always', { ignorePackages: true }],
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal'],
'newlines-between': 'always'
}
]
}
}
])