-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintrc.cjs
99 lines (81 loc) · 3.05 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
module.exports = {
// used for lint-checking JS
extends: 'airbnb-base',
root: true,
plugins: [
'compat',
'no-floating-promise',
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
env: {
browser: true,
},
globals: {
Deno: false,
},
ignorePatterns: [
'**/*.min.js',
'**/node_modules',
],
rules: {
'import/no-unresolved': 'off', // xxxx temporarily off since node eslint -v- deno npm:eslint
// have different broken behaviour in the latter for resolving local file `import`s
/*
// we use deno and `import from 'https://..' is fine
'import/no-unresolved': [2, {
ignore: [
'^https://deno.land/x/',
'^https://deno.land/std/fs/mod.ts$',
'^https://deno.land/std/http/cookie.ts$',
'^https://deno.land/std/http/file_server.ts$',
'^https://deno.land/std/http/server.ts$',
'^https://deno.land/std/io/mod.ts$',
'^https://deno.land/std/io/read_all.ts$',
'^https://deno.land/std/io/write_all.ts$',
'^https://deno.land/std/node/fs/promises.ts$',
'^https://deno.land/std/path/mod.ts$',
'^https://deno.land/std/testing/bdd.ts$',
'^https://esm.archive.org/',
],
}], */
// suuuuuuper userful
'no-floating-promise/no-floating-promise': 2,
// not particularly useful...
'no-await-in-loop': 'off',
// not particularly useful...
'no-return-await': 'off',
// allow `import .. from '.js'` (.js suffix) in JS files
'import/extensions': ['off'],
// this just showed up as necessary w/ `npm i` on Jun11, 2020
'no-multiple-empty-lines': [2, { max: 2 }],
// this just showed up w/ babel + eslint updates to latest versions Sep1,2019
'operator-linebreak': 'off',
'import/no-cycle': 'off', // it's ok to have cycles with ES Modules and import
// 'make sure all used JS compatible with 90%+ of currently used browsers a la caniuse.com'
'compat/compat': 'error',
// 'allow snakecase var names if dev desires'
camelcase: 'off',
// 'allow: x = 3 (for example lining up multiple lines by column)'
'no-multi-spaces': 'off',
// 'author discretion when using braces around one-liners or same-liners'
curly: 'off',
// 'allow ++ or -- at the end of a for() loop (all other uses are banned per airbnb!)'
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
// 'allow JSON/map definitions to column-align values when multiline'
'key-spacing': ['error', { mode: 'minimum' }],
// 'allow for (x of array) and for (key in obj) and for (val in array)'
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
'no-restricted-globals': ['off', 'location'],
'nonblock-statement-body-position': 'off',
indent: ['error', 2, {
CallExpression: { arguments: 'first' },
ArrayExpression: 'first',
FunctionDeclaration: { parameters: 'first' },
FunctionExpression: { body: 1, parameters: 2 },
}],
semi: ['error', 'never', { beforeStatementContinuationChars: 'always' }],
},
}