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

Upgrade prettier to v2.5.1 #19719

Merged
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
16 changes: 8 additions & 8 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 11 additions & 12 deletions eng/tools/dependency-testing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ let argv = require("yargs")
type: "string",
describe:
"name of the artifact to be incremented (e.g. azure-keyvault-secrets), will be translated to @azure/(package) format",
demandOption: true
demandOption: true,
},
"repo-root": {
type: "string",
default: "../../../",
describe: "root of the repository (e.g. ../../../)",
demandOption: true
demandOption: true,
},
"version-type": {
type: "string",
describe: "whether you want to test max or min or same version of dependencies",
demandOption: true
demandOption: true,
},
"source-dir": {
type: "string",
describe: "complete local path of the directory of the repo",
demandOption: true
demandOption: true,
},
"test-folder": {
type: "string",
default: "test",
describe: "whether to point at test or test/public",
demandOption: false
demandOption: false,
},
"dry-run": {
type: "boolean"
}
type: "boolean",
},
})
.help().argv;

Expand Down Expand Up @@ -64,9 +64,8 @@ function outputTestPath(projectFolderPath, sourceDir, testFolder) {
*/
async function usePackageTestTimeout(testPackageJson, packageJsonContents) {
if (packageJsonContents.scripts["integration-test:node"]) {
let replaceWithTimeout = packageJsonContents.scripts["integration-test:node"].match(
/--timeout [0-9]+/
);
let replaceWithTimeout =
packageJsonContents.scripts["integration-test:node"].match(/--timeout [0-9]+/);
if (replaceWithTimeout !== null) {
testPackageJson.scripts["integration-test:node"] = testPackageJson.scripts[
"integration-test:node"
Expand Down Expand Up @@ -311,7 +310,7 @@ async function replaceSourceReferences(targetPackagePath, packageName, testFolde
async function getVersions(packageName) {
const promise = new Promise(async (res, rej) => {
let npmProcess = crossSpawn("npm", ["view", packageName, "versions", "--json"], {
stdout: "inherit"
stdout: "inherit",
});
let stdOut = "";
let stdErr = "";
Expand Down Expand Up @@ -350,7 +349,7 @@ async function updateRushConfig(repoRoot, targetPackage, testFolder) {
const testPackageEntry = {
packageName: testPackageJson.name,
projectFolder: testProjectFolder,
versionPolicyName: "client"
versionPolicyName: "client",
};
rushSpec.projects.push(testPackageEntry);
rushSpec.projectFolderMaxDepth = 5;
Expand Down
2 changes: 1 addition & 1 deletion eng/tools/dependency-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"homepage": "https://github.com/Azure/azure-sdk-for-js#readme",
"dependencies": {
"cross-spawn": "^7.0.2",
"prettier": "^1.16.4",
"prettier": "^2.5.1",
"semver": "^7.3.2",
"yargs": "^14.2.0",
"eng-package-utils": "file:../eng-package-utils"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"npm-run-all": "^4.1.5",
"path": "^0.12.7",
"plugin-error": "^1.0.1",
"prettier": "^1.16.4",
"prettier": "^2.5.1",
"ts-node": "^7.0.1",
"tslib": "1.11.2",
"typescript": "^3.9.10",
Expand Down
1 change: 0 additions & 1 deletion samples/cors/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
"devDependencies": {
"concurrently": "^5.3.0",
"typescript": "^4.0.3",
"prettier": "^1.16.4"
}
}
1 change: 0 additions & 1 deletion samples/cors/ts/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"typescript": "^4.0.3",
"prettier": "^1.16.4",
"@types/cors": "^2.8.9",
"@types/express": "^4.17.9"
}
Expand Down
1 change: 0 additions & 1 deletion samples/frameworks/electron/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@types/qs": "^6.9.5",
"babel": "^6.23.0",
"electron": "^10.2.0",
"prettier": "^1.16.4",
"typescript": "^4.1.2",
"webpack": "^5.6.0"
},
Expand Down
1 change: 0 additions & 1 deletion samples/frameworks/react/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,5 @@
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-prettier": "^3.1.4",
"typescript": "^4.0.3",
"prettier": "^1.16.4"
}
}
3 changes: 1 addition & 2 deletions samples/web-workers/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"author": "",
"license": "MIT",
"devDependencies": {
"parcel-bundler": "^1.12.5",
"prettier": "^1.19.1"
"parcel-bundler": "^1.12.5"
},
"browserslist": [
"last 1 Chrome versions"
Expand Down
1 change: 0 additions & 1 deletion samples/web-workers/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@types/jsdom": "^16.2.7",
"@types/node": "^14.14.20",
"parcel-bundler": "^1.12.5",
"prettier": "^1.19.1",
"typescript": "^4.2.3"
},
"browserslist": [
Expand Down
30 changes: 15 additions & 15 deletions sdk/anomalydetector/ai-anomaly-detector/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ const {
jsonRecordingFilterFunction,
isPlaybackMode,
isSoftRecordMode,
isRecordMode
isRecordMode,
} = require("@azure-tools/test-recorder");

module.exports = function(config) {
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: "./",
Expand All @@ -29,13 +29,13 @@ module.exports = function(config) {
"karma-sourcemap-loader",
"karma-junit-reporter",
"karma-json-preprocessor",
"karma-json-to-file-reporter"
"karma-json-to-file-reporter",
],

// list of files / patterns to load in the browser
files: [
"dist-test/index.browser.js",
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true }
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true },
].concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : []),

// list of files / patterns to exclude
Expand All @@ -48,7 +48,7 @@ module.exports = function(config) {
"recordings/browsers/**/*.json": ["json"],
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
// Preprocess source file to calculate code coverage, however this will make source file unreadable
"dist-test/index.js": ["coverage"]
"dist-test/index.js": ["coverage"],
},

envPreprocessor: ["TEST_MODE", "ANOMALY_DETECTOR_ENDPOINT", "ANOMALY_DETECTOR_API_KEY"],
Expand All @@ -65,8 +65,8 @@ module.exports = function(config) {
{ type: "json", subdir: ".", file: "coverage.json" },
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
{ type: "html", subdir: "html" },
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" }
]
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
],
},

junitReporter: {
Expand All @@ -76,12 +76,12 @@ module.exports = function(config) {
useBrowserName: false, // add browser name to report and classes names
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
properties: {} // key value pair of properties to add to the <properties> section of the report
properties: {}, // key value pair of properties to add to the <properties> section of the report
},

jsonToFileReporter: {
filter: jsonRecordingFilterFunction,
outputPath: "."
outputPath: ".",
},

// web server port
Expand All @@ -103,8 +103,8 @@ module.exports = function(config) {
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: "ChromeHeadless",
flags: ["--no-sandbox", "--disable-web-security"]
}
flags: ["--no-sandbox", "--disable-web-security"],
},
},

// Continuous Integration mode
Expand All @@ -119,14 +119,14 @@ module.exports = function(config) {
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserConsoleLogOptions: {
terminal: !isRecordMode()
terminal: !isRecordMode(),
},
client: {
mocha: {
// change Karma's debug.html to the mocha web reporter
reporter: "html",
timeout: "600000"
}
}
timeout: "600000",
},
},
});
};
2 changes: 1 addition & 1 deletion sdk/anomalydetector/ai-anomaly-detector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"mocha": "^7.1.1",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"prettier": "^1.16.4",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"rollup": "^1.16.3",
"typescript": "~4.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
SDK_VERSION,
DEFAULT_COGNITIVE_SCOPE,
AnomalyDetectorLoggingAllowedHeaderNames,
AnomalyDetectorLoggingAllowedQueryParameters
AnomalyDetectorLoggingAllowedQueryParameters,
} from "./constants";
import {
isTokenCredential,
bearerTokenAuthenticationPolicy,
InternalPipelineOptions,
createPipelineFromOptions,
PipelineOptions
PipelineOptions,
} from "@azure/core-http";
import { createAnomalyDetectorAzureKeyCredentialPolicy } from "./azureKeyCredentialPolicy";
import { logger } from "./logger";
Expand Down Expand Up @@ -67,9 +67,9 @@ export class AnomalyDetectorClient extends AnomalyDetector {
loggingOptions: {
logger: logger.info,
allowedHeaderNames: AnomalyDetectorLoggingAllowedHeaderNames,
allowedQueryParameters: AnomalyDetectorLoggingAllowedQueryParameters
}
}
allowedQueryParameters: AnomalyDetectorLoggingAllowedQueryParameters,
},
},
};

const pipeline = createPipelineFromOptions(internalPipelineOptions, authPolicy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
BaseRequestPolicy,
HttpOperationResponse,
RequestPolicyOptionsLike,
WebResourceLike
WebResourceLike,
} from "@azure/core-http";

const API_KEY_HEADER_NAME = "Ocp-Apim-Subscription-Key";
Expand All @@ -24,7 +24,7 @@ export function createAnomalyDetectorAzureKeyCredentialPolicy(
return {
create: (nextPolicy: RequestPolicy, options: RequestPolicyOptions) => {
return new AnomalyDetectorAzureKeyCredentialPolicy(nextPolicy, options, credential);
}
},
};
}

Expand Down
4 changes: 2 additions & 2 deletions sdk/anomalydetector/ai-anomaly-detector/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const AnomalyDetectorLoggingAllowedHeaderNames = [
"Strict-Transport-Security",
"X-Content-Type-Options",
"x-envoy-upstream-service-time",
"Ocp-Apim-Subscription-Key"
"Ocp-Apim-Subscription-Key",
];

export const AnomalyDetectorLoggingAllowedQueryParameters = [
"includeTextDetails",
"includeKeys",
"op"
"op",
];
2 changes: 1 addition & 1 deletion sdk/anomalydetector/ai-anomaly-detector/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export { AnomalyDetectorClient } from "./AnomalyDetectorClient";
export {
AnomalyDetector,
AnomalyDetectorContext,
AnomalyDetectorOptionalParams
AnomalyDetectorOptionalParams,
} from "./generated";
export * from "./models";
4 changes: 2 additions & 2 deletions sdk/anomalydetector/ai-anomaly-detector/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export enum KnownTimeGranularity {
/**
* None
*/
none = "none"
none = "none",
}

export {
Expand Down Expand Up @@ -88,5 +88,5 @@ export {
AnomalyDetectorDetectAnomalyHeaders,
AnomalyDetectorExportModelHeaders,
AnomalyDetectorTrainMultivariateModelHeaders,
TimeGranularity
TimeGranularity,
} from "./generated/models";
Loading