Skip to content

A local-first personal finance app

Run ESLint at the top level once (#1202)

Jed Foxed50e2b3926b
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000000..b3dd188ee4
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,26 @@
+packages/api/app/bundle.api.js
+packages/api/dist
+
+packages/crdt/dist
+
+packages/desktop-client/bundle.browser.js
+packages/desktop-client/build/
+packages/desktop-client/public/kcab/
+packages/desktop-client/public/data/
+packages/desktop-client/**/node_modules/*
+packages/desktop-client/node_modules/
+
+packages/desktop-electron/client-build/
+packages/desktop-electron/dist/
+
+packages/import-ynab4/**/node_modules/*
+
+packages/import-ynab5/**/node_modules/*
+
+packages/loot-core/**/node_modules/*
+packages/loot-core/**/lib-dist/*
+packages/loot-core/**/proto/*
+
+packages/node-libofx/libofx.*.js
+packages/node-libofx/libofx/
+packages/node-libofx/OpenSP-*/
diff --git a/.eslintrc.js b/.eslintrc.js
index 0f6a974828..33f1213415 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -70,7 +70,7 @@ module.exports = {
],
'import/no-useless-path-segments': 'error',
'import/no-duplicates': ['error', { 'prefer-inline': true }],
- 'import/no-unused-modules': ['error', { 'unusedExports': true }],
+ 'import/no-unused-modules': ['error', { unusedExports: true }],
'import/order': [
'error',
{
@@ -120,8 +120,11 @@ module.exports = {
},
overrides: [
{
- files: ['./**/*.js'],
+ files: ['.eslintrc.js', './**/.eslintrc.js'],
parserOptions: { project: null },
+ rules: {
+ '@typescript-eslint/consistent-type-exports': 'off',
+ },
},
{
files: [
@@ -171,29 +174,32 @@ module.exports = {
files: ['./packages/loot-core/src/**/*'],
rules: {
// defining 'src' to check all packages is slow, so only do it for loot-core
- 'import/no-unused-modules': ['error', { 'unusedExports': true, 'src': ['../**/*.{js,ts,tsx}'] }],
- }
+ 'import/no-unused-modules': [
+ 'error',
+ { unusedExports: true, src: ['../**/*.{js,ts,tsx}'] },
+ ],
+ },
},
{
files: [
- '**/icons/**/*.js',
- '**/mocks/**/*.{js,ts,tsx}',
- '**/{mocks,__mocks__}/*.{js,ts,tsx}',
+ '**/icons/**/*.js',
+ '**/mocks/**/*.{js,ts,tsx}',
+ '**/{mocks,__mocks__}/*.{js,ts,tsx}',
// can't correctly resolve usages
'**/*.{testing,electron,browser,web,api}.ts',
- 'packages/loot-core/src/server/main.ts'
+ 'packages/loot-core/src/server/main.ts',
],
- rules: { 'import/no-unused-modules': 'off' }
+ rules: { 'import/no-unused-modules': 'off' },
},
],
settings: {
- "import/parsers": {
- "@typescript-eslint/parser": [".ts", ".tsx"]
+ 'import/parsers': {
+ '@typescript-eslint/parser': ['.ts', '.tsx'],
+ },
+ 'import/resolver': {
+ typescript: {
+ alwaysTryTypes: true,
+ },
},
- "import/resolver": {
- "typescript": {
- "alwaysTryTypes": true
- }
- }
- }
+ },
};
diff --git a/package.json b/package.json
index 3c87fe2b3a..eb8438fe50 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
"e2e": "yarn workspaces foreach --parallel --verbose run e2e",
"rebuild-electron": "./node_modules/.bin/electron-rebuild -f -m ./packages/loot-core",
"rebuild-node": "yarn workspace loot-core rebuild",
- "lint": "cross-env NODE_ENV=development yarn workspaces foreach --verbose run lint --max-warnings 0",
+ "lint": "eslint . --max-warnings 0",
"typecheck": "yarn tsc",
"postinstall": "patch-package"
},
diff --git a/packages/api/.eslintignore b/packages/api/.eslintignore
deleted file mode 100644
index 6bf73bdca3..0000000000
--- a/packages/api/.eslintignore
+++ /dev/null
@@ -1,2 +0,0 @@
-app/bundle.api.js
-dist
diff --git a/packages/api/package.json b/packages/api/package.json
index 41515f46a2..06a4a05e67 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -9,7 +9,6 @@
"dist"
],
"scripts": {
- "lint": "eslint .",
"build:app": "yarn workspace loot-core build:api",
"build:node": "tsc --p tsconfig.dist.json",
"build:migrations": "cp migrations/*.sql dist/migrations",
diff --git a/packages/crdt/.eslintignore b/packages/crdt/.eslintignore
deleted file mode 100644
index 1521c8b765..0000000000
--- a/packages/crdt/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-dist
diff --git a/packages/crdt/package.json b/packages/crdt/package.json
index dfb22254cc..dbff3f1358 100644
--- a/packages/crdt/package.json
+++ b/packages/crdt/package.json
@@ -9,7 +9,6 @@
"dist"
],
"scripts": {
- "lint": "eslint .",
"build:node": "tsc --p tsconfig.dist.json",
"build": "rm -rf dist && yarn run build:node && cp src/proto/sync_pb.d.ts dist/src/proto/",
"test": "jest -c jest.config.js"
diff --git a/packages/desktop-client/.eslintignore b/packages/desktop-client/.eslintignore
deleted file mode 100644
index d2ef22e7b9..0000000000
--- a/packages/desktop-client/.eslintignore
+++ /dev/null
@@ -1,6 +0,0 @@
-bundle.browser.js
-build/
-public/kcab/
-public/data/
-**/node_modules/*
-node_modules/
diff --git a/packages/desktop-client/package.json b/packages/desktop-client/package.json
index 59865175b8..231b030ac2 100644
--- a/packages/desktop-client/package.json
+++ b/packages/desktop-client/package.json
@@ -58,8 +58,7 @@
"build": "cross-env INLINE_RUNTIME_CHUNK=false react-app-rewired build",
"build:browser": "cross-env ./bin/build-browser",
"test": "react-app-rewired test",
- "e2e": "npx playwright test --browser=chromium",
- "lint": "eslint ."
+ "e2e": "npx playwright test --browser=chromium"
},
"jest": {
"setupFilesAfterEnv": [
diff --git a/packages/desktop-electron/.eslintignore b/packages/desktop-electron/.eslintignore
deleted file mode 100644
index 54c3eaa2f5..0000000000
--- a/packages/desktop-electron/.eslintignore
+++ /dev/null
@@ -1,2 +0,0 @@
-client-build/
-dist/
diff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.json
index f6ecad8813..fa9be4effb 100644
--- a/packages/desktop-electron/package.json
+++ b/packages/desktop-electron/package.json
@@ -8,7 +8,6 @@
"clean": "rm -rf dist",
"update-client": "bin/update-client",
"build": "electron-builder",
- "lint": "eslint .",
"watch": "cross-env ACTUAL_DOCUMENT_DIR=\"../../data\" ACTUAL_DATA_DIR=\"../../data\" electron ."
},
"main": "index.js",
diff --git a/packages/eslint-plugin-actual/package.json b/packages/eslint-plugin-actual/package.json
index 7f61ab9ac3..f37175955e 100644
--- a/packages/eslint-plugin-actual/package.json
+++ b/packages/eslint-plugin-actual/package.json
@@ -5,7 +5,6 @@
"exports": "./lib/index.js",
"type": "commonjs",
"scripts": {
- "lint": "eslint .",
"test": "jest"
},
"dependencies": {
diff --git a/packages/import-ynab4/.eslintignore b/packages/import-ynab4/.eslintignore
deleted file mode 100644
index abcb3667e2..0000000000
--- a/packages/import-ynab4/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-**/node_modules/*
\ No newline at end of file
diff --git a/packages/import-ynab4/package.json b/packages/import-ynab4/package.json
index 1cdea063ff..053b48df77 100644
--- a/packages/import-ynab4/package.json
+++ b/packages/import-ynab4/package.json
@@ -15,9 +15,6 @@
},
"bin": "./index.js",
"homepage": "https://github.com/actualbudget/actual/tree/master/packages/import-ynab4#readme",
- "scripts": {
- "lint": "eslint ."
- },
"dependencies": {
"@actual-app/api": "*",
"adm-zip": "^0.5.9",
diff --git a/packages/import-ynab5/.eslintignore b/packages/import-ynab5/.eslintignore
deleted file mode 100644
index abcb3667e2..0000000000
--- a/packages/import-ynab5/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-**/node_modules/*
\ No newline at end of file
diff --git a/packages/import-ynab5/package.json b/packages/import-ynab5/package.json
index 7896e56fcf..c686e8d3a5 100644
--- a/packages/import-ynab5/package.json
+++ b/packages/import-ynab5/package.json
@@ -15,9 +15,6 @@
},
"bin": "./index.js",
"homepage": "https://github.com/actualbudget/actual/tree/master/packages/import-ynab5#readme",
- "scripts": {
- "lint": "eslint ."
- },
"dependencies": {
"@actual-app/api": "*",
"date-fns": "^2.29.3",
diff --git a/packages/loot-core/.eslintignore b/packages/loot-core/.eslintignore
deleted file mode 100644
index bb4225346d..0000000000
--- a/packages/loot-core/.eslintignore
+++ /dev/null
@@ -1,3 +0,0 @@
-**/node_modules/*
-**/lib-dist/*
-**/proto/*
diff --git a/packages/loot-core/package.json b/packages/loot-core/package.json
index 3af15475d8..4624668f58 100644
--- a/packages/loot-core/package.json
+++ b/packages/loot-core/package.json
@@ -9,7 +9,6 @@
"build:api": "cross-env NODE_ENV=development webpack --config ./webpack/webpack.api.config.js; ./bin/copy-migrations ../api",
"build:browser": "cross-env NODE_ENV=production ./bin/build-browser",
"watch:browser": "cross-env NODE_ENV=development ./bin/build-browser",
- "lint": "eslint .",
"test": "npm-run-all -cp 'test:*'",
"test:node": "jest -c jest.config.js",
"test:web": "jest -c jest.web.config.js"
diff --git a/packages/node-libofx/.eslintignore b/packages/node-libofx/.eslintignore
deleted file mode 100644
index ebaff39709..0000000000
--- a/packages/node-libofx/.eslintignore
+++ /dev/null
@@ -1,3 +0,0 @@
-libofx.*.js
-libofx/
-OpenSP-*/
diff --git a/packages/node-libofx/package.json b/packages/node-libofx/package.json
index d17e8b5334..0ed68bac44 100644
--- a/packages/node-libofx/package.json
+++ b/packages/node-libofx/package.json
@@ -4,8 +4,5 @@
"description": "",
"main": "index.js",
"author": "",
- "license": "ISC",
- "scripts": {
- "lint": "eslint ."
- }
+ "license": "ISC"
}