Skip to content

Commit

Permalink
chore: include linter dotfiles
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Stewart <[email protected]>
  • Loading branch information
paralin committed Apr 20, 2024
1 parent e0a1519 commit 730f164
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parserOptions: {
project: './tsconfig.json',
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
}
}
67 changes: 67 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
linters:
enable:
- depguard
- goimports
- gosec
- gosimple
- govet
- importas
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
- unconvert
- unused

disable:
- errcheck

run:
concurrency: 4
modules-download-mode: vendor

skip-dirs:
- hack

linters-settings:
staticcheck:
checks:
- all
- '-SA1012' # Allow passing nil contexts.

importas:
# Do not allow unaliased imports of aliased packages.
no-unaliased: true

maligned:
suggest-new: true

depguard:
rules:
main:
deny:
- pkg: io/ioutil
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
- pkg: "github.com/stretchr/testify/assert"
desc: Use "gotest.tools/v3/assert" instead
- pkg: "github.com/stretchr/testify/require"
desc: Use "gotest.tools/v3/assert" instead
- pkg: "github.com/stretchr/testify/suite"
desc: Do not use

revive:
rules:
- name: package-comments
disabled: true

gosec:
excludes:
- G306 # Allow WriteFile permissions to be 0644.

issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0

# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
4 changes: 4 additions & 0 deletions .ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
*.pb.go
*.pb.ts
go.sum
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://github.com/aperturerobotics/protobuf-project
# https://github.com/aperturerobotics/template

SHELL:=bash
PROTOWRAP=hack/bin/protowrap
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ module github.com/aperturerobotics/template
go 1.22

require (
github.com/aperturerobotics/protobuf-go-lite v0.3.1 // indirect; latest
github.com/aperturerobotics/protobuf-go-lite v0.3.1 // latest
github.com/aperturerobotics/starpc v0.30.0 // latest
)

require github.com/pkg/errors v0.9.1

require (
github.com/aperturerobotics/util v1.17.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
Expand All @@ -28,7 +30,6 @@ require (
github.com/multiformats/go-multihash v0.2.3 // indirect
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test:js": "echo No JS tests.",
"lint": "npm run lint:go && npm run lint:js",
"lint:go": "make lint",
"lint:js": "ESLINT_USE_FLAT_CONFIG=false eslint -c .eslintrc.js ./",
"lint:js": "ESLINT_USE_FLAT_CONFIG=false eslint -c .eslintrc.js ./example",
"patch": "patch-package --use-yarn --patch-dir ./node_modules/@aperturerobotics/ts-common/patches",
"prepare": "npm run patch && go mod vendor",
"precommit": "npm run format"
Expand Down
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@
"strict": true,
"lib": ["webworker", "dom"]
},
"exclude": ["node_modules", "vendor", "dist"],
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": true
}
"include": ["example"]
}

0 comments on commit 730f164

Please sign in to comment.