-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy patheslint.config.js
61 lines (60 loc) · 1.93 KB
/
eslint.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
import eslint from '@eslint/js';
import prettier from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import lit from 'eslint-plugin-lit';
import wc from 'eslint-plugin-wc';
import ymlPlugin from 'eslint-plugin-yml';
import globals from 'globals';
import ts from 'typescript-eslint';
export default ts.config(
{
ignores: ['coverage/', 'docs/', 'demo/dist/', 'lib/', 'lit-redux-router.*'],
},
eslint.configs.all,
importPlugin.flatConfigs.recommended,
importPlugin.configs.typescript,
lit.configs['flat/recommended'],
wc.configs['flat/recommended'],
...ymlPlugin.configs['flat/recommended'],
...ymlPlugin.configs['flat/prettier'],
{
files: ['**/*.js', '**/*.ts'],
languageOptions: {
ecmaVersion: 'latest',
globals: { ...globals.node },
parserOptions: { project: 'tsconfig.json' },
sourceType: 'module',
},
rules: {
'import/no-unresolved': 'off',
'max-lines': ['error', { max: 133, skipBlankLines: true, skipComments: true }],
'max-lines-per-function': ['error', { max: 30, skipBlankLines: true, skipComments: true }],
'max-statements': ['error', { max: 35 }],
'no-ternary': 'off',
'one-var': 'off',
'sort-imports': 'off',
},
settings: { 'import/resolver': { typescript: {} } },
},
{
// eslint-disable-next-line import/no-named-as-default-member
extends: [...ts.configs.all],
files: ['**/*.ts'],
rules: {
'@typescript-eslint/class-methods-use-this': 'off',
// eslint-disable-next-line no-magic-numbers
'@typescript-eslint/no-magic-numbers': ['error', { ignore: [0, 1, 2] }],
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
},
},
{
files: ['**/*.test.*'],
rules: {
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
},
},
prettier,
);