Skip to content

Commit

Permalink
fix: Restrict @adobe/spectrum imports (#2179)
Browse files Browse the repository at this point in the history
Closes #1908
  • Loading branch information
AkshatJawne authored Aug 6, 2024
1 parent 9aa19ef commit a257296
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module.exports = {
tsconfigRootDir: __dirname,
},
},
// For each @deephaven package, forbid importing from itself
...packageNames.map(packageName => ({
files: [`packages/${packageManifest.get(packageName)}/**/*.@(ts|tsx)`],
rules: {
Expand All @@ -24,8 +23,30 @@ module.exports = {
name: packageName,
message: 'Forbid importing from owning @deephaven package.',
},
{
name: '@adobe/react-spectrum',
message:
'Import from @deephaven/components instead of @adobe/react-spectrum.',
},
],
},
overrides: [
{
files: [
'packages/components/src/spectrum/**/*.@(ts|tsx)',
'packages/components/src/theme/**/*.@(ts|tsx)',
],
rules: {
'no-restricted-imports': [
'error',
{
name: packageName,
message: 'Forbid importing from owning @deephaven package.',
},
],
},
},
],
})),
],
};

0 comments on commit a257296

Please sign in to comment.