Skip to content

Commit

Permalink
Add linting and formatting check (#49)
Browse files Browse the repository at this point in the history
* Lint and format scripts, pre-commit hook, configure eslint

* Working linting

* Working and run prettier

* Working and run eslint

* Readd lint-staged prettier filter

* lint on commit

* Fix .prettierignore

* Update package-lock

* Don't limit lint-staged prettier filter

* Lint fixes
  • Loading branch information
TyHil authored Feb 6, 2024
1 parent 5ac7669 commit 79ca903
Show file tree
Hide file tree
Showing 44 changed files with 8,057 additions and 9,358 deletions.
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.cache
.husky
.plasmo
.vscode
package-lock.json
pnpm-lock.yaml
build
assets
26 changes: 26 additions & 0 deletions .github/workflows/lint-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint and Formatting Check

on: push

jobs:
main:
name: Run ESLint + Prettier
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install Next for ESLint and Prettier
run: npm install next prettier

- name: Run ESLint
run: npm run lint:check

- name: Run Prettier
run: npm run format:check
4 changes: 2 additions & 2 deletions .github/workflows/submit.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Submit to Web Store"
name: 'Submit to Web Store'
on:
workflow_dispatch:

Expand All @@ -22,7 +22,7 @@ jobs:
uses: actions/[email protected]
with:
node-version: 16.x
cache: "pnpm"
cache: 'pnpm'
- name: Build and zip extension artifact
run: pnpm package
- name: Browser Platform Publish
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@ keys.json

# typescript
.tsbuildinfo

# lint cache
.eslintcache
*.cache
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.cache
.husky
.next
.plasmo
.vscode
package.json
package-lock.json
pnpm-lock.yaml
build
assets
17 changes: 0 additions & 17 deletions .prettierrc.cjs

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
printWidth: 80,
semi: true,
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
useTabs: false,
};
5 changes: 5 additions & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
Loading

0 comments on commit 79ca903

Please sign in to comment.