Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Lint on PRs instead of relying on husky (#1629)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnvr authored Feb 17, 2024
2 parents 675bd96 + 57ed3e6 commit d984c60
Show file tree
Hide file tree
Showing 19 changed files with 62 additions and 478 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint

on:
# Run on every push (this also covers pull requests)
push:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: yarn install
- run: yarn lint
40 changes: 6 additions & 34 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,52 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
# Node
node_modules/
.pnp/
.pnp.js

# testing
coverage/

# next.js
# Next.js
.next/
out/

# production
build/
.vercel
.turbo/

# misc
.DS_Store
*.pem
tsconfig.tsbuildinfo

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

tsconfig.tsbuildinfo

# local env files
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

out_functions
out_publish

.env
.idea/

# workbox
public/sw.js
public/sw.js.map
public/worker-*.js
public/worker-*.js.map


# turbo
**/.turbo/
11 changes: 0 additions & 11 deletions .husky/pre-commit

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/extensions.json

This file was deleted.

20 changes: 0 additions & 20 deletions .vscode/settings.json

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ente - simple, safe photo storage
# Ente – Simple, safe photo storage

**ente** is a cloud storage that provides end-to-end encryption for your data.
**Ente** is a cloud storage that provides end-to-end encryption for your data.

We have open-source apps across
[Android](https://github.com/ente-io/photos-app),
Expand Down
2 changes: 1 addition & 1 deletion apps/accounts/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ module.exports = {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['.eslintrc.js', 'out'],
};
18 changes: 9 additions & 9 deletions apps/accounts/src/pages/generate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { AppContext } from 'pages/_app';
import { useContext } from 'react';

export default function Generate() {
const appContext = useContext(AppContext);
const router = useRouter();
return (
<GeneratePage
appContext={appContext}
router={router}
appName={APPS.ACCOUNTS}
/>
);
const appContext = useContext(AppContext);
const router = useRouter();
return (
<GeneratePage
appContext={appContext}
router={router}
appName={APPS.ACCOUNTS}
/>
);
}
18 changes: 9 additions & 9 deletions apps/accounts/src/pages/signup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { AppContext } from 'pages/_app';
import { useContext } from 'react';

export default function Sigup() {
const appContext = useContext(AppContext);
const router = useRouter();
return (
<SignupPage
appContext={appContext}
router={router}
appName={APPS.ACCOUNTS}
/>
);
const appContext = useContext(AppContext);
const router = useRouter();
return (
<SignupPage
appContext={appContext}
router={router}
appName={APPS.ACCOUNTS}
/>
);
}
2 changes: 1 addition & 1 deletion apps/auth/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ module.exports = {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['.eslintrc.js', 'out'],
};
2 changes: 1 addition & 1 deletion apps/cast/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ module.exports = {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['.eslintrc.js', 'out'],
};
2 changes: 1 addition & 1 deletion apps/photos/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ module.exports = {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
ignorePatterns: ['.eslintrc.js'],
ignorePatterns: ['.eslintrc.js', 'out', 'thirdparty', 'public'],
};
9 changes: 5 additions & 4 deletions apps/photos/src/components/Sidebar/UtilitySection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ export default function UtilitySection({ closeSidebar }) {
try {
const accountsToken = await getAccountsToken();

window.location.href = `${getAccountsURL()}${ACCOUNTS_PAGES.ACCOUNT_HANDOFF
}?package=${CLIENT_PACKAGE_NAMES.get(
APPS.PHOTOS
)}&token=${accountsToken}`;
window.location.href = `${getAccountsURL()}${
ACCOUNTS_PAGES.ACCOUNT_HANDOFF
}?package=${CLIENT_PACKAGE_NAMES.get(
APPS.PHOTOS
)}&token=${accountsToken}`;
} catch (e) {
logError(e, 'failed to redirect to accounts page');
}
Expand Down
16 changes: 0 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"dev:cast": "yarn workspace cast next dev",
"dev:photos": "yarn workspace photos next dev",
"albums": "yarn workspace photos albums",
"prepare": "husky install",
"lint": "yarn prettier --check . && yarn workspaces run eslint .",
"lint-fix": "yarn prettier --write . && yarn workspaces run eslint --fix ."
},
Expand All @@ -39,22 +38,7 @@
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"eslint": "^8.56",
"husky": "^7.0.1",
"lint-staged": "^13.2.3",
"prettier": "2.3.2",
"typescript": "^5.1.3"
},
"lint-staged": {
"apps/**/*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write --ignore-unknown"
],
"packages/**/*.{js,jsx,ts,tsx}": [
"eslint --fix",
"prettier --write --ignore-unknown"
],
"**/*.{json,css,scss,md,html,yml,yaml}": [
"prettier --write --ignore-unknown"
]
}
}
5 changes: 3 additions & 2 deletions packages/accounts/pages/credentials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ export default function Credentials({
isTwoFactorPasskeysEnabled: true,
});
InMemoryStore.set(MS_KEYS.REDIRECT_URL, PAGES.ROOT);
window.location.href = `${getAccountsURL()}/passkeys/flow?passkeySessionID=${passkeySessionID}&redirect=${window.location.origin
}/passkeys/finish`;
window.location.href = `${getAccountsURL()}/passkeys/flow?passkeySessionID=${passkeySessionID}&redirect=${
window.location.origin
}/passkeys/finish`;
return;
} else if (twoFactorSessionID) {
const sessionKeyAttributes =
Expand Down
5 changes: 3 additions & 2 deletions packages/accounts/pages/verify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ export default function VerifyPage({ appContext, router, appName }: PageProps) {
isTwoFactorPasskeysEnabled: true,
});
setIsFirstLogin(true);
window.location.href = `${getAccountsURL()}/passkeys/flow?passkeySessionID=${passkeySessionID}&redirect=${window.location.origin
}/passkeys/finish`;
window.location.href = `${getAccountsURL()}/passkeys/flow?passkeySessionID=${passkeySessionID}&redirect=${
window.location.origin
}/passkeys/finish`;
router.push(PAGES.CREDENTIALS);
} else if (twoFactorSessionID) {
setData(LS_KEYS.USER, {
Expand Down
5 changes: 5 additions & 0 deletions packages/shared/next/next.config.base.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

/**
* @file Configure the Next.js build
*
Expand All @@ -16,6 +18,9 @@ const gitSHA = cp.execSync('git rev-parse --short HEAD', {
encoding: 'utf8',
});

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* generate a static export when we run `next build` */
output: 'export',
Expand Down
Loading

0 comments on commit d984c60

Please sign in to comment.