Skip to content

Commit

Permalink
Run prettier on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Mar 7, 2021
1 parent a5973ea commit 677b2fd
Show file tree
Hide file tree
Showing 35 changed files with 214 additions and 197 deletions.
4 changes: 1 addition & 3 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"node": "12.9",
"browsers": ">1%, not ie 11"
},
"exclude": [
"transform-regenerator"
]
"exclude": ["transform-regenerator"]
}
],
"@babel/typescript"
Expand Down
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "2" # required to adjust maintainability checks
version: "2" # required to adjust maintainability checks

checks:
argument-count:
Expand Down
146 changes: 78 additions & 68 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,87 +4,95 @@ module.exports = {
browser: true,
es6: true,
node: true,
mocha: true
mocha: true,
},
globals: {
BigInt: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 10,
project: "./tsconfig.json"
project: "./tsconfig.json",
},
plugins: [
"@typescript-eslint",
"eslint-plugin-import",
"eslint-plugin-node",
"no-only-tests",
"prettier"
],
plugins: ["@typescript-eslint", "eslint-plugin-import", "eslint-plugin-node", "no-only-tests", "prettier"],
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended"
"plugin:@typescript-eslint/recommended",
],
rules: {
"prettier/prettier": "error",
//doesnt work, it reports false errors
"constructor-super": "off",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/naming-convention": ["error",
{selector: "default", format: ['camelCase']},
{selector: ["classProperty", "objectLiteralProperty", "classMethod", "parameter"], format: ['camelCase'], leadingUnderscore: "allow"},
//variable must be in camel or upper case
{selector: "variable", format: ["camelCase", "UPPER_CASE"], leadingUnderscore: "allow"},
//classes and types must be in PascalCase
{selector: ["typeLike", "enum"], format: ['PascalCase']},
{selector: "enumMember", format: null},
//interface must start with I
{selector: "interface", format: ['PascalCase'], prefix: ["I"]},
//ignore rule for quoted stuff
{
selector: [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember"
],
format: null,
modifiers: ["requiresQuotes"]
},
//ignore rules on destructured params
{
selector: "variable",
modifiers: ["destructured"],
format: null
}
],
"@typescript-eslint/explicit-function-return-type": ["error", {
"allowExpressions": true
}],
"@typescript-eslint/naming-convention": [
"error",
{selector: "default", format: ["camelCase"]},
{
selector: ["classProperty", "objectLiteralProperty", "classMethod", "parameter"],
format: ["camelCase"],
leadingUnderscore: "allow",
},
//variable must be in camel or upper case
{selector: "variable", format: ["camelCase", "UPPER_CASE"], leadingUnderscore: "allow"},
//classes and types must be in PascalCase
{selector: ["typeLike", "enum"], format: ["PascalCase"]},
{selector: "enumMember", format: null},
//interface must start with I
{selector: "interface", format: ["PascalCase"], prefix: ["I"]},
//ignore rule for quoted stuff
{
selector: [
"classProperty",
"objectLiteralProperty",
"typeProperty",
"classMethod",
"objectLiteralMethod",
"typeMethod",
"accessor",
"enumMember",
],
format: null,
modifiers: ["requiresQuotes"],
},
//ignore rules on destructured params
{
selector: "variable",
modifiers: ["destructured"],
format: null,
},
],
"@typescript-eslint/explicit-function-return-type": [
"error",
{
allowExpressions: true,
},
],
"@typescript-eslint/func-call-spacing": "error",
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unused-vars": ["error", {
"varsIgnorePattern": "^_"
}],
"@typescript-eslint/no-unused-vars": [
"error",
{
varsIgnorePattern: "^_",
},
],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/semi": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-floating-promises": "error",
"import/no-extraneous-dependencies": ["error", {
"devDependencies": false,
"optionalDependencies": false,
"peerDependencies": false
}],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: false,
optionalDependencies: false,
peerDependencies: false,
},
],
"func-call-spacing": "off",
//if --fix is run it messes imports like /lib/presets/minimal & /lib/presets/mainnet
"import/no-duplicates": "off",
Expand All @@ -100,27 +108,29 @@ module.exports = {
"object-literal-sort-keys": 0,
"no-prototype-builtins": 0,
"prefer-const": "error",
"quotes": ["error", "double"],
"semi": "off",
quotes: ["error", "double"],
semi: "off",

// Prevents accidentally pushing a commit with .only in Mocha tests
"no-only-tests/no-only-tests": "error"
"no-only-tests/no-only-tests": "error",
},
"overrides": [
overrides: [
{
"files": ["**/test/**/*.ts"],
"rules": {
files: ["**/test/**/*.ts"],
rules: {
"import/no-extraneous-dependencies": "off",
"@typescript-eslint/no-explicit-any": "off"
}
"@typescript-eslint/no-explicit-any": "off",
},
},
{
"files": ["**/lodestar-types/**/*.ts"],
"rules": {
"@typescript-eslint/naming-convention": ["off",
{ selector: "interface", prefix: ["I"]},
{selector: "interface", format: ['PascalCase'], prefix: ["I"]},],
}
files: ["**/lodestar-types/**/*.ts"],
rules: {
"@typescript-eslint/naming-convention": [
"off",
{selector: "interface", prefix: ["I"]},
{selector: "interface", format: ["PascalCase"], prefix: ["I"]},
],
},
},
]
],
};
14 changes: 9 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
name: Bug report
about: Create a report to help us improve

---

<!--NOTE: -->
<!--- General questions should go to the discord chat instead of the issue tracker.-->

**Describe the bug**

<!--A clear and concise description of what the bug is and steps to reproduce it.-->

**Expected behavior**

<!--A clear and concise description of what you expected to happen.-->

**Steps to Reproduce**

<!--Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
Expand All @@ -22,10 +24,12 @@ about: Create a report to help us improve
-->

**Screenshots**

<!--If applicable, add screenshots to help explain your problem.-->

**Desktop (please complete the following information):**
- OS: <!--[e.g. ubuntu, OSX High Siera]-->
- Version: <!--[e.g. 22]-->
- Branch: <!--[Master]-->
- Commit hash: <!--[e8232]-->

- OS: <!--[e.g. ubuntu, OSX High Siera]-->
- Version: <!--[e.g. 22]-->
- Branch: <!--[Master]-->
- Commit hash: <!--[e8232]-->
7 changes: 5 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project

---

<!--NOTE:
<!--NOTE:
- General questions should go to the discord chat instead of the issue tracker.
-->

**Is your feature request related to a problem? Please describe.**

<!--A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]-->

**Describe the solution you'd like**

<!--A clear and concise description of what you want to happen.-->

**Describe alternatives you've considered**

<!--A clear and concise description of any alternative solutions or features you've considered.-->

**Additional context**

<!--Add any other context or screenshots about the feature request here.-->
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/general_question.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: Architecture/Planning Question
about: Suggest an idea for this project

---

<!--
NOTE:
NOTE:
- General questions should go to the discord chat instead of the issue tracker.
-->

**What is your question?**

<!--A clear and concise description of what the problem is.-->
29 changes: 14 additions & 15 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
daysUntilStale: 60

# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
Expand All @@ -12,18 +12,18 @@ onlyLabels: []

# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- "PR state: on-ice"
- "Good First Issue"
- "Status: On Ice"
- "Priority: 4 - Low"
- "Priority: 3 - Medium"
- "Priority: 2 - High"
- "Priority: 1 - Critical"
- "discussion"
- "Discussion"
- "Epic"
- "Good First Issue"
- "help wanted"
- "PR state: on-ice"
- "Good First Issue"
- "Status: On Ice"
- "Priority: 4 - Low"
- "Priority: 3 - Medium"
- "Priority: 2 - High"
- "Priority: 1 - Critical"
- "discussion"
- "Discussion"
- "Epic"
- "Good First Issue"
- "help wanted"

# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
Expand All @@ -49,11 +49,10 @@ markComment: >

# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue or pull request has been automatically been closed due to inactivity.
This issue or pull request has been automatically been closed due to inactivity.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 30

# Limit to only `issues` or `pulls`
# only: issues

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
branches:
- 'master'
- "master"

jobs:
tag:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Nodejs
uses: actions/setup-node@v1
with:
Expand All @@ -54,7 +54,7 @@ jobs:
node_modules
packages/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-ignore-optional

- name: Install & build
if: steps.cache-deps.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --ignore-optional
Expand Down Expand Up @@ -92,10 +92,10 @@ jobs:
prerelease: true # we can promote to release trough github

- name: Publish to npm registry
run: yarn run publish
run: yarn run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

#in case of failure
- name: Rollback on failure
if: failure()
Expand All @@ -119,4 +119,4 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: docker build --tag chainsafe/lodestar:${{ needs.tag.outputs.tag }} .
- run: docker push chainsafe/lodestar:${{ needs.tag.outputs.tag }}
- run: docker push chainsafe/lodestar:${{ needs.tag.outputs.tag }}
Loading

0 comments on commit 677b2fd

Please sign in to comment.