-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.js
65 lines (63 loc) · 1.94 KB
/
eslint.config.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
/* eslint-disable import/no-extraneous-dependencies */
import fs from 'smart-fs';
import { FlatCompat } from '@eslint/eslintrc';
import parser from '@babel/eslint-parser';
import blackfluxRulesPlugin from '@blackflux/eslint-plugin-rules';
const compat = new FlatCompat({
baseDirectory: fs.dirname(import.meta.url),
resolvePluginsRelativeTo: fs.dirname(import.meta.url)
});
export default [
...compat.extends(
'airbnb-base',
'plugin:mocha/recommended',
'plugin:markdown/recommended'
),
...compat.env({ es6: true, node: true, mocha: true }),
...compat.plugins('json', 'mocha'),
{
plugins: {
'@blackflux/rules': blackfluxRulesPlugin
},
languageOptions: {
parser,
parserOptions: { requireConfigFile: false }
},
rules: {
'@blackflux/rules/c8-prevent-ignore': 1,
'@blackflux/rules/kebab-case-enforce': 1,
'max-len': ['error', { code: 120 }],
'mocha/no-exclusive-tests': 'error',
'prefer-destructuring': ['error', { object: false, array: false }],
'comma-dangle': ['error', 'never'],
indent: ['error', 2, { SwitchCase: 1 }],
quotes: [2, 'single', { avoidEscape: true }],
'linebreak-style': [2, 'unix'],
semi: [2, 'always'],
'no-unused-vars': [
1,
{ vars: 'all', args: 'none', ignoreRestSiblings: true }
],
'no-var': [1],
'no-fallthrough': [1],
'spaced-comment': [
'error',
'always',
{
line: { exceptions: ['-', '+'], markers: ['=', '!'] },
block: {
exceptions: ['-', '+'],
markers: ['=', '!', ':', '::'],
balanced: true
}
}
],
'@blackflux/rules/prevent-typeof-object': 1,
'mocha/no-mocha-arrows': 0,
'mocha/no-hooks-for-single-case': 0,
'import/no-useless-path-segments': [2, { commonjs: true }],
'import/extensions': [2, 'always'],
'import/prefer-default-export': 0
}
}
];