'How to trigger warning with eslint for @deprecated in vue.js / typescript project

I use a library of components of my own in some projects, and as I'm refactoring this library, I want to add some @deprecated Jsdoc comment on the deprecated components in the library to get some EsLint warning if I use these components in my projects.

[Edit - I found how to configure eslint-plugin-deprecation]

I found this EsLint plugin : https://www.npmjs.com/package/eslint-plugin-deprecation, and it works for methods in <script> section, but not for components (but my IDE can tell me that the component is deprecated) and not in <template> section (my IDE can not tell me either)

Here's my actual Eslint config :

module.exports = {
  env: {
    browser: true,
    es2020: true,
  },
  extends: [
    '@vue/typescript',
    'eslint:recommended',
    'plugin:vue/vue3-recommended',
    'airbnb-base',
  ],
  parser: 'vue-eslint-parser',
  parserOptions: {
    ecmaVersion: 11,
    sourceType: 'module',
    parser: {
      js: 'vue-eslint-parser',
      ts: '@typescript-eslint/parser',
      '<template>': '@typescript-eslint/parser', // don't know if it's suppose to work
    },
    project: './tsconfig.json',
    createDefaultProgram: true,
  },
  plugins: [
    'vue',
    'deprecation',
  ],
  rules: {
    'deprecation/deprecation': 1,
    // ...
  },
  settings: {
    'import/resolver': {
      alias: {
        map: [
          ['@', './assets/front/vue'],
          ['@Img', './assets/front/img'],
          ['@Style', './assets/front/scss'],
        ],
        extensions: ['.js', '.ts', '.vue'],
      },
    },
  },
};

Any idea how to achieve this, with eslint-plugin-deprecation or any other solution?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source