Skip to content

Commit 865c19b

Browse files
committed
Forbid default import from "typescript"
1 parent 52e160a commit 865c19b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.eslintrc.cjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ module.exports = {
152152
{ argsIgnorePattern: "^_", caughtErrors: "all" },
153153
],
154154

155+
"no-restricted-syntax": [
156+
"error",
157+
// Forbid default import from "typescript"
158+
{
159+
message: 'Default import from "typescript" is not allowed.',
160+
selector:
161+
'ImportDeclaration[source.value="typescript"] > ImportDefaultSpecifier',
162+
},
163+
],
164+
155165
// These on-by-default rules don't work well for this repo and we like them off.
156166
"n/no-missing-import": "off",
157167
"no-case-declarations": "off",

0 commit comments

Comments
 (0)