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 deemed no-longer fit for purporse or dangerous and risk effective use at scale.

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-next and @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: assistive and visuallyHidden.
      • 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-hidden instead..
{
    "@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.",
                    },
                },
            },
        ],
    },
};
Was this page helpful?
We use this feedback to improve our documentation.