Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Integrate deno_lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Oct 5, 2023
1 parent 033b949 commit acd8dcd
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 39 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,13 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'renovate[bot]' }}
- name: Prevent missing commits after compile
run: git add --intent-to-add . && git diff --exit-code

lint:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: denoland/setup-deno@0df5d9c641efdff149993c321fc27c11c5df8623 # v1.1.3
with:
node-version: 16
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Lint
run: npm run lint:check
deno-version: '1.37.1' # selfup { "regex": "\\d[^']+", "script": "deno --version | head -n 1 | cut -d ' ' -f 2" }
- run: deno lint
17 changes: 9 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "dprint.dprint",
"editor.formatOnSave": true,
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
},
"json.schemas": [
{
"fileMatch": [
"dprint.json"
],
"url": "https://docs.renovatebot.com/renovate-schema.json"
"nix.enableLanguageServer": true,
"nix.serverPath": "nil",
"nix.serverSettings": {
"nil": {
"formatting": {
"command": ["nixpkgs-fmt"]
}
}
]
},
"deno.enable": false
}
29 changes: 6 additions & 23 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,33 +39,16 @@ script = [
"typos . .github .vscode",
]

[tasks.lint-apply]
category = "Tools"
description = "Run linters with changes"
dependencies = [
# TODO: Remove since dropped eslint
# Do not run parallel, because of dprint is superfast and eslint is slow. So sequential makes useful here.
"format-apply",
]
script = [
"npm run lint:fix",
]

[tasks.lint-check]
[tasks.lint]
category = "Tools"
description = "Run linters without changes"
dependencies = [
# TODO: Remove since dropped eslint
# Do not run parallel, because of dprint is superfast and eslint is slow. So sequential makes useful here.
"format-check",
]
script = [
"npm run lint:check",
"dprint check",
"deno lint",
"typos . .github .vscode",
"actionlint",
]

[tasks.lint]
alias = "lint-check"

[tasks.test-ts]
category = "Tools"
description = 'Test typescripts'
Expand All @@ -90,7 +73,7 @@ script = [
[tasks.check]
category = "Tools"
description = 'Parallel runner for all tests and linters'
run_task = { name = ["typos-check", "test-ts", "typecheck", "lint-check"], parallel = true }
run_task = { name = ["typos-check", "test-ts", "typecheck", "lint"], parallel = true }

[tasks.all]
category = "Tools"
Expand Down
9 changes: 9 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"lint": {
"include": ["."],
"exclude": ["dist/", "node_modules/"],
"rules": {
"tags": ["recommended"]
}
}
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
bashInteractive

nodejs_16
deno
dprint
cargo-make
nil
Expand Down

0 comments on commit acd8dcd

Please sign in to comment.