Skip to content

Commit 15b2e35

Browse files
authored
Merge pull request #682 from taeh98/dev-5.x
Added CI GitHub Actions workflow and updated ESLint and Prettier configs
2 parents 717234c + 2b782e4 commit 15b2e35

File tree

9 files changed

+10563
-112
lines changed

9 files changed

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

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
# docs at: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
3+
name: CI
4+
5+
on: [push, pull_request]
6+
7+
jobs:
8+
run-eslint:
9+
name: Lint source files with ESLint
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
- run: npm ci
18+
- name: Run ESLint
19+
run: >
20+
npx eslint
21+
.
22+
--config
23+
.eslintrc.yaml
24+
--ignore-path
25+
.eslintignore
26+
27+
run-prettier:
28+
name: Lint source files with Prettier
29+
runs-on: ubuntu-latest
30+
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-node@v3
34+
with:
35+
node-version: 18
36+
- run: npm ci
37+
- run: >
38+
npx prettier --check
39+
.
40+
--config
41+
.prettierrc.yaml
42+
--ignore-path
43+
.prettierignore
44+
45+
run-npm-audit:
46+
name: Scan for known vulnerabilities in dependencies with npm audit
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- uses: actions/checkout@v3
51+
- uses: actions/setup-node@v3
52+
with:
53+
node-version: 18
54+
- run: npm ci
55+
- run: >
56+
npm audit
57+
--audit-level
58+
critical
59+
60+
run-npm-depcheck:
61+
name: Check for unused and missing dependencies with depcheck
62+
runs-on: ubuntu-latest
63+
64+
steps:
65+
- uses: actions/checkout@v3
66+
- uses: actions/setup-node@v3
67+
with:
68+
node-version: 18
69+
- run: npm ci
70+
- run: >
71+
npx depcheck
72+
--ignores
73+
typescript,prettier
74+
75+
run-npm-outdated:
76+
name: Check for outdated packages with npm outdated
77+
runs-on: ubuntu-latest
78+
79+
steps:
80+
- uses: actions/checkout@v3
81+
- uses: actions/setup-node@v3
82+
with:
83+
node-version: 18
84+
- run: npm ci
85+
- run: npm outdated
86+
87+
# TODO: check project builds/compiles correctly
88+
# TODO: add tests

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
node_modules
2-
3-
package-lock.json
4-
.vscode/*
2+
#package-lock.json
3+
# package-lock.json should be in source control.
4+
# see here: https://stackoverflow.com/questions/44206782/do-i-commit-the-package-lock-json-file-created-by-npm-5
5+
.vscode/*
6+
.idea

.prettierignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# don't ever lint node_modules
2+
node_modules
3+
package-lock.json
4+
# don't lint build output
5+
build
6+
dist
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

.prettierrc.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
# docs at: https://prettier.io/docs/en/configuration.html
3+
arrowParens: always
4+
bracketSameLine: true
5+
bracketSpacing: true
6+
embeddedLanguageFormatting: auto
7+
endOfLine: lf
8+
htmlWhitespaceSensitivity: css
9+
insertPragma: false
10+
jsxSingleQuote: true
11+
printWidth: 80
12+
proseWrap: preserve
13+
quoteProps: consistent
14+
requirePragma: false
15+
semi: true
16+
singleQuote: true
17+
tabWidth: 2
18+
trailingComma: all
19+
useTabs: false

0 commit comments

Comments
 (0)