@@ -157,9 +157,7 @@ export default [
157157 'jsdoc/valid-types' : 'off' ,
158158 'new-cap' : [ level , { newIsCap : true , capIsNew : false } ] ,
159159 'no-new' : level ,
160- 'no-process-env' : [ level , , {
161- "message" : "Do not use process.env directly. See docs/ENVIRONMENT_VARIABLES."
162- } ] ,
160+ 'no-process-env' : level ,
163161 'no-restricted-globals' : [ 'error' ] . concat ( restrictedGlobals ) ,
164162 'no-restricted-imports' : [
165163 'error' , {
@@ -222,7 +220,6 @@ export default [
222220 {
223221 files : [
224222 /** Database files that use snake_case for database field names */
225- 'src/components/scripts/consent/db/__tests__/rls.spec.ts' ,
226223 'src/pages/api/gdpr/consent.ts' ,
227224 'src/pages/api/gdpr/request-data.ts' ,
228225 'src/pages/api/gdpr/verify.ts' ,
@@ -233,40 +230,36 @@ export default [
233230 } ,
234231 } ,
235232 {
236- /** Test files can import from server code in src/lib */
233+ /** Test files can import from server code in src/lib, but must use server-side helpers */
237234 files : [ 'src/**/__tests__/**/*' ] ,
238235 rules : {
239- 'import/no-restricted-paths' : 'off' ,
236+ 'import/no-restricted-paths' : [
237+ level ,
238+ {
239+ zones : [
240+ {
241+ target : 'src/**/__tests__/**/*' ,
242+ from : 'src/components/scripts/utils/environmentClient.ts' ,
243+ message : 'use src/lib/config/environmentServer.ts in test files, not environmentClient.' ,
244+ } ,
245+ {
246+ target : 'src/**/__tests__/**/*' ,
247+ from : 'src/components/scripts/utils/siteUrlClient.ts' ,
248+ message : 'use src/lib/config/siteUrlServer.ts in test files, not siteUrlClient.' ,
249+ } ,
250+ ] ,
251+ } ,
252+ ] ,
240253 } ,
241254 } ,
242255 {
243- /** Test files can import from server code in src/lib */
244- 'import/no-restricted-paths' : [
245- level ,
246- {
247- zones : [
248- {
249- target : 'src/**/__tests__/**/*' ,
250- from : 'src/components/scripts/utils/environmentClient.ts' ,
251- message : 'use src/lib/config/environmentServer.ts in test files, not environmentClient.' ,
252- } ,
253- {
254- target : 'src/**/__tests__/**/*' ,
255- from : 'src/components/scripts/utils/siteUrlClient.ts' ,
256- message : 'use src/lib/config/siteUrlServer.ts in test files, not siteUrlClient.' ,
257- } ,
258- ] ,
259- } ,
260- ] ,
261- } ,
262- {
263- /** These directories should can use process.env, which is forbidden in other files */
256+ /** These directories can use process.env, which is forbidden in other files */
264257 files : [
265258 '.eslintrc.js' ,
266259 'astro.config.ts' ,
267260 'playwright.config.ts' ,
268261 'vitest.setup.ts' ,
269- 'scripts/build /**/*'
262+ 'src/lib/config /**/*'
270263 ] ,
271264 rules : {
272265 'no-process-env' : 'off' ,
0 commit comments