ESLint plugin
The essential plugin for use with the Atlassian Design System.no-deprecated-imports
Packages across the Atlassian Design System can be deprecated when they are no longer fit for purpose or when their use at scale poses a risk.
Examples
This rule will mark usage of deprecated modules as violations.
Incorrect
import Item from '@atlaskit/item';
^^^^^^^^^^^^^^
import GlobalNav from '@atlaskit/global-navigation';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^Options
The rule can take one option: deprecatedConfig, if not provided the rule will use an internal
config. If provided the rule will use the passed in config instead.
deprecatedConfig
The following fields can be defined in the config:
packagePath, which is the name of the package. For example:@atlaskit/navigation-nextand@atlaskit/navigation. With the package path as the key, you can either provide the values as:message(optional), the message to display when the deprecated packages path is used. For example:multi-select is deprecated. Please use '@atlaskit/select' instead.Or as:imports, which is an array of named imports to be deprecated. Each named import has the following fields:importName, which is the name of the import to be deprecated. For example:assistiveandvisuallyHidden.message(optional), which is the message to display when the deprecated import is used. For example:The assistive mixin is deprecated. Please use@atlaskit/visually-hiddeninstead..
{
"@atlaskit/navigation-next": {
"message": "navigation-next is deprecated. Please use '@atlaskit/atlassian-navigation' instead."
}
}import packageJson from './package.json';
module.exports = {
rules: {
'@atlaskit/design-system/no-deprecated-imports': [
'error',
{
deprecatedConfig: {
'@atlaskit/navigation-next': {
message:
"navigation-next is deprecated. Please use '@atlaskit/atlassian-navigation' instead.",
},
},
},
],
},
};