Skip to content

Commit

Permalink
Use global prettier config/ignore for all check and check-format scri…
Browse files Browse the repository at this point in the history
…pts (#17820)

* Add tsdoc-metadata.json to .prettierignore for @azure/core-rest-pipeline failure, see #14681

* Fix paths to .prettierrc.json and .prettierignore in @azure-tools/perf-container-registery package.json

* Run prettier with prettierrc.json config on sdk/test-utils/testing-recorder-new/rollup.base.config.js

* Use global prettier config and ignore for identity/identity/test/manual

* Use global prettier config and ignore in common/tools/eslint-plugin-azure-sdk
  • Loading branch information
humphd committed Sep 23, 2021
1 parent b1a3f06 commit f2f8048
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
**/*.yaml
**/*.d.ts
.env
tsdoc-metadata.json
4 changes: 2 additions & 2 deletions common/tools/eslint-plugin-azure-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"build:samples": "echo Skipped.",
"build:test": "npm run clean && tsc -p tsconfig.json",
"clean": "rimraf dist/",
"format": "prettier --write \"./**/*.{ts,json,md}\"",
"check-format": "prettier --check \"./**/*.{ts,json,md}\"",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"./**/*.{ts,json,md}\"",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"./**/*.{ts,json,md}\"",
"lint": "eslint src tests --ext .ts",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"build": "tsc -p .",
"build:samples": "echo skipped",
"build:test": "echo skipped",
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf dist dist-esm test-dist types *.tgz *.log",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "echo skipped",
Expand Down
3 changes: 2 additions & 1 deletion sdk/identity/identity/test/manual/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"build": "webpack --config webpack.config.js",
"start": "webpack-dev-server",
"format": "prettier --write \"src/**/*.tsx\""
"check-format": "prettier --list-different --config ../../../../../.prettierrc.json --ignore-path ../../../../../.prettierignore \"src/**/*.tsx\"",
"format": "prettier --write --config ../../../../../.prettierrc.json --ignore-path ../../../../../.prettierignore \"src/**/*.tsx\""
},
"author": "Microsoft Corporation",
"license": "MIT",
Expand Down
20 changes: 8 additions & 12 deletions sdk/identity/identity/test/manual/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
import * as React from "react";
import * as ReactDOM from "react-dom";

import {
InteractiveBrowserCredential,
BrowserLoginStyle
} from "@azure/identity";
import { InteractiveBrowserCredential, BrowserLoginStyle } from "@azure/identity";
import { ServiceBusClient } from "@azure/service-bus";

interface ClientDetails {
Expand Down Expand Up @@ -82,7 +79,7 @@ function getCredential(
cachedCredential = new InteractiveBrowserCredential({
tenantId,
clientId,
loginStyle
loginStyle,
});
lastLoginStyle = clientDetails.loginStyle;
return cachedCredential;
Expand All @@ -95,13 +92,12 @@ function ClientDetailsEditor({ clientDetails, onSetClientDetails }: ClientDetail
onSetClientDetails(newDetails);
};

const setDetail = (name: keyof ClientDetails, changeValue?: (v: string) => any) => (
value: string
) =>
handleDetailsChange({
...clientDetails,
[name]: changeValue ? changeValue(value) : value,
});
const setDetail =
(name: keyof ClientDetails, changeValue?: (v: string) => any) => (value: string) =>
handleDetailsChange({
...clientDetails,
[name]: changeValue ? changeValue(value) : value,
});

return (
<div>
Expand Down
4 changes: 1 addition & 3 deletions sdk/test-utils/testing-recorder-new/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ export function browserConfig(test = false) {
};

if (test) {
baseConfig.input = [
"dist-esm/test/*.spec.js"
];
baseConfig.input = ["dist-esm/test/*.spec.js"];
baseConfig.plugins.unshift(multiEntry({ exports: false }));
baseConfig.output.file = "dist-test/index.browser.js";

Expand Down

0 comments on commit f2f8048

Please sign in to comment.