diff --git a/.eslintrc.js b/.eslintrc.js index 7c73657a..d3533925 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,12 +3,13 @@ module.exports = { env: { node: true, browser: true, - es2020: true, + es2018: true, }, rules: { 'no-console': 'warn', 'no-debugger': 'warn', 'arrow-body-style': 'off', + 'prettier/prettier': 'warn', 'prefer-arrow-callback': 'warn', 'vue/no-mutating-props': 'off', 'vue/multi-word-component-names': 'off', @@ -20,15 +21,22 @@ module.exports = { '@typescript-eslint/no-floating-promises': 'warn', '@typescript-eslint/no-misused-promises': 'warn', }, - parser: '@typescript-eslint/parser', - parserOptions: { project: true, tsconfigRootDir: __dirname }, - plugins: ['@typescript-eslint'], + parser: 'vue-eslint-parser', + parserOptions: { + parser: '@typescript-eslint/parser', + project: true, + tsconfigRootDir: __dirname, + sourceType: 'module', + extraFileExtensions: ['.vue'], + }, + plugins: ['@typescript-eslint', 'prettier'], extends: [ - 'plugin:vue/vue3-strongly-recommended', + 'plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', ], ignorePatterns: [ + '*.mjs', '.eslintrc.js', 'tailwind.config.js', 'node_modules', diff --git a/models/baseModels/AccountingLedgerEntry/AccountingLedgerEntry.ts b/models/baseModels/AccountingLedgerEntry/AccountingLedgerEntry.ts index 634c56ec..0518f30d 100644 --- a/models/baseModels/AccountingLedgerEntry/AccountingLedgerEntry.ts +++ b/models/baseModels/AccountingLedgerEntry/AccountingLedgerEntry.ts @@ -40,14 +40,7 @@ export class AccountingLedgerEntry extends Doc { static getListViewSettings(): ListViewSettings { return { - columns: [ - 'date', - 'account', - 'party', - 'debit', - 'credit', - 'referenceName', - ], + columns: ['date', 'account', 'party', 'debit', 'credit', 'referenceName'], }; } } diff --git a/models/baseModels/PriceList/PriceList.ts b/models/baseModels/PriceList/PriceList.ts index 7784d16a..10070dc1 100644 --- a/models/baseModels/PriceList/PriceList.ts +++ b/models/baseModels/PriceList/PriceList.ts @@ -1,7 +1,10 @@ import { Doc } from 'fyo/model/doc'; import { ListViewSettings } from 'fyo/model/types'; import { PriceListItem } from './PriceListItem'; -import { getPriceListEnabledColumn, getPriceListStatusColumn } from 'models/helpers'; +import { + getPriceListEnabledColumn, + getPriceListStatusColumn, +} from 'models/helpers'; export class PriceList extends Doc { isEnabled?: boolean; @@ -11,7 +14,11 @@ export class PriceList extends Doc { static getListViewSettings(): ListViewSettings { return { - columns: ['name', getPriceListEnabledColumn(), getPriceListStatusColumn()], + columns: [ + 'name', + getPriceListEnabledColumn(), + getPriceListStatusColumn(), + ], }; } } diff --git a/models/inventory/Batch.ts b/models/inventory/Batch.ts index 27a04157..c027b336 100644 --- a/models/inventory/Batch.ts +++ b/models/inventory/Batch.ts @@ -1,13 +1,10 @@ import { Doc } from 'fyo/model/doc'; -import { - ListViewSettings, -} from 'fyo/model/types'; +import { ListViewSettings } from 'fyo/model/types'; export class Batch extends Doc { static getListViewSettings(): ListViewSettings { return { - columns: ["name", "expiryDate", "manufactureDate"], + columns: ['name', 'expiryDate', 'manufactureDate'], }; } - } diff --git a/src/components/Icons/24/index.ts b/src/components/Icons/24/index.ts index eb222bdd..5944f841 100644 --- a/src/components/Icons/24/index.ts +++ b/src/components/Icons/24/index.ts @@ -1,5 +1,3 @@ - - import General from './general.vue'; import GreenCheck from './green-check.vue'; import Invoice from './invoice.vue'; diff --git a/src/initFyo.ts b/src/initFyo.ts index 547307cc..af0452c3 100644 --- a/src/initFyo.ts +++ b/src/initFyo.ts @@ -5,4 +5,4 @@ import { Fyo } from 'fyo'; * testing purposes a separate instance of fyo should be initialized. */ -export const fyo = new Fyo({ isTest: false, isElectron: true }); \ No newline at end of file +export const fyo = new Fyo({ isTest: false, isElectron: true }); diff --git a/src/utils/filters.ts b/src/utils/filters.ts index 20bf5c88..96b521d7 100644 --- a/src/utils/filters.ts +++ b/src/utils/filters.ts @@ -1,4 +1,3 @@ - export const routeFilters = { SalesItems: { for: ['in', ['Sales', 'Both']] }, PurchaseItems: { for: ['in', ['Purchases', 'Both']] },