Skip to content

Commit

Permalink
Bugfix etc
Browse files Browse the repository at this point in the history
Fix generate_kibana_discover_url is false
Fix pagertree_proxy
Code modification for vue3 compatibility
axios 1.6.4 to 1.6.5
jsdom 23.0.1 to 23.2.0
add eslint-plugin-rulesdir
  • Loading branch information
nsano-rururu committed Jan 8, 2024
1 parent 732f55f commit 6ab3c13
Show file tree
Hide file tree
Showing 122 changed files with 875 additions and 675 deletions.
124 changes: 121 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
const rulesDirPlugin = require('eslint-plugin-rulesdir');

rulesDirPlugin.RULES_DIR = 'eslint/rules';

module.exports = {
root: true,
env: {
node: true,
mocha: true
},
extends: ['plugin:vue/recommended', '@vue/eslint-config-airbnb'],
extends: ['plugin:vue/vue3-recommended', '@vue/eslint-config-airbnb'],
plugins: [
'rulesdir'
],
rules: {
'rulesdir/custom1': 'off',
'vue/max-len': 'off',
'import/no-unresolved': 'off',
'vuejs-accessibility/rule-name': 'off',
Expand Down Expand Up @@ -62,10 +70,120 @@ module.exports = {
singleline: 'never',
multiline: 'never'
}
]
],
'no-restricted-imports': [
'error',
{
'paths': [
{
'name': 'vue',
'importNames': ['default']
},
],
},
],
},
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false
}
},
overrides: [
// TODO: Vue3 Support
{
files: [
'.eslintrc.js',
],
rules: {
'quote-props': 'off',
},
},
// TODO: Vue3 Support
{
files: [
'src/App.vue',
],
rules: {
'vue/v-on-event-hyphenation': 'off',
},
},
// TODO: Vue3 Support
{
files: [
'src/components/DateTime.vue',
'src/components/config/ConfigTest.vue',
'src/views/ConfigBuilder.vue',
],
rules: {
'vue/no-deprecated-destroyed-lifecycle': 'off',
},
},
// TODO: Vue3 Support
{
files: [
'src/components/ElastalertTimePicker.vue',
'src/components/NavTree.vue',
'src/components/config/ConfigCondition.vue',
'src/components/config/ConfigKibanaDiscover.vue',
'src/components/config/ConfigQuery.vue',
'src/components/config/ConfigSettings.vue',
'src/components/config/alert/ConfigAlert.vue',
'src/components/config/alert/ConfigAlertAlerta.vue',
'src/components/config/alert/ConfigAlertCommand.vue',
'src/components/config/alert/ConfigAlertGoogleChat.vue',
'src/components/config/alert/ConfigAlertHttpPost.vue',
'src/components/config/alert/ConfigAlertHttpPost2.vue',
'src/components/config/alert/ConfigAlertMattermost.vue',
'src/components/config/alert/ConfigAlertMsTeams.vue',
'src/components/config/alert/ConfigAlertPagerDuty.vue',
'src/components/config/alert/ConfigAlertRocketChat.vue',
'src/components/config/alert/ConfigAlertSlack.vue',
'src/components/config/alert/ConfigAlertSubjectBody.vue',
'src/components/config/alert/ConfigAlertTencentSms.vue',
'src/components/config/alert/ConfigAlertTheHive.vue',
'src/views/RuleView.vue',
'src/views/TemplateView.vue'
],
rules: {
'vue/no-deprecated-v-on-native-modifier': 'off',
},
},
// TODO: Vue3 Support
{
files: [
'src/components/ESChart.vue',
'src/contrib.js',
'src/main.js',
'src/registration.js',
'src/router.js',
'src/store/config/match.js',
'src/store/config/settings.js',
'src/store/configs.js',
'src/store/index.js',
'src/store/metadata.js'
],
rules: {
'no-restricted-imports': 'off',
},
},
// TODO: Vue3 Support
{
files: [
'src/components/config/ConfigCondition.vue',
'src/views/RuleView.vue',
'src/views/TemplateView.vue'
],
rules: {
'vue/no-deprecated-v-bind-sync': 'off',
},
},
// TODO: Vue3 Support
{
files: [
'src/views/ConfigBuilder.vue'
],
rules: {
'vue/v-on-event-hyphenation': 'off',
},
},
]
};
49 changes: 49 additions & 0 deletions eslint/rules/custom1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
'use strict'

const utils = require('eslint-plugin-vue/lib/utils')

module.exports = {
meta: {
type: 'problem',
docs: {
description:
'disallow using v-model for custom component is affected by a breaking change in Vue 3.',
categories: undefined,
url: 'https://v3-migration.vuejs.org/ja/breaking-changes/v-model.html',
},
fixable: null,
schema: [
{
type: 'object',
properties: {
ignoreComponentNames: {
type: 'array',
},
},
},
],
messages: {
error:
'カスタムコンポーネントへのv-modelの使用は、Vue 3の破壊的変更の影響を受けるので使用しないでください。\nhttps://v3-migration.vuejs.org/ja/breaking-changes/v-model.html',
},
},
/** @param {RuleContext} context */
create(context) {
const ignoreComponentNames = context.options[0]?.ignoreComponentNames ?? []
return utils.defineTemplateBodyVisitor(context, {
"VAttribute[directive=true][key.name.name='model']"(node) {
const element = node.parent.parent
if (
utils.isCustomComponent(node.parent.parent) &&
!ignoreComponentNames.includes(element.name)
) {
context.report({
node,
loc: node.loc,
messageId: 'error',
})
}
},
})
},
}
Loading

0 comments on commit 6ab3c13

Please sign in to comment.