Skip to content

Commit d01c36d

Browse files
committed
feat: initial commit with github action to update notion tasks
1 parent 0a4f9d8 commit d01c36d

File tree

8 files changed

+2041
-0
lines changed

8 files changed

+2041
-0
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintrc.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
commonjs: true,
5+
es2021: true,
6+
},
7+
extends: 'eslint:recommended',
8+
parserOptions: {
9+
ecmaVersion: 13,
10+
},
11+
globals: {
12+
process: 'readonly',
13+
},
14+
rules: {
15+
'no-extend-native': [ 'error', { exceptions: [ 'Array' ] } ],
16+
'no-global-assign': [ 'error', { exceptions: [ 'self' ] } ],
17+
'generator-star-spacing': 'off',
18+
// eslint-disable-next-line no-undef
19+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
20+
'no-trailing-spaces': [ 'error', { skipBlankLines: true } ],
21+
'array-bracket-spacing': [ 'error', 'always' ],
22+
'arrow-body-style': [ 'warn', 'as-needed' ],
23+
'standard/no-callback-literal': 0,
24+
'comma-dangle': [
25+
'warn',
26+
{
27+
arrays: 'always-multiline',
28+
objects: 'always-multiline',
29+
imports: 'never',
30+
exports: 'never',
31+
functions: 'ignore',
32+
},
33+
],
34+
'curly': [ 'warn', 'multi-line' ],
35+
'eol-last': [ 'error', 'always' ],
36+
'indent': [ 'error', 2, { SwitchCase: 1, VariableDeclarator: 1 } ],
37+
'max-len': [
38+
'warn',
39+
{
40+
code: 140,
41+
ignoreComments: true,
42+
ignoreTrailingComments: true,
43+
ignoreStrings: true,
44+
ignorePattern: '.+=".+"',
45+
},
46+
],
47+
'no-multiple-empty-lines': [ 'error', { max: 1, maxEOF: 1 } ],
48+
'no-prototype-builtins': 0,
49+
'object-curly-spacing': [ 'error', 'always' ],
50+
'object-property-newline': [ 'error', { allowAllPropertiesOnSameLine: true } ],
51+
'padded-blocks': 'off',
52+
'prefer-const': [ 'error', { destructuring : 'all' } ],
53+
'prefer-template': 'error',
54+
'quote-props': [ 'error', 'consistent-as-needed' ],
55+
'quotes': [
56+
'error',
57+
'single',
58+
{
59+
avoidEscape: true,
60+
// TODO: Remove this rule and autofix,
61+
// as we don't need useless template literals
62+
allowTemplateLiterals: true,
63+
},
64+
],
65+
'semi': [ 'error', 'never', { beforeStatementContinuationChars: 'never' } ],
66+
'space-before-function-paren': [ 'warn', 'always' ],
67+
'spaced-comment': [
68+
'error',
69+
'always',
70+
{
71+
block: {
72+
markers: [ '!' ],
73+
},
74+
},
75+
],
76+
},
77+
}

.github/workflows/eslint.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This is a basic workflow to help you get started with Actions
2+
name: Lint
3+
4+
# Controls when the action will run. Triggers the workflow on push or pull request
5+
# events but on dev and staging branches
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
- 'feature/**'
11+
- 'features/**'
12+
push:
13+
branches:
14+
- main
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
prepare:
19+
name: Prepare & Cleanup Previous Runs
20+
if: always()
21+
runs-on: ubuntu-latest
22+
outputs:
23+
commit_message: ${{ steps.get_message.outputs.commit_message }}
24+
25+
steps:
26+
- uses: actions/checkout@v1
27+
- uses: rokroskar/[email protected]
28+
env:
29+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30+
- id: get_message
31+
name: Set Commit Message
32+
run: echo ::set-output name=commit_message::$(git log --format=%B -n 1 ${{ github.event.after }})
33+
- name: Show Commit Message
34+
run: echo "${{ steps.get_message.outputs.commit_message }}"
35+
36+
lint-and-units:
37+
name: ESLint
38+
needs: prepare
39+
timeout-minutes: 45
40+
if: (github.event.pull_request.draft == false) && !startsWith(github.head_ref, 'tech') && !startsWith(github.head_ref, 'doc') && !contains(needs.prepare.outputs.commit_message, '[skip ci]')
41+
# The type of runner that the job will run on
42+
runs-on: ubuntu-18.04
43+
steps:
44+
- name: Show Commit Message
45+
run: echo "${{ needs.prepare.outputs.commit_message }}"
46+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
47+
- uses: actions/checkout@v2
48+
- name: Use Node.js
49+
uses: actions/setup-node@v1
50+
with:
51+
node-version: '16.x'
52+
- name: Run ESLint
53+
if: always()
54+
run: npm run lint

0 commit comments

Comments
 (0)