Skip to content

Commit

Permalink
chore(tool-setup): fix lint & prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
sulha199 committed Sep 19, 2022
1 parent 207cafe commit 590e87f
Show file tree
Hide file tree
Showing 48 changed files with 36,392 additions and 36,280 deletions.
165 changes: 86 additions & 79 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,82 +1,89 @@
{
"$schema": "https://json.schemastore.org/eslintrc.json",
"env": {
"browser": true,
"es2021": true
},
"plugins": ["react", "@typescript-eslint", "@typescript-eslint/tslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"$schema": "https://json.schemastore.org/eslintrc.json",
"env": {
"browser": true,
"es2021": true
},
"plugins": ["react", "@typescript-eslint", "@typescript-eslint/tslint"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],

"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-eval": "error",
"no-trailing-spaces": "error",
"no-unsafe-finally": "error",
"no-var": "error",
"spaced-comment": [
"error",
"always",
{
"markers": ["/"]
}
],
"indent": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-console": ["error", { "allow": ["info", "error", "warn"] }],
"brace-style": ["error", "1tbs"],
"no-whitespace-before-property": "error",
"@typescript-eslint/no-var-requires": "off",
"typescript-eslint/indent": "off", // Prettier takes care of indentation.
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": ["error", "double"],
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/triple-slash-reference": "warn",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"whitespace": [true, "check-branch", "check-decl", "check-operator", "check-separator", "check-type"]
}
}
],
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"react/react-in-jsx-scope": "off",
"react/no-unescaped-entities": "off"
},
"overrides": [
{
"files": ["**/*,ts", "**/*.tsx"],
"rules": {
"@typescript-eslint/no-explicit-any": "error"
}
}
]
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.json",
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"no-eval": "error",
"no-trailing-spaces": "error",
"no-unsafe-finally": "error",
"no-var": "error",
"spaced-comment": [
"error",
"always",
{
"markers": ["/"]
}
],
"indent": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-console": ["error", { "allow": ["info", "error", "warn"] }],
"brace-style": ["error", "1tbs"],
"no-whitespace-before-property": "error",
"@typescript-eslint/no-var-requires": "off",
"typescript-eslint/indent": "off", // Prettier takes care of indentation.
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/quotes": ["error", "double"],
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/triple-slash-reference": "warn",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
}
}
],
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
"react/react-in-jsx-scope": "off",
"react/no-unescaped-entities": "off"
},
"overrides": [
{
"files": ["**/*,ts", "**/*.tsx"],
"rules": {
"@typescript-eslint/no-explicit-any": "error"
}
}
]
}
58 changes: 29 additions & 29 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,47 @@

## Related issues

- Link to issue1 here
- Link to issue1 here
- Link to issue1 here
- Link to issue1 here

## Test Plan

### Tested on all primary browsers for:

- Chrome
- [ ] Desktop
- [ ] Mobile
- [ ] Tablet
- Safari
- [ ] Desktop
- [ ] Mobile
- [ ] Tablet
- Firefox
- [ ] Desktop
- [ ] Mobile
- [ ] Tablet
- (Optional) Tested on Safari 12 (Physical or emulator)
- [ ] iPad
- [ ] iPhone
- (Optional) Tested on physical mobile and tablet device for:
- [ ] Android
- [ ] iOS (including iPadOS)
- Chrome
- [ ] Desktop
- [ ] Mobile
- [ ] Tablet
- Safari
- [ ] Desktop
- [ ] Mobile
- [ ] Tablet
- Firefox
- [ ] Desktop
- [ ] Mobile
- [ ] Tablet
- (Optional) Tested on Safari 12 (Physical or emulator)
- [ ] iPad
- [ ] iPhone
- (Optional) Tested on physical mobile and tablet device for:
- [ ] Android
- [ ] iOS (including iPadOS)

## Documentation changes

(If relevant, please create a PR in our [docs repo](https://github.com/supertokens/docs), or create a checklist here highlighting the necessary changes)

## Checklist for important updates

- [ ] Changelog has been updated
- [ ] Changes to the version if needed
- In `package.json`
- In `package-lock.json`
- In `src/version.ts`
- [ ] Had run `npm run build`
- [ ] Had installed and ran the pre-commit hook
- [ ] Changelog has been updated
- [ ] Changes to the version if needed
- In `package.json`
- In `package-lock.json`
- In `src/version.ts`
- [ ] Had run `npm run build`
- [ ] Had installed and ran the pre-commit hook

## Remaining TODOs for this PR

- [ ] Item1
- [ ] Item2
- [ ] Item1
- [ ] Item2
22 changes: 11 additions & 11 deletions .github/workflows/github-actions-changelog.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: "Enforcing changelog in PRs Workflow"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces the update of a changelog file on every pull request
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dangoslen/changelog-enforcer@v2
with:
changeLogPath: "CHANGELOG.md"
skipLabels: "Skip-Changelog"
# Enforces the update of a changelog file on every pull request
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dangoslen/changelog-enforcer@v2
with:
changeLogPath: "CHANGELOG.md"
skipLabels: "Skip-Changelog"
30 changes: 15 additions & 15 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: "Lint PR Title"

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
pr-title:
name: Lint PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
pr-title:
name: Lint PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
validateSingleCommit: true
40 changes: 20 additions & 20 deletions .github/workflows/pre-commit-hook-run.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: "Pre commit hook check"

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
pull_request:
types:
- opened
- reopened
- edited
- synchronize

jobs:
pr-title:
name: Pre commit hook check
runs-on: ubuntu-latest
container: rishabhpoddar/supertokens_website_sdk_testing_node_16
steps:
- uses: actions/checkout@v2
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
- run: npm i --force || true
# the below command is there cause otherwise running npm run check-circular-dependencies gives an error like:
# Your cache folder contains root-owned files, due to a bug in
# npm ERR! previous versions of npm which has since been addressed.
- run: chown -R 1001:121 "/github/home/.npm"
- run: npm i --force
- run: ./hooks/pre-commit
pr-title:
name: Pre commit hook check
runs-on: ubuntu-latest
container: rishabhpoddar/supertokens_website_sdk_testing_node_16
steps:
- uses: actions/checkout@v2
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
- run: npm i --force || true
# the below command is there cause otherwise running npm run check-circular-dependencies gives an error like:
# Your cache folder contains root-owned files, due to a bug in
# npm ERR! previous versions of npm which has since been addressed.
- run: chown -R 1001:121 "/github/home/.npm"
- run: npm i --force
- run: ./hooks/pre-commit
42 changes: 21 additions & 21 deletions .vscode/copyright.code-snippets
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"copy-ts-css": {
"scope": "javascript,typescript,typescriptreact,css,scss",
"prefix": ["copyright"],
"description": "Add copyright to typescript, javascript, or css file format",
"body": [
"/* Copyright (c) 2022, VRAI Labs and/or its affiliates. All rights reserved.\r",
" *\r",
" * This software is licensed under the Apache License, Version 2.0 (the\r",
" * \"License\") as published by the Apache Software Foundation.\r",
" *\r",
" * You may not use this file except in compliance with the License. You may\r",
" * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r",
" *\r",
" * Unless required by applicable law or agreed to in writing, software\r",
" * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r",
" * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r",
" * License for the specific language governing permissions and limitations\r",
" * under the License.\r",
" */"
]
}
"copy-ts-css": {
"scope": "javascript,typescript,typescriptreact,css,scss",
"prefix": ["copyright"],
"description": "Add copyright to typescript, javascript, or css file format",
"body": [
"/* Copyright (c) 2022, VRAI Labs and/or its affiliates. All rights reserved.\r",
" *\r",
" * This software is licensed under the Apache License, Version 2.0 (the\r",
" * \"License\") as published by the Apache Software Foundation.\r",
" *\r",
" * You may not use this file except in compliance with the License. You may\r",
" * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\r",
" *\r",
" * Unless required by applicable law or agreed to in writing, software\r",
" * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r",
" * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r",
" * License for the specific language governing permissions and limitations\r",
" * under the License.\r",
" */"
]
}
}
Loading

0 comments on commit 590e87f

Please sign in to comment.