Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Add a typescript-prettier config (#58)
Browse files Browse the repository at this point in the history
* Add a typescript-prettier config

* v18.2.0-alpha.1

* fix config and update docs

* v18.2.0-alpha.2

* ignore package.json formatting

* Revert version back
  • Loading branch information
ismail-syed committed Dec 5, 2017
1 parent ccaa32a commit 1e6da09
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .prettierignore
@@ -0,0 +1,2 @@
*.md
package.json
5 changes: 4 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,9 @@
# Changelog

<!-- ## Unreleased -->
## Unreleased

### Added
* Added a `typescript-prettier` config to run prettier against typescript projects.

## [18.1.0] - 2017-10-31

Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -90,6 +90,7 @@ This plugin also provides the following tool-specific configurations, which can
- [flow](lib/config/flow.js): Use this for projects that use [flow](http://flowtype.org) for type checking.
- [jquery](lib/config/jquery.js): Use this for projects that use [jQuery](http://jquery.com).
- [prettier](lib/config/prettier.js): Use [prettier](https://github.com/prettier/prettier) for consistent formatting. Extending this Shopify's prettier config will [override](https://github.com/prettier/eslint-config-prettier/blob/master/index.js) the default Shopify eslint rules in favor of prettier formatting.
- [typescript-prettier](lib/config/typescript-prettier.js): Use [prettier](https://github.com/prettier/prettier) on typescript projects.

### node

Expand Down
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -26,6 +26,7 @@ module.exports = {
prettier: require('./lib/config/prettier'),
react: require('./lib/config/react'),
typescript: require('./lib/config/typescript'),
'typescript-prettier': require('./lib/config/typescript-prettier'),
'typescript-react': require('./lib/config/typescript-react'),
},
};
2 changes: 2 additions & 0 deletions lib/config/all.js
Expand Up @@ -34,6 +34,7 @@ module.exports = {
'shopify',
'sort-class-members',
'typescript',
'typescript-prettier',
'typescript-react',
],

Expand Down Expand Up @@ -61,6 +62,7 @@ module.exports = {
require('./rules/shopify'),
require('./rules/sort-class-members'),
require('./rules/typescript'),
require('./rules/typescript-prettier'),
require('./rules/typescript-react'),
),
};
16 changes: 16 additions & 0 deletions lib/config/typescript-prettier.js
@@ -0,0 +1,16 @@
module.exports = {
extends: ['plugin:shopify/prettier'],

rules: {
'prettier/prettier': [
'error',
{
parser: 'typescript',
singleQuote: true,
trailingComma: 'all',
bracketSpacing: false,
jsxBracketSameLine: false,
},
],
},
};

0 comments on commit 1e6da09

Please sign in to comment.