Skip to content

Commit

Permalink
Add eslint and add lint check action (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
marekweb authored Feb 4, 2024
1 parent 0be1888 commit bd31349
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"root": true,
"ignorePatterns": ["dist/"]
}
16 changes: 14 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
- pull_request
- push
jobs:
main:
name: ${{matrix.node}}
tests:
name: Tests on ${{matrix.node}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -17,4 +17,16 @@ jobs:
matrix:
node:
- lts/gallium
- lts/hydrogen
- lts/iron
- node
lint:
name: Lint and format check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "lts/iron"
- run: npm install
- run: npm run lint
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@
],
"scripts": {
"build": "tsc",
"format": "prettier --write .",
"test": "npm run build && node --test"
"check": "npm run lint && npm run format",
"fix": "npm run lint:fix && npm run format:fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"test": "npm run build && node --test",
"lint": "eslint .",
"lint:fix": "eslint --fix ."
},
"exports": "./dist/components.js",
"files": [
Expand All @@ -21,6 +26,8 @@
"types": "./dist/components.d.ts",
"devDependencies": {
"@types/hast": "^3.0.4",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"hastscript": "^9.0.0",
"prettier": "^3.2.5",
"rehype-format": "^5.0.0",
Expand Down

0 comments on commit bd31349

Please sign in to comment.