-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy patheslint.config.js
More file actions
178 lines (177 loc) · 5.41 KB
/
Copy patheslint.config.js
File metadata and controls
178 lines (177 loc) · 5.41 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
import js from '@eslint/js';
import eslintPluginVue from 'eslint-plugin-vue';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from 'globals';
export default tseslint.config(
{
ignores: [
'src/io/itk-dicom/emscripten-build/**',
'src/io/resample/emscripten-build/**',
'**/*.d.ts',
'dist/**',
'node_modules/**',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
...eslintPluginVue.configs['flat/essential'],
{
files: ['**/*.{js,ts,vue}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
globalThis: 'readonly',
},
parserOptions: {
parser: tseslint.parser,
},
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-plusplus': 'off',
'no-underscore-dangle': 'off',
'lines-between-class-members': [
'error',
'always',
{ exceptAfterSingleLine: true },
],
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'error',
'vue/multi-word-component-names': ['error', { ignores: ['Settings'] }],
'prefer-destructuring': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-wrapper-object-types': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
},
},
{
files: ['**/tests/pageobjects/**/*.ts'],
rules: {
'class-methods-use-this': 'off',
},
},
{
files: ['**/__tests__/*.{js,ts}', '**/tests/unit/**/*.spec.{js,ts}'],
languageOptions: {
globals: globals.mocha,
},
rules: {
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
files: ['src/vtk/**/*.{js,ts}'],
rules: {
'no-param-reassign': [
'error',
{
props: true,
ignorePropertyModificationsFor: [
'publicAPI',
'model',
'state',
'outData',
],
},
],
},
},
// ---------------------------------------------------------------------------
// Processing feature layering boundaries.
//
// Enforced with the built-in `no-restricted-imports` — eslint-plugin-import is
// not a dependency of this repo, and the built-in rule expresses the same
// zones with no new dependency. Two rules:
// 1. Code OUTSIDE `src/processing/` may reach the feature ONLY through its
// public surface `@/src/processing` (the index), never a deep path.
// 2. The feature's pure layer (`engine/**`, `types.ts`, `config.ts`) may not
// import stores, components, or the upper feature modules, and stays
// framework-free (no pinia, no vue) — dependencies point downward only.
// ---------------------------------------------------------------------------
{
files: ['src/**/*.{js,ts,vue}'],
ignores: ['src/processing/**'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
{
group: [
'@/src/processing/*',
'@/src/processing/*/**',
'!@/src/processing/index',
],
message:
'Import the processing feature only from its public surface `@/src/processing` (src/processing/index.ts). A deep import bypasses the feature boundary.',
},
],
},
],
},
},
{
files: [
'src/processing/engine/**/*.{js,ts}',
'src/processing/types.ts',
'src/processing/config.ts',
],
ignores: ['**/__tests__/**'],
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'pinia',
message:
'The processing pure layer (engine/types/config) must stay framework-free — no pinia.',
},
{
name: 'vue',
message:
'The processing pure layer (engine/types/config) must stay framework-free — no vue.',
},
],
patterns: [
{
group: [
'@/src/processing/store',
'@/src/processing/applyResults',
'@/src/processing/jobResultReview',
'@/src/processing/index',
'@/src/processing/components/**',
'@/src/store/**',
'@/src/components/**',
'./store',
'./applyResults',
'./jobResultReview',
'./index',
'../store',
'../applyResults',
'../jobResultReview',
'../index',
'../components/**',
],
message:
'The processing pure layer (engine/types/config) must not import stores, components, or upper feature modules — dependencies point downward only.',
},
],
},
],
},
},
eslintConfigPrettier
);