Skip to content
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

Update linting #116

Merged
merged 1 commit into from
Aug 10, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* permissions and limitations under the License.
*/

import crypto from 'crypto';
import _ from 'lodash';
import React from 'react';
import { observer, inject, Observer } from 'mobx-react';
Expand All @@ -36,8 +37,6 @@ import {
} from 'semantic-ui-react';
import { CopyToClipboard } from 'react-copy-to-clipboard';

import crypto from 'crypto';

import { gotoFn } from '@aws-ee/base-ui/dist/helpers/routing';
import { swallowError } from '@aws-ee/base-ui/dist/helpers/utils';
import { displayError } from '@aws-ee/base-ui/dist/helpers/notification';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class DragDrop extends Component {
return (
<div {...getRootProps()}>
<input {...getInputProps()} />
{<Icon name="cloud upload" size="massive" color="grey" />}
<Icon name="cloud upload" size="massive" color="grey" />
{isFileTooLarge && <div className="text-danger mt-2">File is too large.</div>}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ class UserOnboarding extends React.Component {
) : (
<p>Drag and drop a credentials.csv files here, or click to select a file</p>
)}
{<Icon name="cloud upload" size="huge" color="grey" />}
<Icon name="cloud upload" size="huge" color="grey" />
{isFileTooLarge && <div className="text-danger mt-2">File is too large.</div>}
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"no-underscore-dangle": 0,
"no-param-reassign": 0,
"class-methods-use-this": 0,
"no-use-before-define": 0
"no-use-before-define": 0,
"no-console": 0
},
"env": {
"jest/globals": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* permissions and limitations under the License.
*/

const ServicesContainer = require('@aws-ee/base-services-container/lib/services-container');
const fs = require('fs');
const ServicesContainer = require('@aws-ee/base-services-container/lib/services-container');
const SettingsServiceMock = require('@aws-ee/base-services/lib/settings/env-settings-service');

const { yamlParse } = require('yaml-cfn');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* permissions and limitations under the License.
*/

const crypto = require('crypto');
const _ = require('lodash');
const Service = require('@aws-ee/base-services-container/lib/service');
const crypto = require('crypto');

const { allowIfActive, allowIfAdmin } = require('@aws-ee/base-services/lib/authorization/authorization-utils');
const { processInBatches } = require('@aws-ee/base-services/lib/helpers/utils');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* permissions and limitations under the License.
*/

const _ = require('lodash');
const crypto = require('crypto');
const _ = require('lodash');
const Service = require('@aws-ee/base-services-container/lib/service');

const { CfnTemplate } = require('../helpers/cfn-template');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/

const crypto = require('crypto');
const NodeRSA = require('node-rsa');
const querystring = require('querystring');
const NodeRSA = require('node-rsa');
const request = require('request-promise-native');
const Service = require('@aws-ee/base-services-container/lib/service');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* permissions and limitations under the License.
*/

const crypto = require('crypto');
const ServicesContainer = require('@aws-ee/base-services-container/lib/services-container');
const JsonSchemaValidationService = require('@aws-ee/base-services/lib/json-schema-validation-service');
const Logger = require('@aws-ee/base-services/lib/logger/logger-service');
const crypto = require('crypto');

// Mocked dependencies
const AwsService = require('@aws-ee/base-services/lib/aws/aws-service');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
* permissions and limitations under the License.
*/

const crypto = require('crypto');
const querystring = require('querystring');
const _ = require('lodash');
let fetch = require('node-fetch');
const crypto = require('crypto');
const NodeRSA = require('node-rsa');
const querystring = require('querystring');
const Service = require('@aws-ee/base-services-container/lib/service');
const { retry, linearInterval } = require('@aws-ee/base-services/lib/helpers/utils');
const sshConnectionInfoSchema = require('../../schema/ssh-connection-info-sc.json');
Expand Down Expand Up @@ -438,7 +438,7 @@ class EnvironmentScConnectionService extends Service {

async updateRoleToIncludeCurrentIP(iam, connection, currentPolicyResponse) {
// Construct new statement which will allow the caller IP address permission to generate the presigned URL
const currentIpAddress = await fetch('http://checkip.amazonaws.com/').then(function(res) {
const currentIpAddress = await fetch('http://checkip.amazonaws.com/').then(function getText(res) {
return res.text();
});
const newStatement = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class StorageGatewayService extends Service {
}

async fetchIP() {
const ipAddressResult = await fetch('http://httpbin.org/get').then(function(res) {
const ipAddressResult = await fetch('http://httpbin.org/get').then(function getJSON(res) {
return res.json();
});
return ipAddressResult.origin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* permissions and limitations under the License.
*/

const _ = require('lodash');
const inspect = require('util').inspect;
const _ = require('lodash');

// a promise friendly delay function
function delay(seconds) {
Expand Down
4 changes: 2 additions & 2 deletions addons/addon-base/packages/serverless-go-build-tools/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
const { execSync } = require('child_process');
const { createReadStream } = require('fs');
const path = require('path');
const _ = require('lodash');
const chalk = require('chalk');
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout,
});
const chalk = require('chalk');
const _ = require('lodash');

// TODO: Make this a generic build artifact and upload to s3 tool in the future
// ie - remove the hard-coded go bits and make it more extensible.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* permissions and limitations under the License.
*/

const _ = require('lodash');
const crypto = require('crypto');
const _ = require('lodash');
const uuid = require('uuid/v4');
const Service = require('@aws-ee/base-services-container/lib/service');
const { ensureCurrentUserOrAdmin } = require('../authorization/assertions');
Expand Down
2 changes: 1 addition & 1 deletion addons/addon-base/packages/services/lib/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
* permissions and limitations under the License.
*/

const crypto = require('crypto');
const _ = require('lodash');
const { nanoid: nanoIdSync } = require('nanoid');
const { nanoid } = require('nanoid/async');
const crypto = require('crypto');

function toVersionString(num) {
return `v${_.padStart(num, 4, '0')}_`;
Expand Down
2 changes: 1 addition & 1 deletion addons/addon-base/packages/services/lib/s3-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* permissions and limitations under the License.
*/

const _ = require('lodash');
const path = require('path');
const _ = require('lodash');
const Service = require('@aws-ee/base-services-container/lib/service');

const moveS3ObjectSchema = require('./schema/move-s3-object.json');
Expand Down
2 changes: 2 additions & 0 deletions addons/addon-custom/packages/main/src/extend/withAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { branding } from '@aws-ee/base-ui/dist/helpers/settings';
import TermsPage from '../parts/TermsPage';
import Register from '../parts/Register';

/* eslint-disable react/jsx-no-bind */

const noAuthPaths = [
{ path: '/legal', component: TermsPage },
{ path: '/register', component: Register },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
const { generateKeyPair } = require('crypto');
const _ = require('lodash');
const uuid = require('uuid/v4');
const { generateKeyPair } = require('crypto');
const forge = require('node-forge');

const Service = require('@aws-ee/base-services-container/lib/service');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AWS = require('aws-sdk');
const setupAws = require('../../support/setupAws');
const { getCFStackResources, getStackResourcesByType } = require('../../support/utilities');

/* eslint-disable jest/expect-expect */
describe('Route tables', () => {
beforeAll(async () => {
await setupAws();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const AWS = require('aws-sdk');
const setupAws = require('../../support/setupAws');
const { getStackResourcesByType } = require('../../support/utilities');

/* eslint-disable jest/expect-expect */
describe('Security groups', () => {
beforeAll(async () => {
await setupAws();
Expand Down
2 changes: 1 addition & 1 deletion main/infrastructure-tests/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
const _ = require('lodash');
const path = require('path');
const _ = require('lodash');
const fs = require('fs-extra');
const yaml = require('js-yaml');
const parse = require('yargs-parser');
Expand Down
3 changes: 2 additions & 1 deletion main/integration-tests/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"no-underscore-dangle": 0,
"no-param-reassign": 0,
"class-methods-use-this": 0,
"no-use-before-define": 0
"no-use-before-define": 0,
"no-console": 0
},
"env": {
"jest/globals": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
const { runSetup } = require('../../../../support/setup');
const errorCode = require('../../../../support/utils/error-code');

/* eslint-disable jest/no-commented-out-tests */
describe('Create budget', () => {
let setup;
let adminSession;
Expand Down
2 changes: 1 addition & 1 deletion main/integration-tests/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
const _ = require('lodash');
const path = require('path');
const _ = require('lodash');
const fs = require('fs-extra');
const yaml = require('js-yaml');
const parse = require('yargs-parser');
Expand Down
2 changes: 1 addition & 1 deletion main/integration-tests/support/aws/services/cognito-idp.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* permissions and limitations under the License.
*/

const _ = require('lodash');
const assert = require('assert');
const _ = require('lodash');

class CognitoIdp {
constructor({ aws, sdk }) {
Expand Down
2 changes: 1 addition & 1 deletion main/integration-tests/support/aws/services/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* permissions and limitations under the License.
*/

const _ = require('lodash');
const fs = require('fs');
const _ = require('lodash');

const { run } = require('../../utils/utils');

Expand Down
Loading