Skip to content

Commit

Permalink
Chore config lint (#8)
Browse files Browse the repository at this point in the history
* chore: config and fix lint w standard

* chore: gha lint

* chore: do lint
  • Loading branch information
gularsson authored Nov 6, 2023
1 parent 45025fb commit 5d9abdb
Show file tree
Hide file tree
Showing 30 changed files with 1,749 additions and 339 deletions.
28 changes: 26 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
module.exports = {
settings: {
react: {
version: 'detect'
}
},
root: true,
env: { browser: true, es2020: true },
env: {
browser: true,
es2021: true,
jest: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'standard-with-typescript'
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
Expand All @@ -14,5 +24,19 @@ module.exports = {
'warn',
{ allowConstantExport: true },
],
},
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"no-multiple-empty-lines": ["warn", { max: 2, maxEOF: 1 }],
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
"@typescript-eslint/space-before-function-paren": ["warn", {
"asyncArrow": "always",
"anonymous": "never",
"named": "never",
}],
"space-before-function-paren": ["warn", {
"asyncArrow": "always",
"anonymous": "never",
"named": "never",
}]
}
}
25 changes: 25 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint code

on:
push:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
registry-url: "https://npm.pkg.github.com"
- name: Install
run: npm ci
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Lint
run: npm run lint
Loading

0 comments on commit 5d9abdb

Please sign in to comment.