Skip to content

Commit

Permalink
chore: fix formatting and linting issues (#1772)
Browse files Browse the repository at this point in the history
* chore: fix formatting and linting issues

* chore: remove unused declarations rule

* fix: add missing dev dependency

* fix: remove eslint rule consistent-return

* fix: remove eslint rule consistent-destructuring

* removed done from test block

* chore(test): update the coverage directory paths in jest

* refactor: remove unnecessary condition in if block

* chore: ignore reports

* chore: clean up gitignore

* chore: add more tooling for commit guard rails

* chore: add missing file

* chore: add prepare script

* chore: ignore unwanted files in eslint config

* chore: empty commit to trigger automated actions

Co-authored-by: Jayc <[email protected]>
  • Loading branch information
saikumarrs and Jayachand authored Jan 16, 2023
1 parent 3676c45 commit fb8b818
Show file tree
Hide file tree
Showing 898 changed files with 31,196 additions and 43,317 deletions.
21 changes: 17 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
__tests__/*
__mocks__/*
logger.js
build.js
node_modules/
.husky/
reports/
*.md
*.test.js
test/**/*.js
src/util/lodash-es-core.js
**/ivm*.js
**/custom*.js
**/warehouse/
**/lambda/
**/openfaas/
src/util/url-search-params.min.js
src/logger.js
src/util/eventValidations.js
**/trackingPlan*
src/v0/destinations/personalize/scripts/
36 changes: 0 additions & 36 deletions .eslintrc.js

This file was deleted.

37 changes: 37 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"node": true,
"es2021": true,
"jest": true,
"commonjs": true
},
"extends": ["airbnb-base", "prettier", "plugin:json/recommended"],
"plugins": ["unicorn"],
"globals": {},
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"unicorn/filename-case": [
"off",
{ "cases": { "camelCase": true, "pascalCase": true, "kebabCase": true } }
],
"unicorn/no-instanceof-array": "error",
"unicorn/no-static-only-class": "error",
"unicorn/consistent-destructuring": "error",
"unicorn/better-regex": "error",
"unicorn/no-for-loop": "error",
"unicorn/prefer-array-some": "error",
"unicorn/explicit-length-check": "error",
"unicorn/prefer-array-find": "error",
"unicorn/no-lonely-if": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-array-flat-map": "error",
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/prefer-export-from": "error",
"import/no-dynamic-require": "warn",
"no-param-reassign": "warn"
}
}
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: 'BUG: '
labels: ''
assignees: ItsSudip, krishna2020, sandeepdsvs, shrouti1507

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: 'FEATURE REQUEST: '
labels: ''
assignees: ItsSudip, krishna2020, sandeepdsvs, shrouti1507

---

**Is your feature request related to a problem? Please describe.**
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/housekeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Handle stale PRs

on:
schedule:
- cron: "42 1 * * *"
- cron: '42 1 * * *'

jobs:
prs:
Expand All @@ -17,10 +17,10 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
operations-per-run: 200
stale-pr-message: "This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR."
stale-pr-message: 'This PR is considered to be stale. It has been open 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.'
days-before-pr-stale: 20
days-before-pr-close: 7
stale-pr-label: "Stale"
stale-pr-label: 'Stale'

branches:
name: Cleanup old branches
Expand All @@ -32,7 +32,7 @@ jobs:
uses: beatlabs/[email protected]
with:
repo_token: ${{ github.token }}
date: "6 months ago"
date: '6 months ago'
dry_run: false
delete_tags: false
extra_protected_branch_regex: ^(main|master|release.*|rudder-saas)$
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/master-bulids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build transformer master image
on:
push:
branches:
- "master"
- 'master'
env:
REPO_NAME: rudderlabs/develop-rudder-transformer

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-description-enforcer.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Pull Request Description"
name: 'Pull Request Description'
on:
pull_request:
types:
Expand All @@ -13,4 +13,4 @@ jobs:
steps:
- uses: rudderlabs/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
repo-token: '${{ secrets.GITHUB_TOKEN }}'
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- "master"
- 'master'

name: release-please
jobs:
Expand All @@ -16,7 +16,7 @@ jobs:
id: release
with:
token: ${{ github.token }}
pull-request-title-pattern: "chore: release ${version}"
pull-request-title-pattern: 'chore: release ${version}'
release-type: node
package-name: rudder-transformer
default-branch: ${{ steps.extract_branch.outputs.branch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/saas-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build transformer release image
on:
push:
branches:
- "rudder-saas"
- 'rudder-saas'
env:
REPO_NAME: rudderlabs/rudder-transformer

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Semantic pull requests"
name: 'Semantic pull requests'

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
- name: Jest
run: npm run test
- name: Jest Integration test
run: npm run test:integration
run: npm run test:integration
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@
.env
node_modules
npm-debug.log
/coverage/*

temp.json
temp_out.json
reports/*
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run commit-msg
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run pre-commit
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.15.1
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
reports/
CHANGELOG.md
CONTRIBUTING.md
LICENSE
test/**/*.js
src/util/lodash-es-core.js
src/util/url-search-params.min.js
6 changes: 4 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"arrowParens": "avoid",
"trailingComma": "all",
"tabWidth": 2,
"files": ["*.js", "*.json"]
"semi": true,
"singleQuote": true,
"printWidth": 100
}
12 changes: 12 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"bumpFiles": [
{
"filename": "package.json",
"type": "json"
},
{
"filename": "package-lock.json",
"type": "json"
}
]
}
5 changes: 1 addition & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/benchmark",
"args": [
"--destinations=${input:destinations}",
"--feature=${input:feature}"
],
"args": ["--destinations=${input:destinations}", "--feature=${input:feature}"],
"runtimeArgs": ["--nolazy"],
"sourceMaps": true,
"runtimeExecutable": "/usr/local/bin/node"
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ Now you can run `make test`.

If you wish you can destroy the cluster manually with `make destroy`.


## Contact Us

If you come across any issues while setting up or running the RudderStack Transformer, feel free to start a conversation on our [Slack](https://resources.rudderstack.com/join-rudderstack-slack) channel.
2 changes: 1 addition & 1 deletion appspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ files:
destination: /home/ubuntu/rudder-transformer
permissions:
- object: /home/ubuntu/rudder-transformer
pattern: "**"
pattern: '**'
owner: ubuntu
group: ubuntu
mode: 755
Expand Down
Loading

0 comments on commit fb8b818

Please sign in to comment.