Skip to content

SNOW-2112371 Add prettier and format the repo #1073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 20 additions & 41 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,61 +1,40 @@
module.exports = {
'env': {
'browser': true,
'commonjs': true,
'es2021': true,
'mocha': true,
'node': true
env: {
browser: true,
commonjs: true,
es2021: true,
mocha: true,
node: true,
},
'extends': 'eslint:recommended',
'overrides': [
extends: 'eslint:recommended',
overrides: [
{
'files': ['samples/*.js'],
'rules': {
files: ['samples/*.js'],
rules: {
'no-console': ['off'],
}
}
},
},
],
'parserOptions': {
'ecmaVersion': 'latest'
parserOptions: {
ecmaVersion: 'latest',
},
'rules': {
'array-bracket-spacing': ['error'],
'arrow-spacing': ['error'],
'block-spacing': ['error'],
'brace-style': ['error', '1tbs'],
'camelcase': ['error'],
'comma-spacing': ['error'],
'curly': ['error', 'all'],
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
'indent': ['error', 2],
'key-spacing': ['error'],
'keyword-spacing': ['error'],
'linebreak-style': ['error', 'unix'],
rules: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed all rules that are defaults in prettier

camelcase: ['error'],
curly: ['error', 'all'],
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-async-promise-executor': ['error'],
'no-console': ['error', { 'allow': ['warn', 'error'] }],
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-empty': ['error'],
'no-ex-assign': ['error'],
'no-extra-semi': ['error'],
'no-inner-declarations': ['error'],
'no-loss-of-precision': ['error'],
'no-mixed-spaces-and-tabs': ['error'],
'no-prototype-builtins': ['error'],
'no-redeclare': ['error'],
'no-undef': ['error'],
'no-unused-vars': ['error'],
'no-useless-catch': ['error'],
'no-useless-escape': ['error'],
'no-var': ['error'],
'object-curly-spacing': ['error', 'always'],
'prefer-const': ['error'],
'quotes': ['error', 'single'],
'semi': ['error', 'always'],
'semi-spacing': ['error'],
'space-before-function-paren': ['error', {
'anonymous': 'always',
'named': 'never',
'asyncArrow': 'always',
}],
'space-infix-ops': ['error'],
}
},
};
24 changes: 7 additions & 17 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,34 @@ about: Something isn't working as expected? Here is the right place to report.
labels: bug
---

If you need **urgent assistance** then [file a case with Snowflake Support](https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge).
Otherwise continue here.

If you need **urgent assistance** then [file a case with Snowflake Support](https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge).
Otherwise continue here.


Please answer these questions before submitting your issue.
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

1. What version of NodeJS driver are you using?


2. What operating system and processor architecture are you using?


3. What version of NodeJS are you using?
(`node --version` and `npm --version`)

(`node --version` and `npm --version`)

4. What are the component versions in the environment (`npm list`)?


5. What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program would be the most helpful.


6. What did you expect to see?

What should have happened and what happened instead?


7. Can you collect debug logs?

https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

e.g
Add this to get TRACE logs sent to standard output.
e.g
Add this to get TRACE logs sent to standard output.

```
var snowflake = require('snowflake-sdk');
Expand All @@ -52,4 +42,4 @@ snowflake.configure(
```

:warning: Before sharing any data, please be sure to review the log and remove any sensitive
information.
information.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature Request 💡
about: Suggest a new idea for the project.
about: Suggest a new idea for the project.
labels: feature
---

Expand Down
3 changes: 2 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### Description

Please explain the changes you made here.

### Checklist
- [ ] Format code according to the existing code style (run `npm run lint:check -- CHANGED_FILES` and fix problems in changed code)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this one as our GH actions will fail anyway if the code is not linted


- [ ] Create tests which fail without the change (if possible)
- [ ] Make all tests (unit and integration) pass (`npm run test:unit` and `npm run test:integration`)
- [ ] Extend the types in index.d.ts file (if necessary)
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: Audit

on:
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
- prep-**
push:
branches:
- master
tags:
- v*
pull_request:
branches:
- master
- prep-**

jobs:
lint:
name: Run audit
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install dependencies
run: npm i
- name: Run audit
run: npm audit
lint:
name: Run audit
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install dependencies
run: npm i
- name: Run audit
run: npm audit
Loading
Loading