forked from martijnversluis/ChordSheetJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
161 lines (155 loc) · 4.38 KB
/
Copy patheslint.config.mjs
File metadata and controls
161 lines (155 loc) · 4.38 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// @ts-check
import eslint from '@eslint/js';
import eslintPluginJest from 'eslint-plugin-jest';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import bestPractices from 'eslint-config-airbnb-base/rules/best-practices';
import errors from 'eslint-config-airbnb-base/rules/errors';
import es6 from 'eslint-config-airbnb-base/rules/es6';
import node from 'eslint-config-airbnb-base/rules/node';
import strict from 'eslint-config-airbnb-base/rules/strict';
import style from 'eslint-config-airbnb-base/rules/style';
import variables from 'eslint-config-airbnb-base/rules/variables';
const bestPracticesRules = bestPractices.rules;
const errorsRules = errors.rules;
const es6Rules = es6.rules;
const nodeRules = node.rules;
const strictRules = strict.rules;
const styleRules = style.rules;
const variablesRules = variables.rules;
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
{
languageOptions: {
globals: {
...globals.node,
...globals.browser, // Voeg browser globals toe zodat ESLint DOM types zoals HTMLElement en document herkent
},
},
rules: {
...bestPracticesRules,
...errorsRules,
...es6Rules,
...nodeRules,
...strictRules,
...styleRules,
...variablesRules,
'class-methods-use-this': 'off',
'complexity': ['error', 11],
'linebreak-style': ['error', (process.platform === 'win32' ? 'windows' : 'unix')],
'max-depth': ['error', 2],
'max-len': ['error', { code: 120, ignoreUrls: true }],
'max-lines': ['error', 730],
'max-lines-per-function': ['error', { max: 25, skipBlankLines: true, skipComments: true }],
'max-statements': ['error', 12],
'no-underscore-dangle': 'off',
'no-unused-vars': 'off',
'object-curly-spacing': ['error', 'always'],
'operator-linebreak': ['error', 'after'],
'quotes': ['error', 'single'],
'quote-props': ['error', 'consistent'],
'sort-imports': [
'error',
{
allowSeparatedGroups: true,
memberSyntaxSortOrder: [
'none',
'all',
'single',
'multiple',
],
}],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
{
files: ['playground/**/*.ts', 'test/formatter/pdf/pdf-dev.js'],
languageOptions: {
globals: {
...globals.browser,
CodeMirror: 'readonly',
},
},
rules: {
'no-console': 'off',
},
},
{
files: ['src/formatter/templates/*.ts'],
rules: {
'indent': 'off',
'max-lines-per-function': 'off',
'template-curly-spacing': ['error', 'always'],
},
},
{
files: ['script/**/*.ts'],
rules: {
'max-lines-per-function': 'off',
'no-console': 'off',
},
},
{
files: ['test/**/*.test.ts'],
...eslintPluginJest.configs['flat/recommended'],
rules: {
...eslintPluginJest.configs['flat/recommended'].rules,
'jest/no-disabled-tests': 'off',
'jest/no-standalone-expect': 'off',
'jest/prefer-expect-assertions': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-statements': 'off',
},
},
{
files: ['test/fixtures/**/*.ts'],
rules: {
'max-len': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
},
},
{
files: ['playground/fixtures/content/example-chordpro.ts'],
rules: {
'max-len': 'off',
},
},
{
files: ['playground/**/*.*', 'test/util/**/*.ts', '**/*.js', 'unibuild.ts'],
rules: {
'complexity': 'off',
'jest/no-export': 'off',
'max-depth': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-statements': 'off',
},
},
{
ignores: [
'dist/**/*',
'playground/dist/**/*',
'lib/**/*',
'src/formatter/pdf_formatter/fonts/**/*',
'src/normalize_mappings/suffix-normalize-mapping.ts',
'src/parser/*/peg_parser.ts',
'tmp/**/*',
'./**/*.{css,html,md,json}',
'**/.parcelrc',
],
},
);