-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
eslint.config.js
75 lines (73 loc) · 2.29 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
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
const nxEslintPlugin = require('@nx/eslint-plugin');
const eslintPluginRequireNodeImportPrefix = require('eslint-plugin-require-node-import-prefix');
const eslintPluginSimpleImportSort = require('eslint-plugin-simple-import-sort');
const eslintPluginImport = require('eslint-plugin-import');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});
module.exports = [
{
plugins: {
'@nx': nxEslintPlugin,
'require-node-import-prefix': eslintPluginRequireNodeImportPrefix,
'simple-import-sort': eslintPluginSimpleImportSort,
import: eslintPluginImport,
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: ['@windy'],
depConstraints: [
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*'],
},
],
},
],
'require-node-import-prefix/no-empty-import-prefix': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrors: 'none',
},
],
'no-extra-semi': 'error',
},
},
...compat
.config({
extends: ['plugin:@nx/typescript', 'plugin:wc/recommended', 'plugin:lit/recommended'],
})
.map((config) => ({
...config,
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.cts', '**/*.mts'],
rules: {
...config.rules,
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-extra-semi': 'error',
},
})),
{
ignores: ['**/.vite/', '**/.cache/', '**/node_modules/', '**/apps/fxc-tiles/src/assets/airspaces/'],
},
];