Skip to content

Commit

Permalink
Use @wordpres/prettier-config with @wordpress/scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Mar 13, 2020
1 parent f0a4732 commit 7539155
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 17 deletions.
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,12 @@
"markdown_source": "../packages/postcss-themes/README.md",
"parent": "packages"
},
{
"title": "@wordpress/prettier-config",
"slug": "packages-prettier-config",
"markdown_source": "../packages/prettier-config/README.md",
"parent": "packages"
},
{
"title": "@wordpress/primitives",
"slug": "packages-primitives",
Expand Down
9 changes: 7 additions & 2 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
"@wordpress/library-export-default-webpack-plugin": "file:packages/library-export-default-webpack-plugin",
"@wordpress/npm-package-json-lint-config": "file:packages/npm-package-json-lint-config",
"@wordpress/postcss-themes": "file:packages/postcss-themes",
"@wordpress/prettier-config": "file:packages/prettier-config",
"@wordpress/scripts": "file:packages/scripts",
"babel-loader": "8.0.6",
"babel-plugin-emotion": "10.0.27",
Expand Down
1 change: 1 addition & 0 deletions packages/prettier-config/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
5 changes: 5 additions & 0 deletions packages/prettier-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Master

### Initial Release

- The config was extracted from `@wordpress/scripts` package ([#20026](https://github.com/WordPress/gutenberg/pull/20026)).
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/prettier-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"node": ">=10"
},
"files": [
"lib/prettier-config.js"
"lib/index.js"
],
"main": "lib/prettier-config.js",
"main": "lib/index.js",
"publishConfig": {
"access": "public"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isPlainObject } from 'lodash';
/**
* Internal dependencies
*/
import config from '../lib/prettier-config.js';
import config from '../lib/';

describe( 'prettier config tests', () => {
it( 'should be an object', () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/scripts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Master

## Internal

- Package depends now on the shared Prettier config exposed in `@wordpress/prettier-config` dependency ([#20026](https://github.com/WordPress/gutenberg/pull/20026)).

## 7.1.2 (2020-02-25)

### Bug Fixes
Expand Down
13 changes: 1 addition & 12 deletions packages/scripts/config/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
module.exports = {
useTabs: true,
tabWidth: 4,
printWidth: 80,
singleQuote: true,
trailingComma: 'es5',
bracketSpacing: true,
parenSpacing: true,
jsxBracketSameLine: false,
semi: true,
arrowParens: 'always',
};
module.exports = require( '@wordpress/prettier-config' );
1 change: 1 addition & 0 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"@wordpress/eslint-plugin": "file:../eslint-plugin",
"@wordpress/jest-preset-default": "file:../jest-preset-default",
"@wordpress/npm-package-json-lint-config": "file:../npm-package-json-lint-config",
"@wordpress/prettier-config": "file:../prettier-config",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"chalk": "^2.4.2",
Expand Down

0 comments on commit 7539155

Please sign in to comment.