-
Notifications
You must be signed in to change notification settings - Fork 43
/
.eslintrc.cjs
100 lines (96 loc) · 2.86 KB
/
.eslintrc.cjs
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
/** @type {import('eslint').Linter.Config & typeof import('@typescript-eslint/eslint-plugin')} */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'standard-with-typescript',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
'prettier'
],
parser: 'vue-eslint-parser',
ignorePatterns: ['.eslintrc.cjs', '*.d.ts'],
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 11,
sourceType: 'module'
},
env: {
browser: true,
es2020: true,
node: true
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': [1, { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'@typescript-eslint/consistent-type-imports': [
'warn',
{ prefer: 'type-imports' }
],
'@typescript-eslint/strict-boolean-expressions': 'off',
// LoFD uses them, which means our augments do too (for both namespaces and extending static methods)
'@typescript-eslint/no-namespace': 'off',
// silence complaints about not explicitly declaring global variables in every files
'no-undef': 'off',
// FIXME: part of standard-ts. not an awful idea, but it's not doable via autofix, so it's disabled for now
'@typescript-eslint/explicit-function-return-type': 'off'
// prefer lodash-es to regular lodash, and FVTT-provided utilities to lodash utilities
},
overrides: [
{
files: '*.ts',
rules: {
// restrict imports that duplicate libraries provided by FVTT at run-time
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'marked',
message: 'Please use CONFIG.IRONSWORN.showdown instead.'
},
{
name: 'lodash',
message: 'Please use lodash-es instead.'
},
{
name: 'lodash-es',
importNames: ['clamp'],
message: 'Please use FVTT Math.clamped instead.'
},
{
name: 'lodash-es',
importNames: ['capitalize'],
message: 'Please use FVTT String#capitalize instead.'
},
{
name: 'lodash-es',
importNames: ['range'],
message:
'Please use FVTT Array#fromRange instead, where possible. Note that Array#fromRange orders its parameters differently, and its maximum is inclusive rather than exclusive.'
}
]
}
]
}
},
{
files: ['*.ts', '*.js', '*.cjs'],
parserOptions: { project: './tsconfig.json' }
},
{
files: ['*.js', '*.cjs'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
// so it doesn't complain about imported jsdoc type annotations
'@typescript-eslint/consistent-type-imports': 'off'
}
}
]
}