Skip to content

Commit

Permalink
chore(project): update prettier to latest (#11542)
Browse files Browse the repository at this point in the history
* chore(project): update prettier to latest

* feat(prettier-config): update to bracketSameLine

* chore(project): run prettier
  • Loading branch information
joshblack committed Jun 3, 2022
1 parent a7964cd commit 864e94a
Show file tree
Hide file tree
Showing 89 changed files with 250 additions and 341 deletions.
Binary file not shown.
Binary file not shown.
13 changes: 6 additions & 7 deletions actions/add-review-labels/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ async function run() {
return;
}

const {
data: permissionLevel,
} = await octokit.repos.getCollaboratorPermissionLevel({
owner: repository.owner.login,
repo: repository.name,
username: review.user.login,
});
const { data: permissionLevel } =
await octokit.repos.getCollaboratorPermissionLevel({
owner: repository.owner.login,
repo: repository.name,
username: review.user.login,
});

// If the reviewer doesn't have one of the following permission levels
// then ignore the event
Expand Down
2 changes: 1 addition & 1 deletion config/eslint-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@
"eslint-restricted-globals": "^0.2.0"
},
"devDependencies": {
"prettier": "^2.2.1"
"prettier": "^2.6.2"
}
}
2 changes: 1 addition & 1 deletion config/prettier-config-carbon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'use strict';

module.exports = {
jsxBracketSameLine: true,
bracketSameLine: true,
printWidth: 80,
singleQuote: true,
trailingComma: 'es5',
Expand Down
2 changes: 1 addition & 1 deletion config/prettier-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"prettier": "^2.1.0"
},
"devDependencies": {
"prettier": "^2.2.1"
"prettier": "^2.6.2"
}
}
2 changes: 1 addition & 1 deletion config/stylelint-config-carbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"stylelint-scss": "^4.1.0"
},
"devDependencies": {
"prettier": "^2.2.1",
"prettier": "^2.6.2",
"stylelint": "^14.3.0"
}
}
3 changes: 1 addition & 2 deletions docs/developer-handbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ prefix prevents potential conflicts with class names from the user.
```html
<div
class="bx--inline-notification bx--inline-notification--error"
role="alert"
>
role="alert">
<div class="bx--inline-notification__details">...</div>
</div>
```
Expand Down
8 changes: 4 additions & 4 deletions docs/migration/v11.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ will need to pass those into the `with` block in the import:

```scss
@use '@carbon/styles' with (
$prefix: 'cds',
$prefix: 'cds'
);
```

Expand Down Expand Up @@ -570,15 +570,15 @@ can configure Carbon on the main entrypoint:

```scss
@use '@carbon/styles' with (
$prefix: 'cds',
$prefix: 'cds'
);
```

Or you can configure the `scss/_config.scss` directly:

```scss
@use '@carbon/styles/config' with (
$prefix: 'cds',
$prefix: 'cds'
);
```

Expand Down Expand Up @@ -1940,7 +1940,7 @@ You can use a "compatibility theme" by setting the `$fallback` to a value from
@use '@carbon/themes/scss/themes';
@use '@carbon/themes/scss/theme' with (
$fallback: compat.$g100,
$theme: themes.$g100,
$theme: themes.$g100
);
```

Expand Down
3 changes: 1 addition & 2 deletions e2e/components/FileUploader/FileUploader-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ test.describe('FileUploader', () => {
}) => {
await snapshotStory(page, {
component: 'FileUploader',
id:
'components-fileuploader--drag-and-drop-upload-container-example-application',
id: 'components-fileuploader--drag-and-drop-upload-container-example-application',
theme,
});
});
Expand Down
3 changes: 1 addition & 2 deletions e2e/components/UIShell/UIShell-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ test.describe('UIShell', () => {
}) => {
await snapshotStory(page, {
component: 'UIShell',
id:
'components-ui-shell--header-base-w-navigation-actions-and-side-nav',
id: 'components-ui-shell--header-base-w-navigation-actions-and-side-nav',
theme,
});
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"lerna": "^4.0.0",
"lint-staged": "^12.0.0",
"node-gyp": "^7.1.2",
"prettier": "^2.2.1",
"prettier": "^2.6.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rimraf": "^3.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/carbon-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ You can change the default theme of Carbon by doing the following:
```scss
@use 'carbon-components/scss/themes';
@use 'carbon-components/scss/theme' with (
$theme: themes.$g100,
$theme: themes.$g100
);
```

Expand All @@ -95,7 +95,7 @@ extend the theme.
$theme: (
background: #e2e2e2,
text-primary: #ffffff,
),
)
);
```

Expand All @@ -106,7 +106,7 @@ extend the theme.
$fallback: themes.$g100,
$theme: (
custom-token-01: #000000,
),
)
);
```

Expand Down
23 changes: 16 additions & 7 deletions packages/carbon-components/docs/experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ This will register a helper for us to use in our `hbs` files called
helper by doing the following:

```hbs
{{ carbon-icon 'ChevronDownGlyph' }}
{{carbon-icon 'ChevronDownGlyph'}}
```

This will place in the icon named `ChevronDownGlyph` glyph from `@carbon/icons`
Expand All @@ -159,7 +159,7 @@ right-hand side of the table (when in expanded mode) you'd see
helper by doing:

```hbs
{{ carbon-icon 'ChevronDownGlyph' }}
{{carbon-icon 'ChevronDownGlyph'}}
```

#### How do I add a class to an icon?
Expand All @@ -168,7 +168,7 @@ You can add in a class by passing in `class=''` at the end of the partial. For
example, in our dropdown we could do:

```hbs
{{ carbon-icon 'ChevronDownGlyph' class=(add @root.prefix '--dropdown__arrow') }}
{{carbon-icon 'ChevronDownGlyph' class=(add @root.prefix '--dropdown__arrow')}}
```

This would take in the `@root.prefix` value and prepends the `--dropdown__arrow`
Expand All @@ -183,7 +183,7 @@ You can pass in any attributes, especially things like `aria-label` as a
`aria-label` we would do the following:

```hbs
{{ carbon-icon 'ChevronDownGlyph' aria-label='Aria label for icon' }}
{{carbon-icon 'ChevronDownGlyph' aria-label='Aria label for icon'}}
```

#### How do I only use `carbon-icon` for experimental components?
Expand Down Expand Up @@ -218,10 +218,19 @@ For most components, this will look like:

```hbs
{{#if featureFlags.componentsX}}
{{ carbon-icon 'ChevronDownGlyph' class=(add @root.prefix '--dropdown__arrow') }}
{{carbon-icon
'ChevronDownGlyph'
class=(add @root.prefix '--dropdown__arrow')
}}
{{else}}
<svg class="{{@root.prefix}}--dropdown__arrow" width="10" height="5" viewBox="0 0 10 5" fill-rule="evenodd">
<path d="M10 0L5 5 0 0z"></path>
<svg
class='{{@root.prefix}}--dropdown__arrow'
width='10'
height='5'
viewBox='0 0 10 5'
fill-rule='evenodd'
>
<path d='M10 0L5 5 0 0z'></path>
</svg>
{{/if}}
```
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"klaw-sync": "^6.0.0",
"lodash.template": "^4.5.0",
"markdown-toc": "^1.2.0",
"prettier": "^2.2.1",
"prettier": "^2.6.2",
"prettier-config-carbon": "^0.6.0",
"progress-estimator": "^0.3.0",
"remark": "^10.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ async function getGitHubClient() {
type: 'password',
name: 'token',
message: 'Provide a GitHub access token',
hint:
'Help: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line',
hint: 'Help: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line',
},
];
const answers = await prompt(question);
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/commands/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ async function getLastGitTag() {

module.exports = {
command: 'publish <tag>',
desc:
'publish packages that have different versions from the package registry',
desc: 'publish packages that have different versions from the package registry',
builder(yargs) {
yargs.positional('tag', {
describe: 'the version tag associated with the release',
Expand Down
2 changes: 1 addition & 1 deletion packages/feature-flags/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ the module or by using `enable`, `disable`, and `merge`.
$feature-flags: (
'feature-flag-a': false,
'feature-flag-b': true,
),
)
);

// Enable `feature-flag-a`
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

@use 'sass:meta';
@use "sass:math";
@use 'sass:math';

@use 'config' as *;
@use 'breakpoint' as *;
Expand Down
2 changes: 1 addition & 1 deletion packages/icon-build-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"js-yaml": "^3.12.1",
"klaw-sync": "^6.0.0",
"memfs": "^3.4.0",
"prettier": "^2.2.1",
"prettier": "^2.6.2",
"prop-types": "^15.6.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/icon-helpers/src/__tests__/toSVG-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ const defaultDescriptor = {
{
elem: 'path',
attrs: {
d:
'M12 11.03v4h-2v-4H8v6h4v4h2v-10h-2zm12.19 0H22l-3 4.39v-4.39h-2v10h2V18.3l.91-1.33L22 21.03h2.19l-2.99-5.62 2.99-4.38z',
d: 'M12 11.03v4h-2v-4H8v6h4v4h2v-10h-2zm12.19 0H22l-3 4.39v-4.39h-2v10h2V18.3l.91-1.33L22 21.03h2.19l-2.99-5.62 2.99-4.38z',
},
},
{
elem: 'path',
attrs: {
d:
'M28 26H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h24a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2zM4 8v16h24V8z',
d: 'M28 26H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h24a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2zM4 8v16h24V8z',
},
},
],
Expand Down
6 changes: 2 additions & 4 deletions packages/icon-helpers/src/__tests__/toString-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ const defaultDescriptor = {
{
elem: 'path',
attrs: {
d:
'M12 11.03v4h-2v-4H8v6h4v4h2v-10h-2zm12.19 0H22l-3 4.39v-4.39h-2v10h2V18.3l.91-1.33L22 21.03h2.19l-2.99-5.62 2.99-4.38z',
d: 'M12 11.03v4h-2v-4H8v6h4v4h2v-10h-2zm12.19 0H22l-3 4.39v-4.39h-2v10h2V18.3l.91-1.33L22 21.03h2.19l-2.99-5.62 2.99-4.38z',
},
},
{
elem: 'path',
attrs: {
d:
'M28 26H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h24a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2zM4 8v16h24V8z',
d: 'M28 26H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h24a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2zM4 8v16h24V8z',
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/icons-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@carbon/cli-reporter": "^10.5.0",
"@carbon/icons": "^11.4.0",
"fs-extra": "^10.0.0",
"prettier": "^2.2.1",
"prettier": "^2.6.2",
"rimraf": "^3.0.0",
"rollup": "^2.46.0",
"vue": "^2.6.8"
Expand Down
3 changes: 2 additions & 1 deletion packages/layout/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ async function build() {
{
filepath: path.join(SCSS_DIR, '_size.scss'),
builder() {
const FILE_BANNER = t.Comment(` Code generated by @carbon/layout. DO NOT EDIT.
const FILE_BANNER =
t.Comment(` Code generated by @carbon/layout. DO NOT EDIT.
Copyright IBM Corp. 2018, 2021
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/ComboBox/ComboBox-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import ComboBox from '../ComboBox';
const items = [
{
id: 'option-0',
text:
'An example option that is really long to show what should be done to handle long text',
text: 'An example option that is really long to show what should be done to handle long text',
},
{
id: 'option-1',
Expand Down
3 changes: 1 addition & 2 deletions packages/react/src/components/ComboBox/ComboBox-test.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ describe('ComboBox', () => {
const items = [
{
id: 'option-0',
text:
'An example option that is really long to show what should be done to handle long text',
text: 'An example option that is really long to show what should be done to handle long text',
},
{
id: 'option-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import mdx from '../ComboBox.mdx';
const items = [
{
id: 'option-0',
text:
'An example option that is really long to show what should be done to handle long text',
text: 'An example option that is really long to show what should be done to handle long text',
},
{
id: 'option-1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,8 @@ const ComposedModal = React.forwardRef(function ComposedModal(
useEffect(() => {
const focusButton = (focusContainerElement) => {
if (focusContainerElement) {
const primaryFocusElement = focusContainerElement.querySelector(
selectorPrimaryFocus
);
const primaryFocusElement =
focusContainerElement.querySelector(selectorPrimaryFocus);
if (primaryFocusElement) {
primaryFocusElement.focus();
return;
Expand Down
8 changes: 2 additions & 6 deletions packages/react/src/components/ContentSwitcher/next/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ function ContentTabs({
size = 'md',
...rest
}) {
const {
activeIndex,
selectedIndex,
setSelectedIndex,
setActiveIndex,
} = React.useContext(ContentSwitcherContext);
const { activeIndex, selectedIndex, setSelectedIndex, setActiveIndex } =
React.useContext(ContentSwitcherContext);
const ref = React.useRef(null);
const prefix = usePrefix();
const className = cx(customClassName, `${prefix}--content-switcher`, {
Expand Down
Loading

0 comments on commit 864e94a

Please sign in to comment.