Skip to content

Commit

Permalink
chore(project): update prettier to 1.19.1 (#5014)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblack committed Jan 13, 2020
1 parent 0e9c181 commit 93b2b9e
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 117 deletions.
Binary file added .yarn/offline-mirror/prettier-1.19.1.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"jest-junit": "^6.4.0",
"lerna": "^3.13.4",
"lint-staged": "^8.1.5",
"prettier": "^1.17.0",
"prettier": "^1.19.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"rimraf": "^2.6.3",
Expand Down
5 changes: 4 additions & 1 deletion packages/bundler/src/bundlers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
const javascript = require('./javascript');
const scss = require('./scss');

const bundlers = new Map([['.js', javascript], ['.scss', scss]]);
const bundlers = new Map([
['.js', javascript],
['.scss', scss],
]);

module.exports = bundlers;
28 changes: 15 additions & 13 deletions packages/bundler/src/commands/inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,21 @@ async function inlineSassDependencies(
...Object.keys(dependencies),
...Object.keys(devDependencies),
];
const inlinedDependencies = (await Promise.all(
allPossibleDependencies.map(async dependency => {
const modules = await findSassModule(dependency, cwd);
if (modules) {
const [scssFolder] = modules;
const dependencyOutputFolder = path.join(vendorFolder, dependency);

await fs.copy(scssFolder, dependencyOutputFolder);

return [dependency, dependencyOutputFolder];
}
})
)).filter(Boolean);
const inlinedDependencies = (
await Promise.all(
allPossibleDependencies.map(async dependency => {
const modules = await findSassModule(dependency, cwd);
if (modules) {
const [scssFolder] = modules;
const dependencyOutputFolder = path.join(vendorFolder, dependency);

await fs.copy(scssFolder, dependencyOutputFolder);

return [dependency, dependencyOutputFolder];
}
})
)
).filter(Boolean);

if (inlinedDependencies.length === 0) {
return;
Expand Down
18 changes: 10 additions & 8 deletions packages/bundler/src/tools/sassdoc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
-/**
* Copyright IBM Corp. 2018, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';
-(
/**
* Copyright IBM Corp. 2018, 2018
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict'
);

const prettier = require('prettier');
const sassdoc = require('sassdoc');
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"clipboardy": "^2.1.0",
"fs-extra": "^8.0.1",
"inquirer": "^6.4.1",
"prettier": "^1.18.2",
"prettier": "^1.19.1",
"progress-estimator": "^0.2.2",
"remark": "^10.0.1",
"yargs": "^13.2.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ class StructuredList extends mixin(

_handleClick(evt) {
const selectedRow = eventMatches(evt, this.options.selectorRow);
toArray(this.element.querySelectorAll(this.options.selectorRow)).forEach(
row => row.classList.remove(this.options.classActive)
);
toArray(
this.element.querySelectorAll(this.options.selectorRow)
).forEach(row => row.classList.remove(this.options.classActive));
if (selectedRow) {
selectedRow.classList.add(this.options.classActive);
}
Expand All @@ -96,9 +96,9 @@ class StructuredList extends mixin(
_handleKeydownChecked(evt) {
evt.preventDefault(); // prevent spacebar from scrolling page
const selectedRow = eventMatches(evt, this.options.selectorRow);
toArray(this.element.querySelectorAll(this.options.selectorRow)).forEach(
row => row.classList.remove(this.options.classActive)
);
toArray(
this.element.querySelectorAll(this.options.selectorRow)
).forEach(row => row.classList.remove(this.options.classActive));
if (selectedRow) {
selectedRow.classList.add(this.options.classActive);
const input =
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ class Tooltip extends mixin(
// Note: SVGElement in IE11 does not have `.contains()`
const wentToSelf =
(relatedTarget &&
(this.element.contains && this.element.contains(relatedTarget))) ||
this.element.contains &&
this.element.contains(relatedTarget)) ||
(this.tooltip && this.tooltip.element.contains(relatedTarget));
shouldPreventClose = hadContextMenu || wentToSelf;
}
Expand Down
68 changes: 17 additions & 51 deletions packages/components/src/globals/js/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,35 @@
*/

export { default as Checkbox } from '../../components/checkbox/checkbox';
export {
default as FileUploader,
} from '../../components/file-uploader/file-uploader';
export {
default as ContentSwitcher,
} from '../../components/content-switcher/content-switcher';
export { default as FileUploader } from '../../components/file-uploader/file-uploader';
export { default as ContentSwitcher } from '../../components/content-switcher/content-switcher';
export { default as Tab } from '../../components/tabs/tabs';
export {
default as OverflowMenu,
} from '../../components/overflow-menu/overflow-menu';
export { default as OverflowMenu } from '../../components/overflow-menu/overflow-menu';
export { default as Modal } from '../../components/modal/modal';
export { default as Loading } from '../../components/loading/loading';
export {
default as InlineLoading,
} from '../../components/inline-loading/inline-loading';
export { default as InlineLoading } from '../../components/inline-loading/inline-loading';
export { default as Dropdown } from '../../components/dropdown/dropdown';
export {
default as NumberInput,
} from '../../components/number-input/number-input';
export {
default as DataTableV2,
} from '../../components/data-table-v2/data-table-v2';
export { default as NumberInput } from '../../components/number-input/number-input';
export { default as DataTableV2 } from '../../components/data-table-v2/data-table-v2';
export { default as DataTable } from '../../components/data-table/data-table';
export {
default as DatePicker,
} from '../../components/date-picker/date-picker';
export { default as DatePicker } from '../../components/date-picker/date-picker';
export { default as Pagination } from '../../components/pagination/pagination';
export { default as Search } from '../../components/search/search';
export { default as Accordion } from '../../components/accordion/accordion';
export {
default as CopyButton,
} from '../../components/copy-button/copy-button';
export {
default as Notification,
} from '../../components/notification/notification';
export { default as CopyButton } from '../../components/copy-button/copy-button';
export { default as Notification } from '../../components/notification/notification';
export { default as Toolbar } from '../../components/toolbar/toolbar';
export { default as Tooltip } from '../../components/tooltip/tooltip';
export {
default as ProgressIndicator,
} from '../../components/progress-indicator/progress-indicator';
export {
default as FloatingMenu,
} from '../../components/floating-menu/floating-menu';
export {
default as StructuredList,
} from '../../components/structured-list/structured-list';
export { default as ProgressIndicator } from '../../components/progress-indicator/progress-indicator';
export { default as FloatingMenu } from '../../components/floating-menu/floating-menu';
export { default as StructuredList } from '../../components/structured-list/structured-list';
export { default as Slider } from '../../components/slider/slider';
export { default as Tile } from '../../components/tile/tile';
export {
default as CodeSnippet,
} from '../../components/code-snippet/code-snippet';
export { default as CodeSnippet } from '../../components/code-snippet/code-snippet';
export { default as TextInput } from '../../components/text-input/text-input';
export { default as SideNav } from '../../components/ui-shell/side-nav';
export {
default as HeaderSubmenu,
} from '../../components/ui-shell/header-submenu';
export { default as HeaderSubmenu } from '../../components/ui-shell/header-submenu';
export { default as HeaderNav } from '../../components/ui-shell/header-nav';
export {
default as NavigationMenu,
} from '../../components/ui-shell/navigation-menu';
export {
default as ProductSwitcher,
} from '../../components/ui-shell/product-switcher';
export {
default as PaginationNav,
} from '../../components/pagination-nav/pagination-nav';
export { default as NavigationMenu } from '../../components/ui-shell/navigation-menu';
export { default as ProductSwitcher } from '../../components/ui-shell/product-switcher';
export { default as PaginationNav } from '../../components/pagination-nav/pagination-nav';
10 changes: 6 additions & 4 deletions packages/components/tests/styles-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ describe('styles', () => {
const filepath = path.join(cwd, relativeFilePath);
try {
expect(
(await render({
file: filepath,
...defaultOptions,
})).css
(
await render({
file: filepath,
...defaultOptions,
})
).css
).toBeDefined();
} catch (error) {
const { column, line, message } = error;
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 @@ -30,7 +30,7 @@
"js-yaml": "^3.12.1",
"klaw-sync": "^6.0.0",
"memfs": "^2.14.0",
"prettier": "^1.17.0",
"prettier": "^1.19.1",
"prop-types": "^15.6.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
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 @@ -30,7 +30,7 @@
"@carbon/cli-reporter": "10.3.0",
"@carbon/icons": "^10.8.0",
"fs-extra": "^7.0.1",
"prettier": "^1.17.0",
"prettier": "^1.19.1",
"rimraf": "^2.6.2",
"rollup": "^1.15.1",
"vue": "^2.6.8"
Expand Down
6 changes: 3 additions & 3 deletions packages/react/scripts/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const { terser } = require('rollup-plugin-terser');
const sizes = require('rollup-plugin-sizes');

const packageJson = require('../package.json');
const peerDependencies = Object.keys(packageJson.peerDependencies || {}).concat(
['classnames', 'prop-types']
);
const peerDependencies = Object.keys(
packageJson.peerDependencies || {}
).concat(['classnames', 'prop-types']);

const env = process.env.NODE_ENV || 'development';
const prodSettings =
Expand Down
23 changes: 11 additions & 12 deletions packages/react/src/components/FileUploader/FileUploaderItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,18 @@ export default function FileUploaderItem({
}}
/>
</span>
{invalid &&
(errorSubject && (
<div className={`${prefix}--form-requirement`}>
<div className={`${prefix}--form-requirement__title`}>
{errorSubject}
</div>
{errorBody && (
<p className={`${prefix}--form-requirement__supplement`}>
{errorBody}
</p>
)}
{invalid && errorSubject && (
<div className={`${prefix}--form-requirement`}>
<div className={`${prefix}--form-requirement__title`}>
{errorSubject}
</div>
))}
{errorBody && (
<p className={`${prefix}--form-requirement__supplement`}>
{errorBody}
</p>
)}
</div>
)}
</span>
);
}
Expand Down
10 changes: 8 additions & 2 deletions packages/react/src/components/MultiSelect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ You can then create the `MultiSelect` by the following:
invalid={false}
invalidText="Invalid Selection"
onChange={onChange}
items={[{ id: 'item-1', text: 'Item 1' }, { id: 'item-2', text: 'Item 2' }]}
items={[
{ id: 'item-1', text: 'Item 1' },
{ id: 'item-2', text: 'Item 2' },
]}
itemToString={itemToString}
initialSelectedItems={[
{ id: 'item-1', text: 'Item 1' },
Expand Down Expand Up @@ -94,7 +97,10 @@ the list. For instance you can use:
invalid={false}
invalidText="Invalid Selection"
onChange={onChange}
items={[{ id: 'item-1', text: 'Item 1' }, { id: 'item-2', text: 'Item 2' }]}
items={[
{ id: 'item-1', text: 'Item 1' },
{ id: 'item-2', text: 'Item 2' },
]}
initialSelectedItems={[
{ id: 'item-1', text: 'Item 1' },
{ id: 'item-2', text: 'Item 2' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ describe('defaultSortItems', () => {
});

it('should sort un-selected alpha-numeric sequences with increasing order', () => {
const mockItems = ['Option 1', 'Option 10', 'Option 11', 'Option 2'].map(
label => ({ label })
);
const mockItems = [
'Option 1',
'Option 10',
'Option 11',
'Option 2',
].map(label => ({ label }));
expect(defaultSortItems(mockItems, mockOptions)).toEqual([
{
label: 'Option 1',
Expand All @@ -81,9 +84,12 @@ describe('defaultSortItems', () => {
});

it('should order a selected item before all other options', () => {
const mockItems = ['Option 1', 'Option 10', 'Option 11', 'Option 2'].map(
label => ({ label })
);
const mockItems = [
'Option 1',
'Option 10',
'Option 11',
'Option 2',
].map(label => ({ label }));

// Set `selectedItems` to ['Option 11']
mockOptions.selectedItems = [mockItems[2]];
Expand All @@ -105,9 +111,12 @@ describe('defaultSortItems', () => {
});

it('should sort selected items and order them before all other options', () => {
const mockItems = ['Option 1', 'Option 10', 'Option 11', 'Option 2'].map(
label => ({ label })
);
const mockItems = [
'Option 1',
'Option 10',
'Option 11',
'Option 2',
].map(label => ({ label }));

// Set `selectedItems` to ['Option 11', 'Option 2']
mockOptions.selectedItems = [mockItems[2], mockItems[3]];
Expand Down
2 changes: 1 addition & 1 deletion packages/scss-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"access": "public"
},
"dependencies": {
"prettier": "^1.17.0"
"prettier": "^1.19.1"
}
}
2 changes: 1 addition & 1 deletion packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"react-dom": "^16.9.0"
},
"dependencies": {
"prettier": "^1.17.0",
"prettier": "^1.19.1",
"resolve": "^1.12.0",
"tabbable": "^4.0.0"
},
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18427,11 +18427,16 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^1.16.4, prettier@^1.17.0, prettier@^1.18.2:
prettier@^1.16.4:
version "1.18.2"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==

prettier@^1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==

pretty-error@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
Expand Down

0 comments on commit 93b2b9e

Please sign in to comment.