Skip to content

Commit 83742b9

Browse files
authored
lint: disallow core/dist/ imports (#4907)
* lint: disallow core/dist/ imports Problem: Auto-complete sometimes imports from the dist folder of the core lib, if you are working in another subproject. Solution: lint rule
1 parent 24578d6 commit 83742b9

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

.eslintrc.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,23 @@ module.exports = {
153153
'aws-toolkits/no-only-in-tests': 'error',
154154
'aws-toolkits/no-await-on-vscode-msg': 'error',
155155

156-
// The following will place an error on the `fs-extra` import since we do not want it to be used for browser compatibility reasons.
157-
// "no-restricted-imports": [
158-
// "error",
159-
// {
160-
// "name": "fs-extra",
161-
// "message": "Avoid fs-extra, use FileSystemCommon. Notify the Toolkit team if your required functionality is not available."
162-
// }
163-
// ],
156+
'no-restricted-imports': [
157+
'error',
158+
{
159+
patterns: [
160+
{
161+
group: ['**/core/dist/*'],
162+
message:
163+
"Avoid importing from the core lib's dist/ folders; please use directly from the core lib defined exports.",
164+
},
165+
],
166+
},
167+
// The following will place an error on the `fs-extra` import since we do not want it to be used for browser compatibility reasons.
168+
// {
169+
// name: 'fs-extra',
170+
// message:
171+
// 'Avoid fs-extra, use FileSystemCommon. Notify the Toolkit team if your required functionality is not available.',
172+
// },
173+
],
164174
},
165175
}

0 commit comments

Comments
 (0)