Forbid direct @bytelyst/ui imports outside the Primitives adapter via no-restricted-imports, with the adapter file exempted. No pre-existing violations; a probe confirms the rule fires. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
57 lines
1.6 KiB
JavaScript
57 lines
1.6 KiB
JavaScript
import { defineConfig, globalIgnores } from 'eslint/config';
|
|
import nextVitals from 'eslint-config-next/core-web-vitals';
|
|
import nextTs from 'eslint-config-next/typescript';
|
|
|
|
const eslintConfig = defineConfig([
|
|
...nextVitals,
|
|
...nextTs,
|
|
{
|
|
rules: {
|
|
'react-hooks/set-state-in-effect': 'off',
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'warn',
|
|
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' },
|
|
],
|
|
// CC.6 UI-drift ratchet: all @bytelyst/ui usage must go through the
|
|
// Primitives adapter so future UI stays consistent and centrally swappable.
|
|
'no-restricted-imports': [
|
|
'error',
|
|
{
|
|
paths: [
|
|
{
|
|
name: '@bytelyst/ui',
|
|
message:
|
|
'Import @bytelyst/ui components via the adapter: src/components/ui/Primitives.tsx (UI-drift ratchet, CC.6).',
|
|
},
|
|
],
|
|
patterns: [
|
|
{
|
|
group: ['@bytelyst/ui/*'],
|
|
message:
|
|
'Import @bytelyst/ui components via the adapter: src/components/ui/Primitives.tsx (UI-drift ratchet, CC.6).',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
// The adapter itself is the single sanctioned place to import @bytelyst/ui.
|
|
files: ['src/components/ui/Primitives.tsx'],
|
|
rules: {
|
|
'no-restricted-imports': 'off',
|
|
},
|
|
},
|
|
globalIgnores([
|
|
'.next/**',
|
|
'out/**',
|
|
'build/**',
|
|
'coverage/**',
|
|
'test-results/**',
|
|
'playwright-report/**',
|
|
'next-env.d.ts',
|
|
]),
|
|
]);
|
|
|
|
export default eslintConfig;
|