Skip to content

Commit 675c48a

Browse files
committed
Fix eslint config syntax error
1 parent a76f099 commit 675c48a

2 files changed

Lines changed: 23 additions & 30 deletions

File tree

eslint.config.ts

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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',

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"clean": "npx rimraf dist && npx rimraf .astro",
3333
"dev": "npm run sync && cross-env NODE_ENV=development npx astro dev",
3434
"format": "npm run format:json && npm run format:code && npm run format:style",
35-
"format:code": "npx prettier --write \"@types/**/*.{js,ts}\" \"scripts/**/*.{js,ts}\" \"src/**/*.{js,ts,tsx,astro}\" --plugin=prettier-plugin-astro",
35+
"format:code": "npx prettier --write \"@types/**/*.{js,ts}\" \"src/**/*.{js,ts,tsx,astro}\" --plugin=prettier-plugin-astro",
3636
"format:json": "npx prettier --write '**/*.json' --cache --ignore-path .gitignore",
3737
"format:style": "npx stylelint --fix \"src/**/*.{css,astro}\"",
3838
"lint": "npm run lint:json && npm run lint:style && npm run lint:code",
39-
"lint:code": "npx eslint \"@types/**/*.{js,ts}\" \"scripts/**/*.{js,ts}\" \"src/**/*.{js,ts,tsx,astro}\"",
39+
"lint:code": "npx eslint \"@types/**/*.{js,ts}\" \"src/**/*.{js,ts,tsx,astro}\"",
4040
"lint:json": "npx prettier --write '**/*.json' --cache --ignore-path .gitignore",
4141
"lint:style": "npx stylelint \"src/**/*.{css,astro}\"",
4242
"preview": "npx astro build && astro preview",

0 commit comments

Comments
 (0)