Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: get linting working #82

Merged
merged 23 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 19 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
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Frontend Lint

on:
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.x'
- name: Install dependencies
working-directory: ./publish-frontend
run: npm install
- name: Run lint
working-directory: ./publish-frontend
run: npm run lint
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

cd publish-frontend
npx lint-staged

26 changes: 26 additions & 0 deletions package-lock.json
Nirajn2311 marked this conversation as resolved.
Show resolved Hide resolved

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

10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"dependencies": {
},
"devDependencies": {
"husky": "^8.0.0"
},
"scripts": {
"prepare": "husky install"
}
}
23 changes: 21 additions & 2 deletions publish-frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
{
"extends": ["next/babel", "next/core-web-vitals", "prettier"]
}
"extends": [
"next/core-web-vitals",
"prettier"
],
"plugins": [
"unused-imports"
],
"rules": {
"no-unused-vars": 2,
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
]
}
}
3 changes: 3 additions & 0 deletions publish-frontend/.lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"**/*.{js,jsx,ts,tsx}": ["eslint", "prettier --write"]
}
Loading
Loading