-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add lint GHA and pre-commit hooks
- Loading branch information
1 parent
5c8c131
commit 3ccde66
Showing
38 changed files
with
7,820 additions
and
1,212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
package.lock.json | ||
.next | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:json/recommended", | ||
"plugin:prettier/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"plugins": ["@typescript-eslint", "react"], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"json/*": ["error", "allowComments"], | ||
"indent": ["error", "tab"], | ||
"linebreak-style": ["error", "unix"], | ||
"quotes": ["error", "double"], | ||
"semi": ["error", "always"], | ||
"prettier/prettier": ["error", { "printWidth": 100 }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Code Quality and Formatting Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- staging | ||
pull_request: | ||
branches: | ||
- main | ||
- staging | ||
|
||
jobs: | ||
check-code-quality: | ||
name: Check Code Quality | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install Node.js dependencies | ||
run: yarn install | ||
|
||
- name: Run ESLint | ||
run: yarn eslint . | ||
|
||
- name: Run Prettier | ||
run: yarn prettier --check . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
package.lock.json | ||
.next | ||
.github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 100, | ||
"semi": true, | ||
"singleQuote": false, | ||
"useTabs": true, | ||
"trailingComma": "none", | ||
"endOfLine": "lf" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,45 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"dev": "next", | ||
"build": "next build", | ||
"start": "next start" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.5.1", | ||
"date-fns": "^3.3.1", | ||
"gray-matter": "^4.0.3", | ||
"next": "14.1.0", | ||
"react": "^18", | ||
"react-dom": "^18", | ||
"remark": "^15.0.1", | ||
"remark-html": "^16.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"autoprefixer": "^10.0.1", | ||
"postcss": "^8", | ||
"tailwindcss": "^3.3.0", | ||
"typescript": "^5" | ||
} | ||
"name": "smswithoutborders-blog", | ||
"license": "GPL-3.0-only", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next", | ||
"build": "next build", | ||
"start": "next start", | ||
"prepare": "husky install" | ||
}, | ||
"dependencies": { | ||
"classnames": "^2.5.1", | ||
"date-fns": "^3.3.1", | ||
"gray-matter": "^4.0.3", | ||
"next": "14.1.0", | ||
"react": "^18", | ||
"react-dom": "^18", | ||
"remark": "^15.0.1", | ||
"remark-html": "^16.0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"@typescript-eslint/eslint-plugin": "^7.4.0", | ||
"@typescript-eslint/parser": "^7.4.0", | ||
"autoprefixer": "^10.0.1", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-formatter-summary": "^1.1.0", | ||
"eslint-plugin-json": "^3.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react": "^7.34.1", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.2", | ||
"postcss": "^8", | ||
"prettier": "^3.2.5", | ||
"tailwindcss": "^3.3.0", | ||
"typescript": "^5" | ||
}, | ||
"lint-staged": { | ||
"*.js,jsx,ts,tsx": "eslint --cache --fix", | ||
"*.{js,jsx,ts,tsx,json,css,md}": "prettier --cache -w" | ||
} | ||
} |
Oops, something went wrong.