forked from AdguardTeam/VscodeAdblockSyntax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
94 lines (91 loc) · 2.78 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
/**
* @file ESLint configuration based on Airbnb's with some modifications.
*/
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { join } = require('path');
const MAX_LINE_LENGTH = 120;
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'airbnb-base',
'airbnb-typescript/base',
'plugin:jsdoc/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: join(__dirname),
project: 'tsconfig.eslint.json',
},
plugins: ['import', '@typescript-eslint', 'import-newlines'],
rules: {
'max-len': [
'error',
{
code: MAX_LINE_LENGTH,
comments: MAX_LINE_LENGTH,
tabWidth: 4,
ignoreUrls: true,
ignoreTrailingComments: false,
ignoreComments: false,
},
],
'@typescript-eslint/indent': [
'error',
4,
{
SwitchCase: 1,
},
],
'jsdoc/multiline-blocks': ['error', { noSingleLineBlocks: true }],
'import/prefer-default-export': 'off',
'import-newlines/enforce': ['error', { items: 3, 'max-len': MAX_LINE_LENGTH }],
// Split external and internal imports with an empty line
'import/order': [
'error',
{
groups: [
['builtin', 'external'],
],
'newlines-between': 'always',
},
],
// We can disable this, because we bundle everything
'import/no-extraneous-dependencies': 'off',
'no-restricted-syntax': ['error', 'LabeledStatement', 'WithStatement'],
'no-continue': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off',
'jsdoc/tag-lines': [
'warn',
'any',
{
startLines: 1,
},
],
'jsdoc/check-tag-names': [
'warn',
{
// Define additional tags
// https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-tag-names.md#definedtags
definedTags: ['note'],
},
],
'arrow-body-style': 'off',
'no-await-in-loop': 'off',
// Force proper import and export of types
'@typescript-eslint/consistent-type-imports': [
'error',
{
fixStyle: 'inline-type-imports',
},
],
'@typescript-eslint/consistent-type-exports': [
'error',
{
fixMixedExportsWithInlineTypeSpecifier: true,
},
],
},
};