Merge pull request #213 from TomAFrench/lint-desktop-client

Enforce linting in desktop-client
This commit is contained in:
Tom French 2022-08-25 16:44:32 +01:00 committed by GitHub
commit be6780f90b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 9 deletions

View file

@ -1,10 +1,10 @@
module.exports = { module.exports = {
plugins: ["prettier"], plugins: ['prettier'],
extends: ["react-app"], extends: ['react-app'],
rules: { rules: {
"prettier/prettier": "error", 'prettier/prettier': 'error',
"no-unused-vars": "off", 'no-unused-vars': 'off',
"no-loop-func": "off", 'no-loop-func': 'off',
"no-restricted-globals": "off" 'no-restricted-globals': 'off'
} }
}; };

View file

@ -29,7 +29,7 @@
"test:debug": "yarn workspaces foreach --verbose run test", "test:debug": "yarn workspaces foreach --verbose run test",
"rebuild-electron": "./node_modules/.bin/electron-rebuild -f -m ./packages/loot-core", "rebuild-electron": "./node_modules/.bin/electron-rebuild -f -m ./packages/loot-core",
"rebuild-node": "yarn workspace loot-core rebuild", "rebuild-node": "yarn workspace loot-core rebuild",
"lint": "yarn workspace loot-core lint", "lint": "yarn workspaces foreach --verbose run lint",
"postinstall": "rm -rf ./packages/loot-design/node_modules/react && rm -rf ./packages/mobile/node_modules/react && rm -rf ./node_modules/react-native && patch-package" "postinstall": "rm -rf ./packages/loot-design/node_modules/react && rm -rf ./packages/mobile/node_modules/react && rm -rf ./node_modules/react-native && patch-package"
}, },
"devDependencies": { "devDependencies": {

View file

@ -34,6 +34,7 @@
"eslint-plugin-flowtype": "2.50.1", "eslint-plugin-flowtype": "2.50.1",
"eslint-plugin-import": "2.14.0", "eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.2", "eslint-plugin-jsx-a11y": "6.1.2",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "7.11.1", "eslint-plugin-react": "7.11.1",
"file-loader": "2.0.0", "file-loader": "2.0.0",
"focus-visible": "^4.1.1", "focus-visible": "^4.1.1",
@ -84,7 +85,8 @@
"start:browser": "./bin/watch-browser", "start:browser": "./bin/watch-browser",
"watch": "cross-env PORT=3001 node scripts/start.js", "watch": "cross-env PORT=3001 node scripts/start.js",
"build": "cross-env INLINE_RUNTIME_CHUNK=false node scripts/build.js", "build": "cross-env INLINE_RUNTIME_CHUNK=false node scripts/build.js",
"build:browser": "./bin/build-browser" "build:browser": "./bin/build-browser",
"lint": "eslint src"
}, },
"browserslist": [ "browserslist": [
"electron 3.0" "electron 3.0"

View file

@ -8,8 +8,17 @@ import { initServer } from 'loot-core/src/platform/client/fetch';
import { import {
generateTransaction, generateTransaction,
generateAccount, generateAccount,
generateCategoryGroups generateCategoryGroups,
TestProvider
} from 'loot-core/src/mocks'; } from 'loot-core/src/mocks';
import {
addSplitTransaction,
realizeTempTransactions,
splitTransaction,
updateTransaction
} from 'loot-core/src/shared';
import { SelectedProviderWithItems } from 'loot-design/src/components';
import { SplitsExpandedProvider, TransactionTable } from './TransactionsTable';
const uuid = require('loot-core/src/platform/uuid'); const uuid = require('loot-core/src/platform/uuid');
const accounts = [generateAccount('Bank of America')]; const accounts = [generateAccount('Bank of America')];

View file

@ -1,3 +1,7 @@
import React from 'react';
/* eslint-disable */
function BudgetSheetHeader({ row }) { function BudgetSheetHeader({ row }) {
return ( return (
<Row style={{ zIndex: 200, backgroundColor: colors.grey1, marginLeft: 20 }}> <Row style={{ zIndex: 200, backgroundColor: colors.grey1, marginLeft: 20 }}>

View file

@ -90,6 +90,7 @@ __metadata:
eslint-plugin-flowtype: 2.50.1 eslint-plugin-flowtype: 2.50.1
eslint-plugin-import: 2.14.0 eslint-plugin-import: 2.14.0
eslint-plugin-jsx-a11y: 6.1.2 eslint-plugin-jsx-a11y: 6.1.2
eslint-plugin-prettier: ^3.1.4
eslint-plugin-react: 7.11.1 eslint-plugin-react: 7.11.1
file-loader: 2.0.0 file-loader: 2.0.0
focus-visible: ^4.1.1 focus-visible: ^4.1.1