-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
153 lines (151 loc) · 4.55 KB
/
.eslintrc.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/**
* @file .eslintrc.js - ESLint configuration file, following Distributive's
* JS Style Guide.
*
* @author Wes Garland <[email protected]>
* @date Mar. 2022
*/
'use strict';
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
'env': {
'browser': true,
'commonjs': true,
'es2021': true,
'node': true
},
'extends': 'eslint:recommended',
'parserOptions': {
'ecmaVersion': 'latest',
'sourceType': 'script',
},
'plugins': [
'@distributive',
'@stylistic',
'jsdoc',
'unicorn',
],
'rules': {
'@distributive/brace-style': ['warn'],
'@stylistic/brace-style': ['off'],
'@stylistic/func-call-spacing': ['off'],
'@stylistic/indent': [
'warn',
2, {
SwitchCase: 1,
ignoredNodes: [
'CallExpression',
'ForStatement',
'ConditionalExpression',
'VariableDeclarator > ObjectPattern',
],
},
],
'@stylistic/linebreak-style': ['error', 'unix'],
'@stylistic/no-extra-semi': ['warn'],
'@stylistic/no-multi-spaces': ['off'],
'@stylistic/no-tabs': ['error'],
'@stylistic/no-trailing-spaces': [
'off', {
skipBlankLines: true,
ignoreComments: true,
},
],
'@stylistic/object-curly-spacing': ['warn', 'always'],
'@stylistic/quotes': ['warn', 'single'],
'@stylistic/semi': ['off'], /* does not work right with exports.X = function allmanStyle */
'@stylistic/semi-spacing': ['error', { 'before': false, 'after': true }],
'@stylistic/semi-style': ['warn', 'last'],
'jsdoc/require-file-overview': [
'warn', {
tags: {
file: {
initialCommentsOnly: true,
mustExist: true,
preventDuplicates: true,
},
author: {
mustExist: true,
},
date: {
mustExist: true,
preventDuplicates: true,
},
},
},
],
'jsdoc/require-jsdoc': [
'warn', {
publicOnly: true,
require: {
ArrowFunctionExpression: true,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true,
},
},
],
'jsdoc/require-description': [
'warn', {
exemptedBy: ['inheritdoc', 'type', 'typedef', 'params', 'returns'],
},
],
'unicorn/no-invalid-remove-event-listener': ['error'],
'no-prototype-builtins': 'off',
'no-unused-vars': ['warn', { 'vars': 'all', 'args': 'none', 'ignoreRestSiblings': false }],
'no-empty': [ 'warn' ],
'vars-on-top': [
'error',
],
'no-var': [
'off',
],
'spaced-comment': [
'warn',
],
'no-eval': [
'error',
],
'no-dupe-keys': [ 'warn' ],
'no-constant-condition': [ 'warn' ],
'no-extra-boolean-cast': [ 'warn' ],
'no-sparse-arrays': [ 'off' ],
'no-inner-declarations': [ 'off' ],
'no-loss-of-precision': [ 'warn' ],
'require-atomic-updates': [ 'warn' ], /* watch for false positives, remove if (m)any */
'eqeqeq': [ 'warn', 'always' ],
'no-dupe-class-members': [ 'warn' ],
'no-fallthrough': [ 'warn', { commentPattern: 'fall[ -]*through' }],
'no-invalid-this': [ 'error' ],
'no-return-await': [ 'warn' ],
'no-unused-expressions': [ 'warn', { allowShortCircuit: true, allowTernary: true } ],
'prefer-promise-reject-errors': [ 'error' ],
'no-throw-literal': [ 'error' ],
'symbol-description': [ 'error' ],
'new-cap': [ 'warn' ],
'consistent-this': [ 'error', 'that' ],
'no-use-before-define': [ 'error', { functions: false, classes: false } ],
'no-shadow': [ 'error' ],
'no-label-var': [ 'error' ],
'radix': [ 'error' ],
'no-self-compare': [ 'error' ],
'require-await': [ 'error'],
'require-yield': [ 'error' ],
'no-promise-executor-return': [ 'off' ],
'no-template-curly-in-string': [ 'warn' ],
'no-unmodified-loop-condition': [ 'warn' ],
'no-unused-private-class-members': [ 'warn' ],
'no-implicit-coercion': [1, {
disallowTemplateShorthand: false,
boolean: true,
number: true,
string: true,
allow: ['!!'] /* really only want to allow if(x) and if(!x) but not if(!!x) */
}],
'strict': [ 'error', 'safe' ],
},
};