diff --git a/.eslintrc.changed.js b/.eslintrc.changed.js index c279c3e67a51..c13c6d474c86 100644 --- a/.eslintrc.changed.js +++ b/.eslintrc.changed.js @@ -6,5 +6,35 @@ module.exports = { }, rules: { 'deprecation/deprecation': 'error', + 'no-restricted-syntax': [ + 'error', + { + selector: "ImportNamespaceSpecifier[parent.source.value=/^@libs/]", + message: 'Namespace imports are not allowed. Use named imports instead. Example: import { method } from "@libs/module"' + }, + { + selector: "ImportNamespaceSpecifier[parent.source.value=/^@userActions/]", + message: 'Namespace imports from @userActions are not allowed. Use named imports instead. Example: import { action } from "@useractions/module"' + } + ] }, -}; + overrides: [ + { + files: ['**/libs/**/*.{ts,tsx,js,jsx}'], + rules: { + 'no-restricted-syntax': [ + 'error', + { + selector: "ImportNamespaceSpecifier[parent.source.value=/^\\.\\./]", + message: 'Namespace imports are not allowed. Use named imports instead. Example: import { method } from "../libs/module"' + }, + { + selector: "ImportNamespaceSpecifier[parent.source.value=/^\\./]", + message: 'Namespace imports are not allowed. Use named imports instead. Example: import { method } from "./libs/module"' + }, + + ] + } + } + ] +}; \ No newline at end of file