-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy patheslint.config.mjs
100 lines (95 loc) · 2.73 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
import globals from 'globals';
import jsdoc from 'eslint-plugin-jsdoc';
import google from 'eslint-config-google';
import html from 'eslint-plugin-html';
google.name = 'Google';
/**
* eslint does not include jsdoc since v9, so needs to be added to the Google
* config manually now.
* @type {{jsdoc: any}}
*/
google.plugins = {
jsdoc,
};
/**
* eslint-config-google contains deprecated rules keys that were moved to
* the newer eslint-plugin-jsdoc.
*
* @see: https://eslint.org/docs/latest/use/migrate-to-9.0.0#remove-jsdoc-rules
*/
delete google.rules['require-jsdoc'];
google.rules['jsdoc/require-jsdoc'] = ['error', {
'require':{
FunctionDeclaration: true,
MethodDefinition: true,
ClassDeclaration: true,
},
}];
// The 'valid-jsdoc' rule got broken down into separate rules within the plugin.
// See: https://github.com/gajus/eslint-plugin-jsdoc/wiki/Comparison-with-deprecated-JSdoc-related-ESLint-rules
delete google.rules['valid-jsdoc'];
google.rules['jsdoc/require-param-description'] = 'off';
google.rules['jsdoc/require-returns-description'] = 'off';
google.rules['jsdoc/require-returns'] = 'error';
google.settings = {
jsdoc: {
tagNamePreference: {
'returns': 'return',
}
},
};
export default [
google,
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
globals: {
...globals.browser,
...globals.jquery,
...globals.node,
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly',
'ItemSheet': 'readonly',
'game': 'readonly',
'mergeObject': 'readonly',
'CONFIG': 'writable',
'duplicate': 'readonly',
'Tabs': 'readonly',
'Hooks': 'readonly',
'Items': 'readonly',
'loadTemplates': 'readonly',
'Combat': 'writable',
'canvas': 'readonly',
'ActorSheet': 'readonly',
'Actor': 'readonly',
'Actors': 'readonly',
'fetchSpell': 'readonly',
'TextEditor': 'readonly',
'ui': 'readonly'
},
},
plugins: {
html,
},
rules: {
'arrow-body-style': 'off',
'comma-dangle': 'off',
'linebreak-style': ['error', 'windows'],
'indent': ['error', 2],
'import/extensions': 'off',
'max-len': ['error', {'ignoreComments': true, 'ignoreStrings': true, 'ignoreTemplateLiterals': true}],
'no-async-promise-executor': 'off',
'no-await-in-loop': 'off',
'no-console': 'off',
'no-empty-function': 'off',
'jsdoc/require-jsdoc': 'off',
'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'],
'no-restricted-syntax': 'off',
'no-tabs': 'off',
'no-trailing-spaces': 'off',
'no-unused-vars': 'off',
'no-useless-constructor': 'off',
}
},
];