Skip to content

Commit

Permalink
ci: Fix lint setup in chat package (no-changelog) (#8275)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored Jan 9, 2024
1 parent d1ca368 commit d5dcbbf
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 67 deletions.
41 changes: 0 additions & 41 deletions packages/@n8n/chat/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,4 @@ module.exports = {
extends: ['@n8n_io/eslint-config/frontend'],

...sharedOptions(__dirname, 'frontend'),

rules: {
'n8n-local-rules/dangerously-use-html-string-missing': 'off',

// TODO: Remove these
'id-denylist': 'warn',
'import/extensions': 'warn',
'import/no-default-export': 'warn',
'import/order': 'off',
'import/no-cycle': 'warn',
'import/no-duplicates': 'warn',
'@typescript-eslint/ban-types': 'warn',
'@typescript-eslint/dot-notation': 'warn',
'@typescript-eslint/lines-between-class-members': 'warn',
'@typescript-eslint/member-delimiter-style': 'warn',
'@typescript-eslint/naming-convention': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'@typescript-eslint/no-for-in-array': 'warn',
'@typescript-eslint/no-loop-func': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-shadow': 'warn',
'@typescript-eslint/no-this-alias': 'warn',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-unsafe-call': 'warn',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-use-before-define': 'warn',
'@typescript-eslint/no-var-requires': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/restrict-plus-operands': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': true }],
'@typescript-eslint/no-redundant-type-constituents': 'warn',
'@typescript-eslint/no-base-to-string': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
},
};
3 changes: 2 additions & 1 deletion packages/@n8n/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"test:dev": "vitest",
"test": "vitest run --coverage",
"type-check": "vue-tsc --noEmit -p tsconfig.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore --ignore-path .eslintignore",
"lint": "eslint . --ext .js,.ts,.vue --quiet",
"lintfix": "eslint . --ext .js,.ts,.vue --fix",
"format": "prettier --write src/",
"storybook": "storybook dev -p 6006 --no-open",
"build:storybook": "storybook build",
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import { Chat, ChatWindow } from '@n8n/chat/components';
import { computed, onMounted } from 'vue';
import hljs from 'highlight.js/lib/core';
import hljsXML from 'highlight.js/lib/languages/xml';
import hljsJavascript from 'highlight.js/lib/languages/javascript';
import { Chat, ChatWindow } from '@n8n/chat/components';
import { useOptions } from '@n8n/chat/composables';
defineProps({});
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/__stories__/App.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/naming-convention */
import type { StoryObj } from '@storybook/vue3';
import { onMounted } from 'vue';
import type { ChatOptions } from '@n8n/chat/types';
import { createChat } from '@n8n/chat/index';
import { onMounted } from 'vue';

const webhookUrl = 'http://localhost:5678/webhook/f406671e-c954-4691-b39a-66c90aa2f103/chat';

Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/components/Chat.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { nextTick, onMounted } from 'vue';
import Layout from '@n8n/chat/components/Layout.vue';
import GetStarted from '@n8n/chat/components/GetStarted.vue';
import GetStartedFooter from '@n8n/chat/components/GetStartedFooter.vue';
import MessagesList from '@n8n/chat/components/MessagesList.vue';
import Input from '@n8n/chat/components/Input.vue';
import { nextTick, onMounted } from 'vue';
import { useI18n, useChat, useOptions } from '@n8n/chat/composables';
import { chatEventBus } from '@n8n/chat/event-buses';
Expand Down
4 changes: 2 additions & 2 deletions packages/@n8n/chat/src/components/ChatWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import IconChat from 'virtual:icons/mdi/chat';
// eslint-disable-next-line import/no-unresolved
import IconChevronDown from 'virtual:icons/mdi/chevron-down';
import Chat from '@n8n/chat/components/Chat.vue';
import { nextTick, ref } from 'vue';
import Chat from '@n8n/chat/components/Chat.vue';
import { chatEventBus } from '@n8n/chat/event-buses';
const isOpen = ref(false);
Expand All @@ -23,7 +23,7 @@ function toggle() {
<template>
<div class="chat-window-wrapper">
<Transition name="chat-window-transition">
<div class="chat-window" v-show="isOpen">
<div v-show="isOpen" class="chat-window">
<Chat />
</div>
</Transition>
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/components/Input.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
// eslint-disable-next-line import/no-unresolved
import IconSend from 'virtual:icons/mdi/send';
import { useI18n, useChat } from '@n8n/chat/composables';
import { computed, ref } from 'vue';
import { useI18n, useChat } from '@n8n/chat/composables';
const chatStore = useChat();
const { waitingForResponse } = chatStore;
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/components/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ onBeforeUnmount(() => {
<div v-if="$slots.header" class="chat-header">
<slot name="header" />
</div>
<div v-if="$slots.default" class="chat-body" ref="chatBodyRef">
<div v-if="$slots.default" ref="chatBodyRef" class="chat-body">
<slot />
</div>
<div v-if="$slots.footer" class="chat-footer">
Expand Down
8 changes: 2 additions & 6 deletions packages/@n8n/chat/src/components/Message.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
/* eslint-disable @typescript-eslint/naming-convention */
import type { ChatMessage } from '@n8n/chat/types';
import type { PropType } from 'vue';
import { computed, toRefs } from 'vue';
import VueMarkdown from 'vue-markdown-render';
import hljs from 'highlight.js/lib/core';
import type { ChatMessage } from '@n8n/chat/types';
const props = defineProps({
message: {
Expand Down Expand Up @@ -41,11 +41,7 @@ const markdownOptions = {
<template>
<div class="chat-message" :class="classes">
<slot>
<vue-markdown
class="chat-message-markdown"
:source="messageText"
:options="markdownOptions"
/>
<VueMarkdown class="chat-message-markdown" :source="messageText" :options="markdownOptions" />
</slot>
</div>
</template>
Expand Down
4 changes: 2 additions & 2 deletions packages/@n8n/chat/src/components/MessageTyping.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import type { ChatMessage } from '@n8n/chat/types';
import { Message } from './index';
import type { PropType } from 'vue';
import { computed } from 'vue';
import { Message } from './index';
import type { ChatMessage } from '@n8n/chat/types';
const props = defineProps({
animation: {
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/plugins/chat.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Plugin } from 'vue';
import { computed, nextTick, ref } from 'vue';
import type { ChatMessage, ChatOptions } from '@n8n/chat/types';
import { v4 as uuidv4 } from 'uuid';
import type { ChatMessage, ChatOptions } from '@n8n/chat/types';
import { chatEventBus } from '@n8n/chat/event-buses';
import * as api from '@n8n/chat/api';
import { ChatOptionsSymbol, ChatSymbol, localStorageSessionIdKey } from '@n8n/chat/constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/@n8n/chat/src/types/chat.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ChatMessage } from '@n8n/chat/types/messages';
import type { Ref } from 'vue';
import type { ChatMessage } from '@n8n/chat/types/messages';

export interface Chat {
initialMessages: Ref<ChatMessage[]>;
Expand Down
6 changes: 0 additions & 6 deletions packages/@n8n_io/eslint-config/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ module.exports = {
ignorePatterns: ['**/*.js', '**/*.d.ts', 'vite.config.ts', '**/*.ts.snap'],

overrides: [
{
files: ['src/**/*.vue'],
rules: {
'n8n-local-rules/dangerously-use-html-string-missing': 'error',
},
},
{
files: ['**/*.test.ts', '**/test/**/*.ts', '**/__tests__/**/*.ts'],
rules: {
Expand Down
2 changes: 0 additions & 2 deletions packages/design-system/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ module.exports = {
...sharedOptions(__dirname, 'frontend'),

rules: {
'n8n-local-rules/dangerously-use-html-string-missing': 'off',

// TODO: Remove these
'import/no-default-export': 'warn',
'import/order': 'off',
Expand Down
2 changes: 2 additions & 0 deletions packages/editor-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = {
...sharedOptions(__dirname, 'frontend'),

rules: {
'n8n-local-rules/dangerously-use-html-string-missing': 'error',

// TODO: Remove these
'id-denylist': 'warn',
'import/extensions': 'warn',
Expand Down

0 comments on commit d5dcbbf

Please sign in to comment.