-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
73 lines (71 loc) · 2.51 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
62
63
64
65
66
67
68
69
70
71
72
73
import js from '@eslint/js';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import importPlugin from 'eslint-plugin-import';
import prettierPlugin from 'eslint-plugin-prettier';
import globals from 'globals';
import prettierConfig from './prettier.config.js';
export default [
js.configs['recommended'],
{
plugins: {
import: importPlugin,
prettier: prettierPlugin,
},
languageOptions: { globals: { ...globals.browser } },
rules: {
'prettier/prettier': ['warn', prettierConfig],
eqeqeq: 'warn',
'guard-for-in': 'error',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/order': [
'warn',
{
'newlines-between': 'always',
groups: ['builtin', 'external', ['internal', 'parent'], 'sibling', 'index'],
pathGroups: [
{ pattern: '{uikit,uikit/**}', group: 'external', position: 'before' },
{ pattern: '~/**', group: 'internal' },
],
pathGroupsExcludedImportTypes: ['uikit'],
alphabetize: { order: 'asc', caseInsensitive: false },
},
],
'no-console': 'off',
'no-duplicate-imports': 'warn',
'no-multiple-empty-lines': ['warn', { max: 1 }],
'no-shadow': 'error',
'no-unused-vars': 'warn',
'no-use-before-define': ['error', 'nofunc'],
'no-var': 'error',
'object-shorthand': 'warn',
'one-var': ['warn', 'never'],
'prefer-const': 'warn',
'prefer-template': 'warn',
'sort-imports': ['warn', { ignoreDeclarationSort: true }],
'spaced-comment': ['warn', 'always', { markers: ['/'] }],
},
},
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parser: typescriptParser,
parserOptions: { project: './tsconfig.json' },
},
plugins: {
'@typescript-eslint': typescriptPlugin,
},
rules: {
...typescriptPlugin.configs['recommended-type-checked'].rules,
'@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }],
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/restrict-template-expressions': ['warn', { allowNever: true }],
},
},
{ ignores: ['dist/*'] },
];