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

Auto linter #7

Merged
merged 4 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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