diff --git a/.yarn/offline-mirror/prettier-1.19.1.tgz b/.yarn/offline-mirror/prettier-1.19.1.tgz new file mode 100644 index 000000000000..9db46df7b01f Binary files /dev/null and b/.yarn/offline-mirror/prettier-1.19.1.tgz differ diff --git a/package.json b/package.json index 7feb35bd7a3f..4eb1b87a6eb2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/packages/bundler/src/bundlers/index.js b/packages/bundler/src/bundlers/index.js index 8c9ccfa97b32..64c9d8ee8a1d 100644 --- a/packages/bundler/src/bundlers/index.js +++ b/packages/bundler/src/bundlers/index.js @@ -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; diff --git a/packages/bundler/src/commands/inline.js b/packages/bundler/src/commands/inline.js index 7071b04ac617..d0500cabad7c 100644 --- a/packages/bundler/src/commands/inline.js +++ b/packages/bundler/src/commands/inline.js @@ -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; diff --git a/packages/bundler/src/tools/sassdoc.js b/packages/bundler/src/tools/sassdoc.js index 5a71eea725fa..1c0a29145d88 100644 --- a/packages/bundler/src/tools/sassdoc.js +++ b/packages/bundler/src/tools/sassdoc.js @@ -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'); diff --git a/packages/cli/package.json b/packages/cli/package.json index d9d11d86c0a0..3b1d93bbd69d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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" diff --git a/packages/components/src/components/structured-list/structured-list.js b/packages/components/src/components/structured-list/structured-list.js index 9fafc3eb8701..957dd9b1c25e 100644 --- a/packages/components/src/components/structured-list/structured-list.js +++ b/packages/components/src/components/structured-list/structured-list.js @@ -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); } @@ -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 = diff --git a/packages/components/src/components/tooltip/tooltip.js b/packages/components/src/components/tooltip/tooltip.js index e8591531058b..31698c78b538 100644 --- a/packages/components/src/components/tooltip/tooltip.js +++ b/packages/components/src/components/tooltip/tooltip.js @@ -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; } diff --git a/packages/components/src/globals/js/components.js b/packages/components/src/globals/js/components.js index 6f6fa7cfac77..e3d19f90f768 100644 --- a/packages/components/src/globals/js/components.js +++ b/packages/components/src/globals/js/components.js @@ -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'; diff --git a/packages/components/tests/styles-test.js b/packages/components/tests/styles-test.js index 9f212072dc8f..7660f3eb8de8 100644 --- a/packages/components/tests/styles-test.js +++ b/packages/components/tests/styles-test.js @@ -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; diff --git a/packages/icon-build-helpers/package.json b/packages/icon-build-helpers/package.json index 1a3fcbfb773f..ef1095e6cbc3 100644 --- a/packages/icon-build-helpers/package.json +++ b/packages/icon-build-helpers/package.json @@ -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", diff --git a/packages/icons-vue/package.json b/packages/icons-vue/package.json index 829ab0137b6c..f5c42eab4607 100644 --- a/packages/icons-vue/package.json +++ b/packages/icons-vue/package.json @@ -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" diff --git a/packages/react/scripts/rollup.config.js b/packages/react/scripts/rollup.config.js index 49c1452d712b..01424d632209 100644 --- a/packages/react/scripts/rollup.config.js +++ b/packages/react/scripts/rollup.config.js @@ -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 = diff --git a/packages/react/src/components/FileUploader/FileUploaderItem.js b/packages/react/src/components/FileUploader/FileUploaderItem.js index 54eb62810cce..099ca41a5717 100644 --- a/packages/react/src/components/FileUploader/FileUploaderItem.js +++ b/packages/react/src/components/FileUploader/FileUploaderItem.js @@ -51,19 +51,18 @@ export default function FileUploaderItem({ }} /> - {invalid && - (errorSubject && ( -
-
- {errorSubject} -
- {errorBody && ( -

- {errorBody} -

- )} + {invalid && errorSubject && ( +
+
+ {errorSubject}
- ))} + {errorBody && ( +

+ {errorBody} +

+ )} +
+ )} ); } diff --git a/packages/react/src/components/MultiSelect/README.md b/packages/react/src/components/MultiSelect/README.md index 9ffd30eb517c..3ab331d423dc 100644 --- a/packages/react/src/components/MultiSelect/README.md +++ b/packages/react/src/components/MultiSelect/README.md @@ -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' }, @@ -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' }, diff --git a/packages/react/src/components/MultiSelect/tools/__tests__/sorting-test.js b/packages/react/src/components/MultiSelect/tools/__tests__/sorting-test.js index 95b9fc034884..8166c6f4feb2 100644 --- a/packages/react/src/components/MultiSelect/tools/__tests__/sorting-test.js +++ b/packages/react/src/components/MultiSelect/tools/__tests__/sorting-test.js @@ -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', @@ -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]]; @@ -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]]; diff --git a/packages/scss-generator/package.json b/packages/scss-generator/package.json index 119636635025..83904f78cbc6 100644 --- a/packages/scss-generator/package.json +++ b/packages/scss-generator/package.json @@ -19,6 +19,6 @@ "access": "public" }, "dependencies": { - "prettier": "^1.17.0" + "prettier": "^1.19.1" } } diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index d24b187f81cd..d79ed42d65bf 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -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" }, diff --git a/yarn.lock b/yarn.lock index 7540d4b4c5aa..6c176f16ead0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"