Skip to content

Commit 2a75a41

Browse files
committed
2 parents 0060cea + 09c6364 commit 2a75a41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+27936
-2905
lines changed

.eslintignore

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# don't ever lint node_modules
22
node_modules
3-
# don't lint build output (make sure it's set to your correct build folder name)
3+
package-lock.json
4+
# don't lint build output
5+
build
46
dist
5-
# don't lint nyc coverage output
6-
coverage
7+
# don't lint coverage output
8+
coverage
9+
# don't lint workflows etc
10+
.github
11+
.idea
12+
.vscode
13+
# unsupported file types
14+
*.yaml
15+
*.yml
16+
*.md

.eslintrc.js

Lines changed: 0 additions & 87 deletions
This file was deleted.

.eslintrc.yaml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
# docs at: https://eslint.org/docs/latest/use/configure/configuration-files
3+
env:
4+
browser: true
5+
es2021: true
6+
react-native/react-native: true
7+
extends:
8+
- airbnb
9+
- airbnb-typescript
10+
- airbnb/hooks
11+
- eslint:recommended
12+
- plugin:@typescript-eslint/recommended
13+
- plugin:@typescript-eslint/stylistic
14+
- plugin:eslint-comments/recommended
15+
- plugin:import/errors
16+
- plugin:import/recommended
17+
- plugin:import/typescript
18+
- plugin:import/warnings
19+
- plugin:jsdoc/recommended
20+
- plugin:json/recommended
21+
- plugin:jsx-a11y/recommended
22+
- plugin:react-hooks/recommended
23+
- plugin:react-native/all
24+
- plugin:react/recommended
25+
- prettier
26+
globals:
27+
JSX: true
28+
parser: '@typescript-eslint/parser'
29+
parserOptions:
30+
ecmaFeatures:
31+
jsx: true
32+
ecmaVersion: latest
33+
project: ./tsconfig.json
34+
sourceType: module
35+
plugins:
36+
- '@typescript-eslint'
37+
- eslint-comments
38+
- eslint-plugin-json
39+
- import
40+
- jsdoc
41+
- jsx-a11y
42+
- react
43+
- react-hooks
44+
- react-native
45+
rules:
46+
'@typescript-eslint/array-type':
47+
- error
48+
- default: 'generic'
49+
readonly: 'generic'
50+
'@typescript-eslint/explicit-function-return-type': error
51+
'@typescript-eslint/explicit-module-boundary-types': error
52+
'@typescript-eslint/no-explicit-any':
53+
- error
54+
- fixToUnknown: false
55+
ignoreRestArgs: false
56+
'@typescript-eslint/no-shadow': error
57+
'@typescript-eslint/no-use-before-define': error
58+
camelcase: error
59+
comma-dangle:
60+
- error
61+
- always-multiline
62+
comma-style:
63+
- error
64+
- last
65+
import/extensions:
66+
- error
67+
- never
68+
import/no-unresolved: error
69+
jsdoc/check-indentation: error
70+
jsdoc/no-bad-blocks: error
71+
jsdoc/require-description: error
72+
jsdoc/require-file-overview: error
73+
jsdoc/require-throws: error
74+
jsx-quotes:
75+
- error
76+
- prefer-single
77+
linebreak-style:
78+
- error
79+
- unix
80+
max-lines:
81+
- error
82+
- 300
83+
max-lines-per-function:
84+
- warn
85+
- max: 20
86+
no-console: error
87+
no-duplicate-imports: error
88+
no-multi-spaces: error
89+
no-shadow: error
90+
no-template-curly-in-string: error
91+
no-trailing-spaces: error
92+
no-undef: error
93+
no-use-before-define: warn
94+
react-native/no-inline-styles: warn
95+
react/jsx-filename-extension:
96+
- error
97+
- extensions:
98+
- .ts
99+
- .tsx
100+
- .js
101+
- .jsx
102+
react/prop-types: error
103+
sort-imports: warn
104+
sort-keys:
105+
- error
106+
- asc
107+
- caseSensitive: true
108+
minKeys: 2
109+
natural: true
9.7 KB
Loading
53.5 KB
Loading
7.13 KB
Loading
45 KB
Loading
14.7 KB
Loading
82.1 KB
Loading

.github/workflows/ci.yaml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
# file format documented at:
3+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
4+
name: CI
5+
6+
on: [push, pull_request]
7+
8+
jobs:
9+
# TODO: check project builds/compiles correctly? maybe with tsc?
10+
# TODO: add tests including coverage (jest and mocha/chai?)
11+
12+
lint_src_files:
13+
name: Lint source files
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
- run: npm ci
22+
- name: Lint source files with Prettier
23+
run: >
24+
npx prettier --check
25+
.
26+
--config
27+
.prettierrc.yaml
28+
--ignore-path
29+
.prettierignore
30+
- name: Lint source files with ESLint
31+
run: >
32+
npx eslint
33+
.
34+
--config
35+
.eslintrc.yaml
36+
--ignore-path
37+
.eslintignore
38+
39+
check-npm-dependencies:
40+
name: Check npm dependencies
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-node@v3
46+
with:
47+
node-version: 18
48+
- run: npm ci
49+
- name: Scan for known vulnerabilities in dependencies with npm audit
50+
run: >
51+
npm audit
52+
--audit-level
53+
critical
54+
- name: Check for unused and missing dependencies with depcheck
55+
run: >
56+
npx depcheck
57+
--ignores
58+
typescript,prettier
59+
- name: Check for outdated packages with npm outdated
60+
run: npm outdated
61+
- name: Check for outdated packages with npm-check-updates
62+
run: npx npm-check-updates
63+
64+
find_todos:
65+
name: Search for TODOs etc
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- name: Search for TODO, FIXME, and BUG statements in source files
70+
run: >
71+
if grep
72+
--recursive
73+
--extended-regexp
74+
--with-filename
75+
--line-number
76+
--color=always
77+
"TODO|FIXME|BUG"
78+
./src;
79+
then exit 1;
80+
else
81+
echo "No TODO, FIXME, or BUG statements found in source files.";
82+
fi
83+
84+
typos_spell_check:
85+
name: Check spelling with typos
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
- name: Check spelling with typos
90+
uses: crate-ci/typos@master
91+
with:
92+
config: .typos.toml
93+
94+
lint_markdown_files:
95+
name: Lint Markdown files
96+
runs-on: ubuntu-latest
97+
steps:
98+
- uses: actions/checkout@v4
99+
- uses: articulate/actions-markdownlint@v1
100+
with:
101+
files: '*.md'
102+
ignore: '**/node_modules'
103+
104+
lint_yaml_files:
105+
name: Lint YAML files
106+
runs-on: ubuntu-latest
107+
steps:
108+
- uses: actions/checkout@v4
109+
- uses: ibiqlik/action-yamllint@v3
110+
111+
lint_shell_script_files:
112+
name: Lint shell scripts
113+
runs-on: ubuntu-latest
114+
steps:
115+
- uses: actions/checkout@v4
116+
- uses: azohra/shell-linter@latest
117+
118+
commitlint:
119+
name: Enforce Conventional Commits
120+
runs-on: ubuntu-latest
121+
steps:
122+
- uses: actions/checkout@v4
123+
- name: >
124+
Check the commits conform to the Conventional
125+
Commits specification with commitlint
126+
uses: wagoid/commitlint-github-action@v5
127+
128+
# TODO: check PRs have all changes (squashed) in(to) 1 commit
129+
# TODO: make semver automatically bump version num and update changelog
130+
# TODO: publish new release if version num bumped and CI passes

0 commit comments

Comments
 (0)