forked from HackYourFuture/Assignments
-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.js
48 lines (48 loc) · 1.33 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
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true,
jest: true,
},
plugins: ['no-autofix'],
extends: ['eslint:recommended'],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
'no-console': 'off',
'no-var': 'error',
'prefer-const': 'off',
'no-autofix/prefer-const': 'warn',
'new-cap': 'error',
'no-useless-computed-key': 'error',
eqeqeq: 'error',
'no-restricted-syntax': [
'warn',
{
selector:
"ExpressionStatement > CallExpression > MemberExpression > Identifier[name='map']",
message: 'Results from `map` are unused. Replace `map` with `forEach`.',
},
{
selector: "MemberExpression[property.name='innerText']",
message:
'The assignment tests do not support `innerText`. Please replace with `textContent`.',
},
{
selector: "MemberExpression[property.name='innerHTML']",
message:
'Please do not use `innerHTML` in the assignment. Use `textContent` and/or `document.createElement()` instead.',
},
{
selector: 'ForInStatement',
message: 'Avoid `for in` loops. Prefer `Object.keys()` instead.',
},
],
// 'hyf/use-map-result': 'error',
// 'hyf/camelcase': 'warn',
// 'hyf/no-commented-out-code': 'warn',
},
};