Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions .github/dependabot.yml

This file was deleted.

171 changes: 38 additions & 133 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url'
import type { Linter } from 'eslint'
import eslint from '@eslint/js'
import astroPlugin from 'eslint-plugin-astro'
import importPlugin from 'eslint-plugin-import'
import importLitePlugin from 'eslint-plugin-import-lite'
import jsdocPlugin from 'eslint-plugin-jsdoc'
import securityPlugin from 'eslint-plugin-security'
import ymlPlugin from 'eslint-plugin-yml'
Expand All @@ -23,8 +23,7 @@ export default [
eslint.configs.recommended,
...tsPlugin.configs.recommended,
...astroPlugin.configs.recommended,
...astroPlugin.configs['jsx-a11y-strict'],
importPlugin.flatConfigs.recommended,
importLitePlugin.configs.recommended,
jsdocPlugin.configs['flat/recommended-typescript'],
securityPlugin.configs.recommended,
...ymlPlugin.configs['flat/recommended'],
Expand All @@ -38,15 +37,6 @@ export default [
},
},
},
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: './tsconfig.json',
extensions: ['.ts', '.tsx', '.astro', '.d.ts', '.js', '.mjs', '.cjs'],
},
},
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
Expand Down Expand Up @@ -93,33 +83,7 @@ export default [
'arrow-body-style': 'off',
'camelcase': [level],
'curly': 'off',
'import/no-unresolved': [
level,
{
ignore: [
'^astro:.*', // Ignore Astro virtual modules
'^virtual:pwa-register$',
'^\\./.*', // Ignore relative imports (let TypeScript handle these)
],
},
],
'import/no-webpack-loader-syntax': level,
'import/extensions': [
level,
'ignorePackages', // Ignores extensions for packages
{
'js': 'never',
'jsx': 'always',
'ts': 'never',
'tsx': 'always',
'mjs': 'always',
'cjs': 'always',
'astro': 'always',
'json': 'always',
'svg': 'always',
},
],
'import/order': 'off',
'import-lite/no-duplicates': level,
'jsdoc/check-indentation': level,
'jsdoc/check-line-alignment': 'off',
'jsdoc/check-param-names': 'off',
Expand Down Expand Up @@ -165,19 +129,6 @@ export default [
'semi': ['error', 'never'],
},
},
{
files: ['**/*.astro'],
rules: {
'import/extensions': 'off',
},
},
{
files: ['**/*.astro/*.js', '**/*.astro/*.ts', '**/*.astro/*.tsx'],
rules: {
'import/extensions': 'off',
},
},

/**
* =================================================================================================
*
Expand Down Expand Up @@ -587,128 +538,90 @@ export default [
*/
{
files: [
'**/*.astro',
'**/*.ts',
'**/*.tsx',
'src/**/client/**/*.{astro,ts,tsx}',
],
ignores: [
'src/pages/api/_environment/environmentApi.ts',
'src/pages/api/_logger/index.ts',
],
rules: {
'import/no-restricted-paths': [
'no-restricted-imports': [
level,
{
zones: [
patterns: [
{
target: 'src/**/client/**/*',
from: 'src/lib/**/*',
group: ['src/lib/**/*', '@lib/**/*'],
message: 'The src/lib directory is for build-time code only.',
},
],
},
],
},
},
{
files: [
'**/*.astro',
'**/*.ts',
'**/*.tsx',
],
rules: {
'import/no-restricted-paths': [
'off',
{
zones: [
{
target: 'src/**/server/**/*',
from: 'src/lib/**/*',
},
],
},
],
},
},
/**
* Restrict the client directory in components, layouts, and pages to importing only from src/lib
*/
{
files: [
'**/*.astro',
'**/*.ts',
'**/*.tsx',
'src/**/server/**/*.{astro,ts,tsx}',
],
ignores: [
'src/pages/api/_environment/environmentApi.ts',
'src/pages/api/_logger/index.ts',
],
rules: {
'import/no-restricted-paths': [
'no-restricted-imports': [
level,
{
zones: [
patterns: [
{
target: 'src/**/server/**/*',
from: 'src/components/scripts/**/*',
group: [
'src/components/scripts/**/*',
'@components/scripts/**/*',
],
message: 'The src/components/scripts directory is for client bundle code only.',
},
],
},
],
},
},
{
files: [
'**/*.astro',
'**/*.ts',
'**/*.tsx',
],
rules: {
'import/no-restricted-paths': [
'off',
{
zones: [
{
target: 'src/**/client/**/*',
from: 'src/components/scripts/**/*',
},
],
},
],
},
},
/**
* Test files can import from server code in src/lib, but must use server-side helpers
*/
{
files: [
'src/**/__tests__/**/*'
],
ignores: [
'src/components/scripts/utils/__tests__/siteUrlClient.spec.ts',
],
rules: {
'import/no-restricted-paths': [
'no-restricted-imports': [
level,
{
zones: [
paths: [
{
name: 'src/components/scripts/utils/environmentClient.ts',
message: 'use src/lib/config/environmentServer.ts in test files, not environmentClient.',
},
{
target: 'src/**/__tests__/**/*',
from: 'src/components/scripts/utils/environmentClient.ts',
name: '@components/scripts/utils/environmentClient',
message: 'use src/lib/config/environmentServer.ts in test files, not environmentClient.',
},
{
target: 'src/**/__tests__/**/*',
from: 'src/components/scripts/utils/siteUrlClient.ts',
name: 'src/components/scripts/utils/siteUrlClient.ts',
message: 'use src/lib/config/siteUrlServer.ts in test files, not siteUrlClient.',
},
{
name: '@components/scripts/utils/siteUrlClient',
message: 'use src/lib/config/siteUrlServer.ts in test files, not siteUrlClient.',
},
],
},
],
},
},
{
files: [
/** Test case for the utility is an exception to the restricted paths rule */
'src/components/scripts/utils/__tests__/siteUrlClient.spec.ts',
/** Environment file in src/pages/api is an exception to the restricted paths rule */
'src/pages/api/_environment/environmentApi.ts',
'src/pages/api/_logger/index.ts',
],
rules: {
'import/no-restricted-paths': 'off',
},
},

/**
* =================================================================================================
Expand Down Expand Up @@ -903,14 +816,6 @@ export default [
'test/e2e/specs/14-system/package-release.spec.ts',
'test/e2e/specs/14-system/privacy-policy-version.spec.ts',
],
rules: {
'import/extensions': 'off',
},
},
{
files: ['**/*.astro'],
rules: {
'import/extensions': 'off',
},
rules: {},
},
]
Loading
Loading