-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
80 lines (77 loc) · 2.16 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
74
75
76
77
78
79
80
/* eslint-disable import-x/no-unresolved */
// @ts-check
import 'tsx';
import eslint from '@eslint/js';
import globals from 'globals';
import { config, configs as tseslint } from 'typescript-eslint';
import { configs as angulareslint, processInlineTemplates } from 'angular-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginImportX from 'eslint-plugin-import-x';
const eslintPluginLyne = await import('./tools/eslint/index.ts');
const ignores = [
'dist/**/*',
'coverage/**/*',
'tools/generate-component/**/*',
'**/__snapshots__/**/*',
];
export default config(
{
languageOptions: {
globals: { ...globals.browser, ...globals.node },
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
},
},
{ ignores },
{
files: ['**/*.ts', '**/*.js'],
...eslintPluginImportX.flatConfigs.recommended,
},
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.recommended,
...tseslint.stylistic,
...angulareslint.tsRecommended,
],
processor: processInlineTemplates,
rules: {
'@angular-eslint/no-input-rename': 'off',
'@angular-eslint/directive-class-suffix': 'off',
'@angular-eslint/directive-selector': 'off',
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'sbb',
style: 'kebab-case',
},
],
'import-x/first': 'error',
'import-x/named': 'off',
'import-x/no-absolute-path': 'error',
'import-x/no-cycle': 'error',
'import-x/no-self-import': 'error',
'import-x/no-unresolved': 'off',
'import-x/no-useless-path-segments': 'error',
'import-x/order': [
'error',
{
alphabetize: { order: 'asc', caseInsensitive: true },
'newlines-between': 'always',
},
],
},
},
{
files: ['**/*.html'],
extends: [...angulareslint.templateRecommended, ...angulareslint.templateAccessibility],
rules: {},
},
// @ts-expect-error The returned config will exist.
eslintPluginLyne.default.configs.recommended,
eslintConfigPrettier,
);