@@ -74,6 +74,21 @@ export default ts.config(
7474 // some props are bindable
7575 'prefer-const' : [ 'error' , { destructuring : 'all' } ] ,
7676
77+ 'no-restricted-imports' : [ 'error' , {
78+ patterns : [
79+ // Don't use legacy svelte features
80+ { group : [ 'svelte/legacy' ] , message : 'Avoid legacy Svelte features' } ,
81+ // Prevent importing from test files -- it causes tests to be registered multiple times,
82+ // making pipelines slow
83+ {
84+ regex : '.*\\.test(.(t|j)s)?$' ,
85+ message : (
86+ 'Do not import from test files. This causes tests to be run repeatedly. Instead, '
87+ + 'move shared functionality to a separate non-test file.' ) ,
88+ } ,
89+ ]
90+ } ] ,
91+
7792 // @typescript -eslint rules
7893 // ========================
7994
@@ -103,11 +118,6 @@ export default ts.config(
103118 // This error is already picked up by TypeScript, and it's annoying to need to silence it
104119 // twice when it is incorrect
105120 '@typescript-eslint/no-unsafe-call' : 'off' ,
106- 'no-restricted-imports' : [ 'error' , {
107- paths : [
108- { name : 'svelte/legacy' , message : 'Avoid legacy Svelte features' } ,
109- ]
110- } ] ,
111121
112122 // Stylistic ESLint rules
113123 // ======================
0 commit comments