forked from martijnversluis/ChordSheetJS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
102 lines (96 loc) · 2.77 KB
/
eslint.config.mjs
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
// @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,
},
},
rules: {
...bestPracticesRules,
...errorsRules,
...es6Rules,
...nodeRules,
...strictRules,
...styleRules,
...variablesRules,
'class-methods-use-this': 'off',
'linebreak-style': ['error', (process.platform === 'win32' ? 'windows' : 'unix')],
'max-len': ['error', { code: 120, ignoreUrls: true }],
'no-underscore-dangle': 'off',
'no-unused-vars': 'off',
'object-curly-spacing': ['error', 'always'],
'operator-linebreak': ['error', 'after'],
'quotes': ['error', 'single'],
'quote-props': ['error', 'consistent'],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
},
},
{
files: ['src/formatter/templates/*.ts'],
rules: {
'indent': 'off',
'template-curly-spacing': ['error', 'always'],
},
},
{
files: ['script/**/*.ts'],
rules: {
'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',
},
},
{
files: ['test/utilities.ts'],
rules: {
'jest/no-export': 'off',
},
},
{
ignores: [
'lib/**/*',
'src/normalize_mappings/suffix-normalize-mapping.ts',
'src/parser/*/peg_parser.ts',
],
},
);