-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.mjs
103 lines (101 loc) · 2.48 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
103
import 'eslint-plugin-only-warn';
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-plugin-prettier/recommended';
import * as unicorn from 'eslint-plugin-unicorn';
import perfectionist from 'eslint-plugin-perfectionist';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import wixEditor from 'eslint-plugin-wix-editor';
import { fixupPluginRules } from '@eslint/compat';
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigFile} */
export default [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
prettier,
{
ignores: [
'dist/',
'coverage/',
'@generated/**',
'*.config.[cm]js',
'.*rc.js',
],
languageOptions: {
globals: globals.node,
parserOptions: {
project: ['./tsconfig.json'],
warnOnUnsupportedTypeScriptVersion: false,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'max-lines': [1, { max: 300 }],
'max-params': [1, { max: 5 }],
'no-unneeded-ternary': [1],
},
},
{
plugins: {
'wix-editor': fixupPluginRules(wixEditor),
},
rules: {
'wix-editor/no-instanceof-array': 1,
'wix-editor/no-not-not': 1,
'wix-editor/no-unneeded-match': 1,
'wix-editor/prefer-filter': 1,
'wix-editor/prefer-ternary': 1,
'wix-editor/return-boolean': 1,
'wix-editor/simplify-boolean-expression': 1,
},
},
{
...unicorn.configs['flat/recommended'],
rules: {
'unicorn/prevent-abbreviations': [
'warn',
{
replacements: {
args: false,
},
},
],
},
},
{
plugins: {
perfectionist,
},
rules: {
'perfectionist/sort-objects': [
'warn',
{
type: 'natural',
order: 'asc',
},
],
},
},
{
plugins: {
'simple-import-sort': simpleImportSort,
},
rules: {
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
},
},
{
files: ['**/*.spec.ts', '**/*.e2e-spec.ts'],
rules: {
'consistent-return': 0,
'max-lines': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/camelcase': 0,
'import/max-dependencies': 0,
},
},
];