module.exports = {
  rules: {
    'no-restricted-globals': [
      'error',
      {
        name: 'localStorage',
        message:
          '\n已禁止直接使用 localStorage' +
          '\n请从产品目录的 services/storage-service 导入 (xx)LocalStorage\n',
      },
      {
        name: 'sessionStorage',
        message:
          '\n已禁止直接使用 sessionStorage' +
          '\n请从产品目录的 services/storage-service 导入 (xx)SessionStorage\n',
      },
    ],
    'no-restricted-imports': [
      'warn',
      {
        paths: [
          {
            name: '@/common/services/storage-service',
            importNames: ['sdLocalStorage', 'sdSessionStorage'],
            message: '\n产品代码请使用自己的LocalStorage、SessionStorage实例\n',
          },
          {
            name: 'axios',
            message: '\n已禁止直接导入axios\n请从 @/common/services/axios-instance 导入\n',
          },
        ],
      },
    ],
    'filenames/match-regex': [2, '^(?!sd-)[a-z0-9-]+$', false],
  },
}
