Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
241 changes: 151 additions & 90 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,36 @@ module.exports = {
Atomics: `readonly`,
SharedArrayBuffer: `readonly`,
},
ignorePatterns: [
`dist/`,
`auto-imports.d.ts`,
`components.d.ts`,
`backend/encore.gen/`,
`node_modules/`,
],
parserOptions: {
ecmaVersion: 2020,
sourceType: `module`,
"parser": {
"ts": `@typescript-eslint/parser`,
parser: {
ts: `@typescript-eslint/parser`,
"<template>": `espree`,
},
},
plugins: [`vue`, `@typescript-eslint`, `no-switch-statements`, `sonarjs`, `unicorn`],
plugins: [
`vue`,
`@typescript-eslint`,
`no-switch-statements`,
`sonarjs`,
`unicorn`,
],
overrides: [
{
files: [`*.vue`],
parser: `vue-eslint-parser`,
},
{
// Match all .js/.jsx/.ts/.tsx files in the immediate root directory "special-dir"
files: ['backend/**/*.ts'],
files: ["backend/**/*.ts"],

// You can also further narrow by excludedFiles if needed:
// excludedFiles: '*.test.js',
Expand All @@ -55,121 +68,161 @@ module.exports = {
"require-await": `off`,
"vue/html-indent": [`warn`, 4],
"vue/no-v-html": `off`,
"vue/first-attribute-linebreak": [`warn`, { singleline: `ignore`, multiline: `below` }],
"vue/first-attribute-linebreak": [
`warn`,
{ singleline: `ignore`, multiline: `below` },
],
"vue/max-attributes-per-line": [
`warn`,
{
singleline: 1,
multiline: 1,
},
],
"vue/html-closing-bracket-newline": [`warn`, {
"singleline": `never`,
"multiline": `always`,
}],
"vue/html-closing-bracket-newline": [
`warn`,
{
singleline: `never`,
multiline: `always`,
},
],
"vue/no-ref-as-operand": `error`,
"vue/attribute-hyphenation": `warn`,
"vue/component-definition-name-casing": [`warn`, `kebab-case`],
"lines-between-class-members": [`warn`],
"vue/html-closing-bracket-spacing": [`warn`, {
"startTag": `never`,
"endTag": `never`,
"selfClosingTag": `always`,
}],
"vue/html-self-closing": [`warn`, {
"html": {
"void": `always`,
"normal": `always`,
"component": `always`,
},
"svg": `always`,
"math": `always`,
}],
"vue/multiline-html-element-content-newline": [`warn`, {
"ignoreWhenEmpty": true,
"ignores": [`pre`, `textarea`],
"allowEmptyLines": false,
}],
"vue/no-multi-spaces": [`warn`, {
"ignoreProperties": false,
}],
"vue/html-closing-bracket-spacing": [
`warn`,
{
startTag: `never`,
endTag: `never`,
selfClosingTag: `always`,
},
],
"vue/html-self-closing": [
`warn`,
{
html: {
void: `always`,
normal: `always`,
component: `always`,
},
svg: `always`,
math: `always`,
},
],
"vue/multiline-html-element-content-newline": [
`warn`,
{
ignoreWhenEmpty: true,
ignores: [`pre`, `textarea`],
allowEmptyLines: false,
},
],
"vue/no-multi-spaces": [
`warn`,
{
ignoreProperties: false,
},
],
"vue/mustache-interpolation-spacing": [`warn`, `always`],
"vue/no-spaces-around-equal-signs-in-attribute": [`warn`],
"vue/require-prop-types": [`error`],
"vue/v-bind-style": [`warn`, `shorthand`],
"vue/v-on-style": [`warn`, `shorthand`],
"vue/v-slot-style": [`warn`, {
"atComponent": `shorthand`,
"default": `shorthand`,
"named": `shorthand`,
}],
"vue/v-on-event-hyphenation": [`warn`, `always`, {
"autofix": true,
"ignore": [],
}],
"vue/attributes-order": [`warn`, {
"order": [
`DEFINITION`,
`LIST_RENDERING`,
`CONDITIONALS`,
`RENDER_MODIFIERS`,
`GLOBAL`,
[`UNIQUE`, `SLOT`],
`TWO_WAY_BINDING`,
`OTHER_DIRECTIVES`,
`OTHER_ATTR`,
`EVENTS`,
`CONTENT`,
],
"alphabetical": false,
}],
"vue/block-lang": [`error`,
{
"script": {
"lang": `ts`,
"vue/v-slot-style": [
`warn`,
{
atComponent: `shorthand`,
default: `shorthand`,
named: `shorthand`,
},
],
"vue/v-on-event-hyphenation": [
`warn`,
`always`,
{
autofix: true,
ignore: [],
},
],
"vue/attributes-order": [
`warn`,
{
order: [
`DEFINITION`,
`LIST_RENDERING`,
`CONDITIONALS`,
`RENDER_MODIFIERS`,
`GLOBAL`,
[`UNIQUE`, `SLOT`],
`TWO_WAY_BINDING`,
`OTHER_DIRECTIVES`,
`OTHER_ATTR`,
`EVENTS`,
`CONTENT`,
],
alphabetical: false,
},
],
"vue/block-lang": [
`error`,
{
script: {
lang: `ts`,
},
"template": {
"lang": `html`,
template: {
lang: `html`,
},
},
],
"vue/component-api-style": [`error`,
[`script-setup`, `options`],
"vue/component-api-style": [`error`, [`script-setup`, `options`]],
"vue/component-name-in-template-casing": [
`warn`,
`kebab-case`,
{
registeredComponentsOnly: false,
ignores: [],
},
],
"vue/component-name-in-template-casing": [`warn`, `kebab-case`, {
"registeredComponentsOnly": false,
"ignores": [],
}],
"vue/custom-event-name-casing": [`error`,
"vue/custom-event-name-casing": [
`error`,
`kebab-case`,
{
"ignores": [],
ignores: [],
},
],
"vue/define-emits-declaration": [`warn`, `type-based`],
"vue/define-macros-order": [
`warn`,
{
order: [`defineProps`, `defineEmits`],
},
],
"vue/define-emits-declaration": [`error`, `type-based`],
"vue/define-macros-order": [`warn`, {
"order": [`defineProps`, `defineEmits`],
}],
"vue/define-props-declaration": [`error`, `runtime`],
"vue/html-comment-content-spacing": [`warn`,
"vue/html-comment-content-spacing": [
`warn`,
`always`,
{
"exceptions": [],
exceptions: [],
},
],
"vue/padding-line-between-blocks": [`warn`, `always`],
"vue/padding-line-between-tags": [`warn`, [
{ blankLine: `always`, prev: `*`, next: `*` },
]],
"vue/padding-line-between-tags": [
`warn`,
[{ blankLine: `always`, prev: `*`, next: `*` }],
],
"vue/prefer-separate-static-class": [`warn`],
"vue/prefer-true-attribute-shorthand": [`error`],
"vue/require-macro-variable-name": [`error`, {
"defineProps": `props`,
"defineEmits": `emit`,
"defineSlots": `slots`,
"useSlots": `slots`,
"useAttrs": `attrs`,
}],
"vue/require-macro-variable-name": [
`error`,
{
defineProps: `props`,
defineEmits: `emit`,
defineSlots: `slots`,
useSlots: `slots`,
useAttrs: `attrs`,
},
],
eqeqeq: `off`,
"import/no-named-as-default": `off`,
"accessor-pairs": `off`,
Expand All @@ -181,10 +234,10 @@ module.exports = {
"unicorn/prevent-abbreviations": [
`warn`,
{
"allowList": {
"attrs": true,
"props": true,
"Ref": true,
allowList: {
attrs: true,
props: true,
Ref: true,
},
checkFilenames: false,
},
Expand All @@ -195,5 +248,13 @@ module.exports = {
"unicorn/no-new-array": `off`,
"unicorn/no-array-callback-reference": `off`,
"sonarjs/no-nested-template-literals": `off`,
"unicorn/no-empty-file": `off`,
"unicorn/no-abusive-eslint-disable": `off`,
"unicorn/filename-case": `off`,
"unicorn/no-await-expression-member": `off`,
"unicorn/no-null": `off`,
"sonarjs/no-duplicate-string": `off`,
"no-trailing-spaces": `warn`,
"eol-last": `warn`,
},
};
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ components.d.ts

*storybook.log
.env
*.tsbuildinfo
*.tsbuildinfo
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.13.0"
}
}
}
8 changes: 4 additions & 4 deletions backend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/prompt/business-info-prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class BusinessInfoPrompt extends Prompt {
const completion = await this.client.chat.completions.create({
model: this.model,
messages: [{
role: `user`,
role: "user",
content: `Analyze whether you have information about the business at the following URL: ${this.tabTitle}.
If you have information about this business or brand, please provide details about its activities, products, services, and any other relevant information.
Return the information in a structured format, JSON, with only one key: message.
Expand Down
2 changes: 1 addition & 1 deletion backend/prompt/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ChatModel } from "openai/resources/chat/index.mjs";

export const DEFAULT_MODEL = `gpt-4o` as const satisfies ChatModel;
export const DEFAULT_MODEL = "gpt-4o" as const satisfies ChatModel;

export const DEFAULT_HYPOTHESES_CAP = 5 as const;
Loading