Skip to content

Commit

Permalink
First implementation of 9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerun committed Jan 19, 2019
1 parent 7246d96 commit 173ae51
Show file tree
Hide file tree
Showing 20 changed files with 226 additions and 847 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ lib
package
yarn-error.log
npm-error.log
package-lock.json
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test/*.js
83 changes: 0 additions & 83 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The MIT License (MIT)
Copyright (c) 2017 Adam Stankiewicz
Copyright (c) 2017-present Adam Stankiewicz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

While `standard` is a **linter**, `prettier-standard` is a **formatter**. You don't have to fix any warnings anymore :relieved:


**Warning:** Most recent version of prettier-standard is compatible with eslint >= 5 and node >= 8. If you're looking for support for older versions of eslint or node please `npm install --save prettier-standard@8`

## Installation

```
Expand All @@ -14,20 +17,20 @@ yarn add --dev prettier-standard
> You can also install globally with `npm install -g prettier-standard`
## Usage
## Examples

```
Prettier and standard brought together!
```ash
# Format all files in src directory
prettier-standard 'src/**/*.js'

Usage
$ prettier-standard [<glob>...]
# Format standard input
echo 'const {foo} = "bar";' | prettier-standard
```

Options
--log-level Log level to use (default: warn)
## Usage

Examples
$ prettier-standard 'src/**/*.js'
$ echo "const {foo} = "bar";" | prettier-standard
```bash
prettier-standard [<glob>...]
```

Typically you'll use this in your [npm scripts][npm scripts] (or [package scripts][package scripts]):
Expand Down Expand Up @@ -58,7 +61,7 @@ We also encourage to use [husky](https://github.com/typicode/husky) and [lint-st
}
```

NOTE: Unlike [prettier](https://github.com/prettier/prettier) this package simplifies your workflow by making `--write` flag a default, and allowing for passing code to stdin without additional `--stdin` flag. Now **that's** prettier!
NOTE: Unlike [prettier](https://github.com/prettier/prettier) this package simplifies your workflow by making `--write` flag a default, and allowing for passing code to stdin without additional `--stdin` flag.

### Vim

Expand Down Expand Up @@ -95,27 +98,15 @@ You can now use 'prettier-standard' in Sublime Text 3 by opening the **Command P

## Customizing

Because this package is built on top of [prettier-eslint](https://github.com/prettier/prettier-eslint), you can fully configure its behavior with custom `.eslintrc` file. For example you might want to opt-out of single quotes with following. Any eslint rules are supported.
You can use .prettierc for overriding some options, e.g to use [semistandard](https://www.npmjs.com/package/semistandard):


```json
{
"rules": {
"quotes": ["error", "double"],
"jsx-quotes": ["error", "prefer-double"]
}
"semi": true
}
```

Additionally, you can use different versions of eslint and prettier. Just include them as a devDependency of your project. prettier-standard will properly recognize this, and use your versions of prettier and eslint instead.


## Related

- [prettier](https://github.com/prettier/prettier) - the core package
- [prettier-eslint](https://github.com/prettier/prettier-eslint) - used for integrating with eslint
- [prettier-eslint-cli](https://github.com/prettier/prettier-eslint-cli) - this package is based on it

## Contributors

This package follows [all-contributors](https://github.com/kentcdodds/all-contributors) specification.
Expand Down
5 changes: 0 additions & 5 deletions __mocks__/find-up.js

This file was deleted.

16 changes: 0 additions & 16 deletions __mocks__/fs.js

This file was deleted.

5 changes: 0 additions & 5 deletions __mocks__/get-stdin.js

This file was deleted.

70 changes: 0 additions & 70 deletions __mocks__/glob.js

This file was deleted.

18 changes: 0 additions & 18 deletions __mocks__/prettier-eslint.js

This file was deleted.

54 changes: 28 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
{
"name": "prettier-standard",
"version": "8.0.1",
"version": "9.0.0-beta.0",
"description": "Prettier and standard brought together!",
"main": "src/no-main.js",
"main": "src/index.js",
"bin": {
"prettier-standard": "src/index.js"
"prettier-standard": "src/cli.js"
},
"keywords": [
"prettier",
"eslint",
"standard"
],
"engines": {
"node": ">=8"
},
"author": "Adam Stankiewicz <[email protected]>",
"license": "MIT",
"repository": "sheerun/prettier-standard",
"dependencies": {
"@sheerun/eslint-config-standard": "^10.2.1",
"babel-eslint": ">=7.2.3",
"babel-runtime": "^6.23.0",
"chalk": "^2.3.0",
"eslint": "^4.7.2",
"find-up": "^2.1.0",
"get-stdin": "^5.0.1",
"glob": "^7.1.2",
"ignore": "^3.3.3",
"indent-string": "^3.1.0",
"lodash.memoize": "^4.1.2",
"loglevel-colored-level-prefix": "^1.0.0",
"messageformat": "^1.0.2",
"minimist": "1.2.0",
"prettier": "1.9.x",
"prettier-eslint": "^8.1.1",
"rxjs": "^5.4.0"
"find-up": "^3.0.0",
"get-stdin": "^6.0.0",
"minimist": "^1.2.0",
"prettierx": "0.3.0",
"stream-mock": "1.2.0"
},
"devDependencies": {
"cross-run": "^1.0.1",
"modern-node": "1.0.0-alpha.2"
"babel-eslint": ">=10.0.1",
"eslint": "^5.6.1",
"eslint-config-prettier": "3.1.0",
"eslint-config-standard": "12.0.0",
"eslint-config-standard-jsx": "6.0.2",
"eslint-config-standard-react": "7.0.2",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-promise": "^4.0.0",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-standard": "^4.0.0"
},
"scripts": {
"format": "modern format",
"test": "modern test && cat test/input.js | NODE_ENV=test node ./src/index.js > ./test/output.js && export DIFF=\"$(diff ./test/expected.js ./test/output.js)\" && [ -z \"$DIFF\" ] || (echo \"$DIFF\" && exit 1)",
"build": "modern build"
"format": "node src/cli.js '**/*.js'",
"lint": "node src/cli.js '**/*.js' --lint",
"test": "cat test/input.js | NODE_ENV=test node ./src/cli.js > ./test/output.js && export DIFF=\"$(diff ./test/expected.js ./test/output.js)\" && [ -z \"$DIFF\" ] || (echo \"$DIFF\" && exit 1)"
},
"files": ["src"]
"files": [
"src"
]
}
Loading

0 comments on commit 173ae51

Please sign in to comment.