Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-saland committed Nov 28, 2023
1 parent 21b2296 commit 1703a35
Show file tree
Hide file tree
Showing 13 changed files with 2,063 additions and 1,686 deletions.
35 changes: 29 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ module.exports = {
'**/3rd-party/*',
'**/*.d.ts',
'**/settings.schema.json',
'**/reports/*'
'**/reports/*',
'**/integrate-with-salesforce/public/js/preload.js'
],
parserOptions: {
ecmaVersion: 2020,
Expand Down Expand Up @@ -90,10 +91,10 @@ module.exports = {
'import/export': ['error'],
'import/named': ['off'],
'import/namespace': ['error'],
'import/no-duplicates': ['warn'],
'import/no-duplicates': ['error'],
'import/no-extraneous-dependencies': ['off'],
'import/no-named-as-default': ['warn'],
'import/no-named-as-default-member': ['warn'],
'import/no-named-as-default': ['error'],
'import/no-named-as-default-member': ['error'],
'import/no-unresolved': ['off'],
'import/no-unused-modules': ['off'],
'import/order': [
Expand Down Expand Up @@ -591,7 +592,6 @@ module.exports = {
'@typescript-eslint/no-array-constructor': ['error'],
'@typescript-eslint/no-base-to-string': ['error'],
'@typescript-eslint/no-dupe-class-members': ['error'],
'@typescript-eslint/no-duplicate-imports': ['error'],
'@typescript-eslint/no-dynamic-delete': ['off'],
'@typescript-eslint/no-empty-function': ['off'],
'@typescript-eslint/no-empty-interface': ['error'],
Expand Down Expand Up @@ -619,7 +619,6 @@ module.exports = {
'@typescript-eslint/no-namespace': ['error'],
'@typescript-eslint/no-non-null-asserted-optional-chain': ['error'],
'@typescript-eslint/no-non-null-assertion': ['error'],
'@typescript-eslint/no-parameter-properties': ['error'],
'@typescript-eslint/no-redundant-type-constituents': ['off'],
'@typescript-eslint/no-require-imports': ['error'],
'@typescript-eslint/no-shadow': ['error'],
Expand Down Expand Up @@ -691,6 +690,30 @@ module.exports = {
'@typescript-eslint/unbound-method': ['error'],
'@typescript-eslint/unified-signatures': ['error']
}
},
{
files: ['how-to/workspace-platform-starter/client/**/*.ts'],
rules: {
'no-restricted-syntax': [
'error',
{
selector: "BinaryExpression[operator='==='][right.type='Identifier'][right.name='undefined']",
message: 'Instead of using "=== undefined", please use the utils method isEmpty'
},
{
selector: "BinaryExpression[operator='!=='][right.type='Identifier'][right.name='undefined']",
message: 'Instead of using "!== undefined", please use the utils method !isEmpty'
},
{
selector: "BinaryExpression[operator='==='][right.type='Identifier'][right.name='null']",
message: 'Instead of using "=== null", please use the utils method isEmpty'
},
{
selector: "BinaryExpression[operator='!=='][right.type='Identifier'][right.name='null']",
message: 'Instead of using "!== null", please use the utils method !isEmpty'
}
]
}
}
]
};
202 changes: 101 additions & 101 deletions .github/workflows/publish-HOWTOs.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
name: Publish HOWTOs
on:
- push
- workflow_dispatch

jobs:
build:
name: Build and package HOWTOs
runs-on: ubuntu-latest
env:
RELEASE_BRANCH_PREFIX: 'container/'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build-client --workspaces

- name: Package for publishing (GitHub Pages)
run: npm run package
env:
PKG_HOWTOS_LOCATION: github
PKG_HOWTOS_PATH: ${{ github.ref_name }}

- name: Package for publishing (AWS s3 CDN)
if: ${{ startsWith(github.ref_name, env.RELEASE_BRANCH_PREFIX) }}
run: npm run package
env:
PKG_HOWTOS_LOCATION: aws
PKG_HOWTOS_PATH: ${{ github.ref_name }}

- name: Upload artifacts (GitHub Pages)
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: workflow-howtos-github
path: public-github/
retention-days: 1

- name: Upload artifacts (AWS s3 CDN)
if: ${{ startsWith(github.ref_name, env.RELEASE_BRANCH_PREFIX) }}
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: workflow-howtos-aws
path: public-aws/
retention-days: 1

publish-gh:
name: Publish HOWTOs (GitHub Pages)
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: workflow-howtos-github
path: public-github/

- name: Publish
uses: JamesIves/[email protected]
with:
branch: gh-pages # Target branch to deploy to
folder: public-github # Source folder to deploy
target-folder: ${{ github.ref_name }} # Target folder to deploy to

publish-aws:
if: ${{ startsWith(github.ref_name, 'container/') }}
name: Publish HOWTOs (AWS s3 CDN)
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: workflow-howtos-aws
path: public-aws/

- name: Publish
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
# The bucket name should match the https host name in
# scripts/package.js:URLBaseMap['aws'].
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} # Target bucket to deploy to
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: public-aws # Source folder to deploy
DEST_DIR: container-starter/${{ github.ref_name }} # Target folder to deploy to
name: Publish HOWTOs
on:
- push
- workflow_dispatch

jobs:
build:
name: Build and package HOWTOs
runs-on: ubuntu-latest
env:
RELEASE_BRANCH_PREFIX: 'container/'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: npm ci

- name: Build packages
run: npm run build-client --workspaces

- name: Package for publishing (GitHub Pages)
run: npm run package
env:
PKG_HOWTOS_LOCATION: github
PKG_HOWTOS_PATH: ${{ github.ref_name }}

- name: Package for publishing (AWS s3 CDN)
if: ${{ startsWith(github.ref_name, env.RELEASE_BRANCH_PREFIX) }}
run: npm run package
env:
PKG_HOWTOS_LOCATION: aws
PKG_HOWTOS_PATH: ${{ github.ref_name }}

- name: Upload artifacts (GitHub Pages)
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: workflow-howtos-github
path: public-github/
retention-days: 1

- name: Upload artifacts (AWS s3 CDN)
if: ${{ startsWith(github.ref_name, env.RELEASE_BRANCH_PREFIX) }}
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name: workflow-howtos-aws
path: public-aws/
retention-days: 1

publish-gh:
name: Publish HOWTOs (GitHub Pages)
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: workflow-howtos-github
path: public-github/

- name: Publish
uses: JamesIves/[email protected]
with:
branch: gh-pages # Target branch to deploy to
folder: public-github # Source folder to deploy
target-folder: ${{ github.ref_name }} # Target folder to deploy to

publish-aws:
if: ${{ startsWith(github.ref_name, 'container/') }}
name: Publish HOWTOs (AWS s3 CDN)
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: workflow-howtos-aws
path: public-aws/

- name: Publish
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
# The bucket name should match the https host name in
# scripts/package.js:URLBaseMap['aws'].
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} # Target bucket to deploy to
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: public-aws # Source folder to deploy
DEST_DIR: container-starter/${{ github.ref_name }} # Target folder to deploy to
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"endOfLine": "auto",
"endOfLine": "lf",
"overrides": [
{
"files": ["*.html"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ window.addEventListener("DOMContentLoaded", async () => {
*/
async function init(): Promise<void> {
// create a channel to receive commands from external apps
const actionChannel: OpenFin.ChannelProvider = await fin.InterApplicationBus.Channel.create(
"platform-command"
);
const actionChannel: OpenFin.ChannelProvider =
await fin.InterApplicationBus.Channel.create("platform-command");

actionChannel.onConnection((identity, payload) => {
// on connection you can validate the identity and optionally specify that a payload to prove id needs to be passed
Expand Down
Loading

0 comments on commit 1703a35

Please sign in to comment.