Skip to content

Commit

Permalink
Merge pull request #7 from fac31/auto-linter
Browse files Browse the repository at this point in the history
Auto linter
  • Loading branch information
sulphite authored Apr 16, 2024
2 parents 7d4cc37 + d99641f commit 007bfb8
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 18 deletions.
33 changes: 33 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"overrides": [
{
"files": [
"src/**/*.js",
"src/**/*.ts"
]
}
],
"rules": {
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/consistent-type-definitions": [
"error",
"type"
]
},
"env": {
"node": true,
"es2021": true
}
}
21 changes: 21 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: linter
on:
pull_request:

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: install dependencies
run: npm install

- name: run eslint
run: npm run lint
17 changes: 0 additions & 17 deletions eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"lint": "eslint --ignore-path .eslintignore --ext .js,.ts",
"lint": "eslint src --ignore-path .eslintignore --ext .js,.ts",
"start": "ts-node src/index.ts"
},
"repository": {
Expand Down

0 comments on commit 007bfb8

Please sign in to comment.