-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
92 lines (90 loc) · 2.73 KB
/
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
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
const { resolve } = require('node:path');
const js = require('@eslint/js');
const comments = require('@eslint-community/eslint-plugin-eslint-comments/configs');
const eslintPluginYml = require('eslint-plugin-yml');
const simpleImportSort = require('eslint-plugin-simple-import-sort');
const pixPlugin = require('./index.js');
module.exports = [
js.configs.recommended,
...eslintPluginYml.configs['flat/standard'],
comments.recommended,
{
plugins: {
'@1024pix': pixPlugin,
'simple-import-sort': simpleImportSort,
},
rules: {
'arrow-parens': ['error', 'always'],
'comma-dangle': ['error', 'always-multiline'],
'computed-property-spacing': ['error', 'never'],
'eol-last': ['error'],
'@eslint-community/eslint-comments/no-unused-disable': ['error'],
indent: [
'error',
2,
{
SwitchCase: 1,
},
],
'keyword-spacing': ['error'],
'linebreak-style': ['error', 'unix'],
'no-multiple-empty-lines': [
'error',
{
max: 1,
maxEOF: 1,
},
],
'no-restricted-syntax': [
'error',
{
selector:
'NewExpression[callee.name=Date][arguments.length=1][arguments.0.type=Literal]:not([arguments.0.value=/^[12][0-9]{3}-(0[0-9]|1[0-2])-([0-2][0-9]|3[01])(T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]Z)?$/])',
message: "Use only ISO8601 UTC syntax ('2019-03-12T01:02:03Z') in Date constructor",
},
{
selector:
"CallExpression[callee.object.object.name='faker'][callee.object.property.name='internet'][callee.property.name='email']",
message: 'Use only faker.internet.exampleEmail()',
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '_',
},
],
'no-var': ['error'],
'object-curly-spacing': ['error', 'always'],
'prefer-const': ['error'],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'space-before-blocks': ['error'],
'space-before-function-paren': [
'error',
{
anonymous: 'never',
named: 'never',
asyncArrow: 'ignore',
},
],
'space-in-parens': ['error'],
'space-infix-ops': ['error'],
'func-call-spacing': ['error'],
'key-spacing': ['error'],
'comma-spacing': ['error'],
'no-trailing-spaces': ['error'],
'no-multi-spaces': ['error'],
'yml/quotes': [
'error',
{
prefer: 'single',
avoidEscape: true,
},
],
'@1024pix/no-sinon-stub-with-args-oneliner': 'error',
},
},
];