From b371bcfc89b52ef824219286811d65a33443bf1f Mon Sep 17 00:00:00 2001 From: pieterlukasse Date: Tue, 18 Oct 2022 16:14:59 +0200 Subject: [PATCH 01/11] Update node js and fix failing unit tests (#1119) * fixed unhandled promise rejection ...which fixes locally failing jest test * fix failing unit test for UserProfile * udpate node js and npm for CI tests * make test a bit more specific * set node js to 16.x * update node js to 16.x and npm to 8.15 in Dockerfile * revert npm version change --- .travis.yml | 2 +- Dockerfile | 2 +- src/Submission/MapDataModel.jsx | 3 +++ src/UserProfile/UserProfile.test.jsx | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd03f5c2a2..80314b89ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ language: node_js git: depth: 1 node_js: - - "14" + - "16" cache: npm: false # disable npm cache for npm ci diff --git a/Dockerfile b/Dockerfile index d94df6a327..dda5836343 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3 \ time \ vim \ - && curl -sL https://deb.nodesource.com/setup_14.x | bash - \ + && curl -sL https://deb.nodesource.com/setup_16.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ diff --git a/src/Submission/MapDataModel.jsx b/src/Submission/MapDataModel.jsx index be58968fc7..e35e67b359 100644 --- a/src/Submission/MapDataModel.jsx +++ b/src/Submission/MapDataModel.jsx @@ -151,6 +151,9 @@ class MapDataModel extends React.Component { if (data && data[this.state.parentNodeType]) { this.setState((prevState) => ({ validParentIds: data[prevState.parentNodeType] })); } + }).catch(error => { + // TODO - should we throw this error? + console.error(error); }); } else { this.setState({ validParentIds: [] }); diff --git a/src/UserProfile/UserProfile.test.jsx b/src/UserProfile/UserProfile.test.jsx index 8782025dae..878ef64b37 100644 --- a/src/UserProfile/UserProfile.test.jsx +++ b/src/UserProfile/UserProfile.test.jsx @@ -42,7 +42,8 @@ describe('the UserProfile component', () => { /> , ); - expect($vdom.find('tbody tr')).toHaveLength(testProps.userProfile.jtis.length + 1); + // we expect one delete button per jti: + expect($vdom.find(`button[name="${DELETE_BTN}"]`)).toHaveLength(testProps.userProfile.jtis.length); }); it('triggers create-key events', (done) => { @@ -79,7 +80,7 @@ describe('the UserProfile component', () => { , ); const $deleteBtn = $vdom.find(`button[name="${DELETE_BTN}"]`); - expect($deleteBtn).toHaveLength(2); + expect($deleteBtn).toHaveLength(testProps.userProfile.jtis.length); $deleteBtn.at(0).simulate('click'); // should invoke onRequestDeleteKey callback (above - calls done()) ... }); From 9b10d2a7683fffb6b612aa34faeb7291ec6b6c5d Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Thu, 20 Oct 2022 11:30:40 -0500 Subject: [PATCH 02/11] feat(eslintOnlyOnCurrentBranch): Added new command eslint-new --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 6c916e1d84..6fea10804b 100644 --- a/package.json +++ b/package.json @@ -190,6 +190,7 @@ "schema": "node ./data/getSchema", "params": "node ./data/getTexts > src/params.js", "eslint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix src data", + "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --ignore-pattern '*.json' --fix $(git diff --name-only HEAD | xargs)", "elint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js'", "storybook": "start-storybook -p 6006 -s .storybook/public", "stylelint": "stylelint 'src/**/*.less' 'src/**/*.css' --config .stylelintrc.js --fix", From ac368dc656e57208883d3597f1c6ef997e0a5857 Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Thu, 20 Oct 2022 11:36:41 -0500 Subject: [PATCH 03/11] feat(eslintOnlyOnCurrentBranch): Removed ignore pattern for json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6fea10804b..621258d256 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "schema": "node ./data/getSchema", "params": "node ./data/getTexts > src/params.js", "eslint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix src data", - "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --ignore-pattern '*.json' --fix $(git diff --name-only HEAD | xargs)", + "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix $(git diff --name-only HEAD | xargs)", "elint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js'", "storybook": "start-storybook -p 6006 -s .storybook/public", "stylelint": "stylelint 'src/**/*.less' 'src/**/*.css' --config .stylelintrc.js --fix", From 09900f66827f9c27bcec39b2f6b80fd40491916b Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Thu, 20 Oct 2022 11:40:38 -0500 Subject: [PATCH 04/11] feat(eslintOnlyOnCurrentBranch): Reverted files changed in feat/vadc_sprint21 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 80314b89ea..bd03f5c2a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ language: node_js git: depth: 1 node_js: - - "16" + - "14" cache: npm: false # disable npm cache for npm ci From 74ce92ee7b4ba1c4bf32b0e205b7da9d4a9199dd Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Thu, 20 Oct 2022 11:41:52 -0500 Subject: [PATCH 05/11] feat(eslintOnlyOnCurrentBranch): Reverted additional files changed in feat/vadc_sprint21 --- Dockerfile | 2 +- src/Submission/MapDataModel.jsx | 3 --- src/UserProfile/UserProfile.test.jsx | 5 ++--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index dda5836343..d94df6a327 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ python3 \ time \ vim \ - && curl -sL https://deb.nodesource.com/setup_16.x | bash - \ + && curl -sL https://deb.nodesource.com/setup_14.x | bash - \ && apt-get install -y --no-install-recommends nodejs \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ diff --git a/src/Submission/MapDataModel.jsx b/src/Submission/MapDataModel.jsx index e35e67b359..be58968fc7 100644 --- a/src/Submission/MapDataModel.jsx +++ b/src/Submission/MapDataModel.jsx @@ -151,9 +151,6 @@ class MapDataModel extends React.Component { if (data && data[this.state.parentNodeType]) { this.setState((prevState) => ({ validParentIds: data[prevState.parentNodeType] })); } - }).catch(error => { - // TODO - should we throw this error? - console.error(error); }); } else { this.setState({ validParentIds: [] }); diff --git a/src/UserProfile/UserProfile.test.jsx b/src/UserProfile/UserProfile.test.jsx index 878ef64b37..8782025dae 100644 --- a/src/UserProfile/UserProfile.test.jsx +++ b/src/UserProfile/UserProfile.test.jsx @@ -42,8 +42,7 @@ describe('the UserProfile component', () => { /> , ); - // we expect one delete button per jti: - expect($vdom.find(`button[name="${DELETE_BTN}"]`)).toHaveLength(testProps.userProfile.jtis.length); + expect($vdom.find('tbody tr')).toHaveLength(testProps.userProfile.jtis.length + 1); }); it('triggers create-key events', (done) => { @@ -80,7 +79,7 @@ describe('the UserProfile component', () => { , ); const $deleteBtn = $vdom.find(`button[name="${DELETE_BTN}"]`); - expect($deleteBtn).toHaveLength(testProps.userProfile.jtis.length); + expect($deleteBtn).toHaveLength(2); $deleteBtn.at(0).simulate('click'); // should invoke onRequestDeleteKey callback (above - calls done()) ... }); From 8a62c6ad8a99e05e81e55baee9e753dce9844f9d Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Thu, 20 Oct 2022 15:28:20 -0500 Subject: [PATCH 06/11] feat(eslintOnlyOnCurrentBranch): Updated r eadme.md with info on linting --- README.md | 64 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index ab521c4f6a..38d5cfc36c 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ A generic data portal that supports some basic interaction with Gen3 services li - [npm](https://www.npmjs.com/) ### Installing + ``` npm install ``` @@ -18,44 +19,49 @@ npm install See [docs/guide_running_portal_locally.md](docs/guide_running_portal_locally.md) for a step-by-step guide to running portal locally. The portal's `/dev.html` path loads javascript and most css -from `localhost`. Test code under local development with this procedure: -* `npm install` -* launch the webpack dev server, and configure local code with the same configuration as the server to test against. For example - if we intend to test against qa.planx-pla.net, then: +from `localhost`. Test code under local development with this procedure: + +- `npm install` +- launch the webpack dev server, and configure local code with the same configuration as the server to test against. For example - if we intend to test against qa.planx-pla.net, then: + ``` HOSTNAME=qa.planx-pla.net NODE_ENV=auto bash ./runWebpack.sh ``` + , or for qa-brain: + ``` HOSTNAME=qa-brain.planx-pla.net NODE_ENV=auto bash ./runWebpack.sh ``` You can also use the `autoprod` value for `NODE_ENV` to do the `auto` setup, then run `webpack` in production mode, so it generates `.js` and `.html` files instead of launching the dev server - ex: + ``` HOSTNAME=qa-brain.planx-pla.net NODE_ENV=autoprod GEN3_BUNDLE=all bash ./runWebpack.sh ``` Tiered-access settings can be configured through either the `TIER_ACCESS_LEVEL` environment variable (site-wide) or through the `tierAccessLevel` property on guppyConfig blocks for each Data Explorer tab in the gitops.json (index-scoped). To use the index-scoped config style, all guppyConfig blocks in the portal config must contain the `tierAccessLevel` property. See `docs/portal_config.md` for thorough example of portal config structure. ->**NOTE:** To locally test site-wide Tiered Access features, the additional environment variables `TIER_ACCESS_LEVEL` and `TIER_ACCESS_LIMIT` should have the same values as the server's "global.tier_access_level" and "global.tier_access_limit" properties in its [`manifest.json`](https://github.com/uc-cdis/cdis-manifest). +> **NOTE:** To locally test site-wide Tiered Access features, the additional environment variables `TIER_ACCESS_LEVEL` and `TIER_ACCESS_LIMIT` should have the same values as the server's "global.tier_access_level" and "global.tier_access_limit" properties in its [`manifest.json`](https://github.com/uc-cdis/cdis-manifest). > > **Example**:`HOSTNAME=qa-brain.planx-pla.net TIER_ACCESS_LEVEL=regular TIER_ACCESS_LIMIT=50 NODE_ENV=auto bash ./runWebpack.sh` If the index-scoped tiered-access setting is used, the `tierAccessLevel` properties in the guppyConfig blocks in gitops.json should have the same values as the server's "guppyConfig[index].tier_access_level" in its [`manifest.json`](https://github.com/uc-cdis/cdis-manifest). Tabs should be configured with the same tiered-access level as the ES index they use. +- Accept the self-signed certificate at https://localhost:9443/bundle.js -* Accept the self-signed certificate at https://localhost:9443/bundle.js - -* Load the test environment's `/dev.html` - ex: https://qa-brian.planx-pla.net/dev.html - +- Load the test environment's `/dev.html` - ex: https://qa-brian.planx-pla.net/dev.html ### Local development and gitops -Most production commons currently load custom configuration via gitops. The configuration for a production commons is available in that commons' gitops repository (mostly https://github.com/uc-cdis/cdis-manifest), and can be copied for local development. The `runWebpack.sh` script automates this process when `NODE_ENV` is set to `auto` - ex: +Most production commons currently load custom configuration via gitops. The configuration for a production commons is available in that commons' gitops repository (mostly https://github.com/uc-cdis/cdis-manifest), and can be copied for local development. The `runWebpack.sh` script automates this process when `NODE_ENV` is set to `auto` - ex: + ``` HOSTNAME=qa-brain.planx-pla.net NODE_ENV=auto bash ./runWebpack.sh ``` Note: the legacy `dev` NODE_ENV is still available, but the `APP` environment must also be manually set to load the configuration that matches the dictionary from HOSTNAME - ex: + ``` HOSTNAME=qa.planx-pla.net NODE_ENV=dev APP=dev bash ./runWebpack.sh ``` @@ -65,13 +71,14 @@ HOSTNAME=qa.planx-pla.net NODE_ENV=dev APP=dev bash ./runWebpack.sh The portal webpack configurations selects between multiple application entry points at build time: -* `commons` - the default data commons portal -* `covid19` - a portal for pandemic response commons -* `nct` - a portal for clinical trials -* `ecosystem` - a portal for Gen3 data ecosystem -* `workspace` - a scaled down portal for workspace accounts +- `commons` - the default data commons portal +- `covid19` - a portal for pandemic response commons +- `nct` - a portal for clinical trials +- `ecosystem` - a portal for Gen3 data ecosystem +- `workspace` - a scaled down portal for workspace accounts We can use the https://remote/dev.html trick to test a local workspace build by setting the `GEN3_BUNDLE` variable to `workspace`: + ``` HOSTNAME=qa.planx-pla.net GEN3_BUNDLE=workspace bash ./runWebpack.sh ``` @@ -79,14 +86,14 @@ HOSTNAME=qa.planx-pla.net GEN3_BUNDLE=workspace bash ./runWebpack.sh That just changes the webpack config to serve the workspace bundle as `bundle.js` - which is what `dev.html` expects. The portal `Dockerfile` runs a deploy time webpack build to incorporate -deploy-time configuration. The `GEN3_BUNDLE` environment variable determines which application gets built at run time. - +deploy-time configuration. The `GEN3_BUNDLE` environment variable determines which application gets built at run time. ### Customized Basename ->:warning: To use this feature, make sure the to set the `BASENAME` to a customized value in the portal deployed to the remote before you run the local dev server with the customized basename. Also the customized basename you used for local portal dev server should be the same as you have set for the remote deployment. +> :warning: To use this feature, make sure the to set the `BASENAME` to a customized value in the portal deployed to the remote before you run the local dev server with the customized basename. Also the customized basename you used for local portal dev server should be the same as you have set for the remote deployment. Available from `3.23.0`, you can supply a customized basename for portal by setting the `BASENAME` variable: + ``` HOSTNAME=qa.planx-pla.net NODE_ENV=auto BASENAME=/portal bash ./runWebpack.sh ``` @@ -101,12 +108,15 @@ To run Storybook: `npm run storybook` ### Run Windmill using Docker + Build the container image first + ``` docker build -t windmill . ``` Then run the container + ``` docker run --rm -e HOSTNAME=qa.planx-pla.net -p 443:443 -ti windmill ``` @@ -114,10 +124,13 @@ docker run --rm -e HOSTNAME=qa.planx-pla.net -p 443:443 -ti windmill You will then need to visit `https://localhost` and accept the self-signed certificate warnings ### Deployment + docker run -d --name=dataportal -p 80:80 quay.io/cdis/data-portal ### GraphQL configuration + The configurations of Homepage charts are specified data/config/.json, or gitops.json in gitops repo. For each common, we need to specify the following json entities: + ``` "graphql": { "boardCounts": [ @@ -156,6 +169,7 @@ The configurations of Homepage charts are specified data/config/.js ``` + - `boardCounts` are the counts that you want to display in the top-left of dashboard's - `chartCounts` are the counts that you want to display in the bar chart of dashboard's - `projectDetails` are the counts that you want to display in the list of projects. It could be same as `boardCounts`, in this case, you only need to point to `boardCounts`. @@ -183,7 +197,9 @@ We support categorical horizontal grouped bar charts, and the chart will be usin ``` ### Certificates configuration + All the configurations of necessary certificates are define in src/.json. For each common, we need to specify the following json entities: + ``` "components": { "certs": { @@ -220,18 +236,23 @@ All the configurations of necessary certificates are define in src/ ``` + Then, specify all the required certificates that need to be completed before using the portal in following entry: + ``` "requiredCerts": [""] ``` + Default is an empty list. ### Style Guide + When styling components, we adhere to a few rules. We style using class selectors (`.class-name` instead of `#class-name`), and separate class names with hyphens instead of camel case (`.class-name` instead of `.className`). The CSS file should be named {component}.css, and be in the same folder as the component. It is then imported into the component's .jsx file. We are moving toward using the [BEM methodology](http://getbem.com/introduction/) in terms of CSS organizational conventions. This means we are dividing chunks of code within a component into blocks, are avoiding nesting components, and are using the naming convention of `{block}__{elements}--{modifier}`. `{element}` and `{modifier}` are optional depending on the situation - see the [BEM guidelines](http://getbem.com/introduction/) for more examples. For our example, say we have a simple component called `Component`: + ``` import './Component.css'; @@ -247,6 +268,7 @@ class Component extends React.Component { } } ``` + Our block would be `.component`, and elements in that block would consist of the buttons and the title. So our CSS would look like this, based on the BEM naming conventions: ``` @@ -302,3 +324,11 @@ class Component extends React.Component { } } ``` + +### Linting + +We use ESLint and Stylelint to lint and auto-format code. + +- `npm run eslint` Will run ESLint on the entire codebase and auto-fix all JS and JS like files. +- `npm run eslint-new` Will run ESLint only on new files in the current git branch and auto-fix all JS and JS like files. +- `npm run stylelint` Will run Stylelint on all CSS and CSS-like files in the codebase and auto-fix them. From 35aad60e4703bed8fafb6a68d081510fac8e1a2e Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Fri, 21 Oct 2022 08:22:29 -0500 Subject: [PATCH 07/11] feat(eslintOnlyOnCurrentBranch): Spell checked and edited new addition to README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 38d5cfc36c..a1dc150ec0 100644 --- a/README.md +++ b/README.md @@ -327,8 +327,8 @@ class Component extends React.Component { ### Linting -We use ESLint and Stylelint to lint and auto-format code. +We use ESLint and Stylelint to lint and automatically format code. -- `npm run eslint` Will run ESLint on the entire codebase and auto-fix all JS and JS like files. -- `npm run eslint-new` Will run ESLint only on new files in the current git branch and auto-fix all JS and JS like files. -- `npm run stylelint` Will run Stylelint on all CSS and CSS-like files in the codebase and auto-fix them. +- `npm run eslint` Will run ESLint on the entire code base and automatically try to fix all JS and JS like files. +- `npm run eslint-new` Will run ESLint only on newly added files in the current git branch and automatically try to fix the JS and JS like files. +- `npm run stylelint` Will run Stylelint on all CSS and CSS-like files in the code base and automatically try to fix them. From 9d9a96081ffa5e711cbfc1416c6f3596695eca8e Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Mon, 24 Oct 2022 10:02:32 -0500 Subject: [PATCH 08/11] feat(eslintOnlyOnCurrentBranch): Updated to reference master instead of HEAD --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 621258d256..8848138a5c 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "schema": "node ./data/getSchema", "params": "node ./data/getTexts > src/params.js", "eslint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix src data", - "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix $(git diff --name-only HEAD | xargs)", + "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix $(git diff --name-only master | xargs)", "elint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js'", "storybook": "start-storybook -p 6006 -s .storybook/public", "stylelint": "stylelint 'src/**/*.less' 'src/**/*.css' --config .stylelintrc.js --fix", From 07f563e43e54e9a1aec1bb0ef360cf11fba86b29 Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Mon, 24 Oct 2022 10:18:54 -0500 Subject: [PATCH 09/11] feat(eslintOnlyOnCurrentBranch): Updated command to only parse JS JSX and TSX files and quiet warnings --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8848138a5c..a8e230cdb1 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "schema": "node ./data/getSchema", "params": "node ./data/getTexts > src/params.js", "eslint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix src data", - "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix $(git diff --name-only master | xargs)", + "eslint-new": "./node_modules/.bin/eslint **/*.js **/*.jsx, **/*.tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.json' --ignore-pattern '**/*.stories.jsx' --quiet --fix $(git diff --name-only master | xargs)", "elint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js'", "storybook": "start-storybook -p 6006 -s .storybook/public", "stylelint": "stylelint 'src/**/*.less' 'src/**/*.css' --config .stylelintrc.js --fix", From 66cc06bb7c6cc387541cfc932887861899e3cfb6 Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Mon, 24 Oct 2022 10:24:02 -0500 Subject: [PATCH 10/11] feat(eslintOnlyOnCurrentBranch): Updated command to use ext from original command, but added additional ignore patterns --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a8e230cdb1..2863d1a528 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "schema": "node ./data/getSchema", "params": "node ./data/getTexts > src/params.js", "eslint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix src data", - "eslint-new": "./node_modules/.bin/eslint **/*.js **/*.jsx, **/*.tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.json' --ignore-pattern '**/*.stories.jsx' --quiet --fix $(git diff --name-only master | xargs)", + "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.json' --ignore-pattern '**/Dockerfile' --ignore-pattern '**/*.png' --ignore-pattern '**/*.ico' --ignore-pattern '**/*.stories.jsx' --ignore-pattern '**/*.md' --quiet --fix $(git diff --name-only master | xargs)", "elint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js'", "storybook": "start-storybook -p 6006 -s .storybook/public", "stylelint": "stylelint 'src/**/*.less' 'src/**/*.css' --config .stylelintrc.js --fix", From 1cf010f7ac7100bb9a08e685e1bf1380f74bcabf Mon Sep 17 00:00:00 2001 From: Jarvis Raymond Date: Mon, 24 Oct 2022 10:37:04 -0500 Subject: [PATCH 11/11] feat(eslintOnlyOnCurrentBranch): Updated command to ignore yml files --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2863d1a528..917243e9a7 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "schema": "node ./data/getSchema", "params": "node ./data/getTexts > src/params.js", "eslint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.stories.jsx' --fix src data", - "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.json' --ignore-pattern '**/Dockerfile' --ignore-pattern '**/*.png' --ignore-pattern '**/*.ico' --ignore-pattern '**/*.stories.jsx' --ignore-pattern '**/*.md' --quiet --fix $(git diff --name-only master | xargs)", + "eslint-new": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js' --ignore-pattern '**/gqlHelper.js' --ignore-pattern '**/formHooks.jsx' --ignore-pattern '**/*.json' --ignore-pattern '**/Dockerfile' --ignore-pattern '**/*.png' --ignore-pattern '**/*.ico' --ignore-pattern '**/*.stories.jsx' --ignore-pattern '**/*.md' --ignore-pattern '**/*.yml' --quiet --fix $(git diff --name-only master | xargs)", "elint": "./node_modules/.bin/eslint --ext js --ext jsx --ext ts --ext tsx --ignore-pattern '**/__generated__/**' --ignore-pattern '**/*.min.js' --ignore-pattern '**/setupJest.js'", "storybook": "start-storybook -p 6006 -s .storybook/public", "stylelint": "stylelint 'src/**/*.less' 'src/**/*.css' --config .stylelintrc.js --fix",