eslint-plugin-vue-hook-optimizer
v0.0.65
Published
vue-hook-optimizer eslint plugin
Downloads
5
Readme
For more information, please visit vue-hook-optimizer.
Install
pnpm add eslint vue-eslint-parser @typescript-eslint/parser eslint-plugin-vue-hook-optimizer --save-dev
Usage
legacy config
// .eslintrc.js
/** @type {import('eslint').Linter.Config} */
module.exports = {
parser: 'vue-eslint-parser',
parserOptions: {
parser: {
'js': '@typescript-eslint/parser',
'<template>': 'espree',
},
},
plugins: ['vue-hook-optimizer'],
rules: {
'vue-hook-optimizer/not-used': ['warn', {
framework: 'vue',
}],
'vue-hook-optimizer/loop-call': ['warn', {
framework: 'vue',
}],
'vue-hook-optimizer/linear-path': ['warn', {
framework: 'vue',
}],
},
};
flat config
// eslint.config.js
import vueParse from 'vue-eslint-parser';
import pluginTs from '@typescript-eslint/parser';
import pluginVueHookOptimizer from 'eslint-plugin-vue-hook-optimizer';
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
{
files: ['**/*.vue'],
languageOptions: {
parser: vueParse,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
extraFileExtensions: ['.vue'],
parser: pluginTs,
sourceType: 'module',
},
},
},
{
plugins: {
'vue-hook-optimizer': pluginVueHookOptimizer,
},
rules: {
'vue-hook-optimizer/not-used': ['warn', {
framework: 'vue',
}],
'vue-hook-optimizer/loop-call': ['warn', {
framework: 'vue',
}],
'vue-hook-optimizer/linear-path': ['warn', {
framework: 'vue',
}],
},
},
];
Configuration
All rules are disabled by default. You can enable them by adding them to your eslint configuration. And all rules support the following options:
framework
: The framework you are using.vue
andreact
are supported.
Sponsor Me
If you like this tool, please consider to sponsor me. I will keep working on this tool and add more features.
License
MIT