Skip to content

Commit 965b8fa

Browse files
authored
add linter workflows (#1)
* add linter workflows * add missing config files Co-authored-by: Ipek Turgul <ipek.turgul@immutable.com>
1 parent fe0b354 commit 965b8fa

File tree

9 files changed

+252
-0
lines changed

9 files changed

+252
-0
lines changed

.env.example

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#=============================================
2+
# General
3+
#=============================================
4+
ALCHEMY_API_KEY=
5+
# IMX API endpoint
6+
PUBLIC_API_URL=https://api.ropsten.x.immutable.com/v1
7+
STARK_CONTRACT_ADDRESS=0x4527BE8f31E2ebFbEF4fCADDb5a17447B27d2aef
8+
REGISTRATION_ADDRESS=0x6C21EC8DE44AE44D0992ec3e2d9f1aBb6207D864
9+
GAS_LIMIT=7000000
10+
GAS_PRICE=40000000000
11+
12+
#=============================================
13+
# Bulk Minting
14+
#=============================================
15+
PRIVATE_KEY1=
16+
TOKEN_ID=
17+
TOKEN_ADDRESS=
18+
BULK_MINT_MAX=50
19+
20+
#=============================================
21+
# Onboarding
22+
#=============================================
23+
OWNER_ACCOUNT_PRIVATE_KEY=
24+
COLLECTION_CONTRACT_ADDRESS=
25+
COLLECTION_PROJECT_ID=
26+
27+
28+
#=============================================
29+
# Logger
30+
#=============================================
31+
LOG_LEVEL=DEBUG
32+
# Only log from the following components
33+
LOG_COMPONENT_FILTER=
34+
# Comma separated list of log handlers eg. CONSOLE_HUMAN,CONSOLE_JSON,FILE_JSON
35+
LOG_HANDLERS=CONSOLE_HUMAN
36+
LOG_HANDLER_CONSOLE_HUMAN_TYPE=console
37+
LOG_HANDLER_CONSOLE_HUMAN_ENCODER=human
38+
LOG_HANDLER_CONSOLE_JSON_TYPE=console
39+
LOG_HANDLER_CONSOLE_JSON_ENCODER=json
40+
LOG_HANDLER_FILE_JSON_TYPE=file
41+
LOG_HANDLER_FILE_JSON_ENCODER=json
42+
LOG_HANDLER_FILE_JSON_FILENAME=wallet.log

.eslintignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# config files
7+
.eslintrc.js
8+
9+
# Build folder
10+
dist/
11+
12+
# Diagnostic reports (https://nodejs.org/api/report.html)
13+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
14+
15+
# Runtime data
16+
pids
17+
*.pid
18+
*.seed
19+
*.pid.lock
20+
21+
# Directory for instrumented libs generated by jscoverage/JSCover
22+
lib-cov
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage
26+
*.lcov
27+
28+
# nyc test coverage
29+
.nyc_output
30+
31+
# Package managers:
32+
.grunt
33+
bower_components
34+
node_modules/
35+
jspm_packages/
36+
37+
# TypeScript cache
38+
*.tsbuildinfo
39+
40+
# Optional npm cache directory
41+
.npm
42+
43+
# Optional eslint cache
44+
.eslintcache
45+
46+
# Output of 'npm pack'
47+
*.tgz
48+
49+
# dotenv environment variables file
50+
.env
51+
.env.test
52+
53+
# parcel-bundler cache (https://parceljs.org/)
54+
.cache
55+
56+
packages/

.eslintrc.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
},
6+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
7+
parserOptions: {
8+
ecmaVersion: 12,
9+
sourceType: 'module',
10+
project: './tsconfig.eslint.json',
11+
},
12+
plugins: ['@typescript-eslint', 'simple-import-sort', 'fp-ts'],
13+
extends: [
14+
'plugin:@typescript-eslint/recommended',
15+
'plugin:fp-ts/all',
16+
'airbnb-typescript/base',
17+
// @NOTE: Make sure this is always the last element in the array.
18+
'plugin:prettier/recommended',
19+
],
20+
rules: {
21+
'@typescript-eslint/no-unused-vars': [
22+
'warn',
23+
{
24+
vars: 'all',
25+
varsIgnorePattern: '^_',
26+
args: 'after-used',
27+
argsIgnorePattern: '^_',
28+
},
29+
],
30+
'@typescript-eslint/no-namespace': 'off',
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
'@typescript-eslint/explicit-module-boundary-types': 'off',
33+
'@typescript-eslint/ban-ts-comment': 'off',
34+
'simple-import-sort/imports': 'warn',
35+
'simple-import-sort/exports': 'error',
36+
'no-nested-ternary': 'off',
37+
'no-console': 'off',
38+
'arrow-body-style': 'off',
39+
'import/prefer-default-export': 'off',
40+
'@typescript-eslint/no-redeclare': 'off',
41+
'@typescript-eslint/no-use-before-define': 'off',
42+
'@typescript-eslint/no-unused-expressions': 'off',
43+
'class-methods-use-this': 'off',
44+
'no-async-promise-executor': 'off',
45+
'no-restricted-properties': 'off',
46+
'import/no-cycle': 'off',
47+
},
48+
};

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @dlip-immutable @ipekt @allan-almeida @lrepolho

.github/issue_template.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Issue tracker is **ONLY** used for reporting bugs.
2+
3+
<!--- Provide a general summary of the issue in the Title above -->
4+
5+
## Expected Behavior
6+
<!--- Tell us what should happen -->
7+
8+
## Current Behavior
9+
<!--- Tell us what happens instead of the expected behavior -->
10+
11+
## Possible Solution
12+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
13+
14+
## Steps to Reproduce
15+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
16+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
17+
1.
18+
2.
19+
3.
20+
4.
21+
22+
## Context (Environment)
23+
<!--- How has this issue affected you? What are you trying to accomplish? -->
24+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
25+
26+
<!--- Provide a general summary of the issue in the Title above -->
27+
28+
## Detailed Description
29+
<!--- Provide a detailed description of the change or addition you are proposing -->
30+
31+
## Possible Implementation
32+
<!--- Not obligatory, but suggest an idea for implementing addition or change -->

.github/pull_request_template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Summary
2+
<!--- A short summary about what this PR is doing. -->
3+
4+
5+
# Why the changes
6+
<!--- State the reason/context for the change. -->
7+
8+
9+
# Things worth calling out
10+
<!--- Give useful tips/gotchas/trade-offs made to the reviewers. -->

.github/workflows/lint.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: Lint
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Check NPM Package Lock File Version
22+
uses: mansona/npm-lockfile-version@v1
23+
24+
- name: Use Node.js 12.22.6
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: 12.22.6
28+
29+
- name: Install npm 7.x
30+
run: npm i -g npm@7
31+
32+
- name: Cache node modules
33+
uses: actions/cache@v2
34+
env:
35+
cache-name: node-modules
36+
with:
37+
path: ~/.npm
38+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
39+
restore-keys: |
40+
${{ runner.os }}-build-${{ env.cache-name }}-
41+
${{ runner.os }}-build-
42+
${{ runner.os }}-
43+
44+
- name: Install dependencies
45+
run: npm ci
46+
47+
- name: Lint
48+
run: npm run lint

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
/.env
3+
/.yalc
4+
yalc.lock

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"bracketSpacing": true,
8+
"jsxBracketSameLine": false,
9+
"trailingComma": "all",
10+
"arrowParens": "avoid"
11+
}

0 commit comments

Comments
 (0)