Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: eslint-plugin-prettier @ 3.0.1 .. 3.1.0

CHANGELOG.md

@@ -1,5 +1,45 @@
# Changelog
+## v3.1.0 (2019-05-11)
+
+* New: Allow options to be passed to prettier.getFileInfo ([#187](https://github.com/prettier/eslint-plugin-prettier/issues/187)) ([21fa69a](https://github.com/prettier/eslint-plugin-prettier/commit/21fa69a8ed3b6acfc5461f6c3332444c21e65e28))
+* build(deps-dev): bump eslint-plugin-eslint-plugin from 2.0.1 to 2.1.0 ([bb597e1](https://github.com/prettier/eslint-plugin-prettier/commit/bb597e14aba46211fd4149d0b0f1bdc51fe76452))
+* build(deps-dev): bump eslint-config-prettier from 4.1.0 to 4.2.0 ([0bb7c1d](https://github.com/prettier/eslint-plugin-prettier/commit/0bb7c1d361b581fddebd64bf172b5dedcad5149c))
+* build(deps-dev): bump vue-eslint-parser from 6.0.3 to 6.0.4 ([2f77df4](https://github.com/prettier/eslint-plugin-prettier/commit/2f77df48f151d4975bbdb29ced8c74a72d011428))
+* build(deps-dev): bump mocha from 6.1.3 to 6.1.4 ([222b87a](https://github.com/prettier/eslint-plugin-prettier/commit/222b87a347331b20b3e7f65dcdfaa491bd277b3a))
+* build(deps-dev): bump prettier from 1.16.4 to 1.17.0 ([58d8ff8](https://github.com/prettier/eslint-plugin-prettier/commit/58d8ff8ab2b1f73c904f5492eb523d7ea585ed8f))
+* build(deps-dev): bump mocha from 6.1.2 to 6.1.3 ([e94e56c](https://github.com/prettier/eslint-plugin-prettier/commit/e94e56c36018aab6e08452fbe05bb16a23d64197))
+* build(deps-dev): bump mocha from 6.1.1 to 6.1.2 ([c02244b](https://github.com/prettier/eslint-plugin-prettier/commit/c02244b197893f4e2a214d43f755b726cecbd03c))
+* build(deps-dev): bump mocha from 6.0.2 to 6.1.1 ([a9a2e4e](https://github.com/prettier/eslint-plugin-prettier/commit/a9a2e4e3c0a243ec73061c10d9c4a5ae0c0e6f68))
+* build(deps-dev): bump eslint from 5.15.3 to 5.16.0 ([073c14c](https://github.com/prettier/eslint-plugin-prettier/commit/073c14c2ae5c43d0939fe6f475561f1cf3d7a3e5))
+* build(deps-dev): bump eslint from 5.15.2 to 5.15.3 ([bda931f](https://github.com/prettier/eslint-plugin-prettier/commit/bda931f4f1344f6927fbfd3a35965d1a4d319642))
+* build(deps-dev): bump eslint from 5.15.1 to 5.15.2 ([19f53d6](https://github.com/prettier/eslint-plugin-prettier/commit/19f53d6a94a701e0aab9630bef93051aec4dfd36))
+* build(deps-dev): bump eslint from 5.15.0 to 5.15.1 ([34b39de](https://github.com/prettier/eslint-plugin-prettier/commit/34b39dec2e6e283da1ca6faa0c636c5361efb5b9))
+* build(deps-dev): bump eslint from 5.14.1 to 5.15.0 ([13bcc66](https://github.com/prettier/eslint-plugin-prettier/commit/13bcc66c120d614c17040e329360510feab47e7d))
+* build(deps-dev): bump eslint-plugin-self from 1.1.0 to 1.2.0 ([5b4adb8](https://github.com/prettier/eslint-plugin-prettier/commit/5b4adb8ce683a93feddad07eda17d99b41849342))
+* build(deps-dev): bump vue-eslint-parser from 6.0.2 to 6.0.3 ([e676cd1](https://github.com/prettier/eslint-plugin-prettier/commit/e676cd19387e70102467d9a82014906561f3c225))
+* build(deps-dev): bump eslint-config-prettier from 4.0.0 to 4.1.0 ([b8a9215](https://github.com/prettier/eslint-plugin-prettier/commit/b8a9215515cdcb75faf212caeb00dfbcae11ee42))
+* build(deps-dev): bump mocha from 6.0.1 to 6.0.2 ([cde36e4](https://github.com/prettier/eslint-plugin-prettier/commit/cde36e4db18ac4442eba3c75a20c1a6605e937d4))
+* build(deps-dev): bump mocha from 6.0.0 to 6.0.1 ([eb39699](https://github.com/prettier/eslint-plugin-prettier/commit/eb39699b9bdf7c406a3134cc26c404947534661d))
+* build(deps-dev): bump mocha from 5.2.0 to 6.0.0 ([5d75421](https://github.com/prettier/eslint-plugin-prettier/commit/5d75421d5e3ee5f8293b47a5825e1f2415f7e6b9))
+* build(deps-dev): bump eslint from 5.14.0 to 5.14.1 ([829156e](https://github.com/prettier/eslint-plugin-prettier/commit/829156e467e53f554691afa687c13715086974f7))
+* build(deps-dev): bump eslint from 5.13.0 to 5.14.0 ([b76d0b4](https://github.com/prettier/eslint-plugin-prettier/commit/b76d0b4471845143630b3603b97607665bf66ca0))
+* build(deps-dev): bump vue-eslint-parser from 6.0.0 to 6.0.2 ([15439e8](https://github.com/prettier/eslint-plugin-prettier/commit/15439e8e0dcfa11a19f0cf249a1f4ad5f7fa5b96))
+* build(deps-dev): bump vue-eslint-parser from 5.0.0 to 6.0.0 ([0ea70e5](https://github.com/prettier/eslint-plugin-prettier/commit/0ea70e5161d315ab93e6c4eb93f76d5304b8c162))
+* build(deps-dev): bump eslint from 5.12.1 to 5.13.0 ([5f18729](https://github.com/prettier/eslint-plugin-prettier/commit/5f18729dbe359fe0df10730fd768a1ca6949b0a2))
+* build(deps-dev): bump prettier from 1.16.3 to 1.16.4 ([ef637fe](https://github.com/prettier/eslint-plugin-prettier/commit/ef637fea4d6028b472cfe56dcb4fe30ee7939e0d))
+* build(deps-dev): bump prettier from 1.16.1 to 1.16.3 ([58ab20c](https://github.com/prettier/eslint-plugin-prettier/commit/58ab20cc03f81a7d668998e64168eef7ad5b4365))
+* build(deps-dev): bump eslint-config-prettier from 3.6.0 to 4.0.0 ([14393bd](https://github.com/prettier/eslint-plugin-prettier/commit/14393bdbcfd6114e810c10b4b7f905485474a36f))
+* build(deps-dev): bump prettier from 1.16.0 to 1.16.1 ([00198b9](https://github.com/prettier/eslint-plugin-prettier/commit/00198b9795d1341f4c4a488c83f656e74f6bfdb0))
+* build(deps-dev): bump prettier from 1.15.3 to 1.16.0 ([7890a87](https://github.com/prettier/eslint-plugin-prettier/commit/7890a876fc1c22b1fdee8724296eaa56eb6df1a3))
+* build(deps-dev): bump eslint from 5.12.0 to 5.12.1 ([92a8984](https://github.com/prettier/eslint-plugin-prettier/commit/92a898470fbd88a4f5f4d8e1b15cf53bd7f8a92e))
+* build(deps-dev): bump eslint-config-prettier from 3.5.0 to 3.6.0 ([5292d12](https://github.com/prettier/eslint-plugin-prettier/commit/5292d127dfd4f90ec6695d4060b5f5447a2c0119))
+* build(deps-dev): bump eslint-config-prettier from 3.4.0 to 3.5.0 ([44a2558](https://github.com/prettier/eslint-plugin-prettier/commit/44a2558820d1c733f1572c98503e7b00b16b3fb7))
+* build(deps-dev): bump eslint-config-prettier from 3.3.0 to 3.4.0 ([425cfce](https://github.com/prettier/eslint-plugin-prettier/commit/425cfce1bb712c96dfdd2292b04d89cceb375681))
+* build(deps-dev): bump eslint from 5.11.1 to 5.12.0 ([3e9aa39](https://github.com/prettier/eslint-plugin-prettier/commit/3e9aa399ee3c0394a397f6ed3f8ec7c5e1597991))
+* build(deps-dev): bump eslint-plugin-node from 8.0.0 to 8.0.1 ([e913afd](https://github.com/prettier/eslint-plugin-prettier/commit/e913afdd7291b5e58adf567f5e7a5bb9257dc9e3))
+* build(deps-dev): bump vue-eslint-parser from 4.0.3 to 5.0.0 ([ecfd5ba](https://github.com/prettier/eslint-plugin-prettier/commit/ecfd5bab7bfb36e0203a334808243cb85aaeb512))
+
## v3.0.1 (2018-12-28)
* Catch and format SyntaxErrors as eslint violations ([#141](https://github.com/prettier/eslint-plugin-prettier/issues/141)) ([4a0e57d](https://github.com/prettier/eslint-plugin-prettier/commit/4a0e57ddcc0fa2ae8e8f7d8b65ddc4ac93d9f474))

eslint-plugin-prettier.js

@@ -131,7 +131,12 @@
{
type: 'object',
properties: {
- usePrettierrc: { type: 'boolean' }
+ usePrettierrc: { type: 'boolean' },
+ fileInfoOptions: {
+ type: 'object',
+ properties: {},
+ additionalProperties: true
+ }
},
additionalProperties: true
}
@@ -140,6 +145,8 @@
create(context) {
const usePrettierrc =
!context.options[1] || context.options[1].usePrettierrc !== false;
+ const eslintFileInfoOptions =
+ (context.options[1] && context.options[1].fileInfoOptions) || {};
const sourceCode = context.getSourceCode();
const filepath = context.getFilename();
const source = sourceCode.text;
@@ -163,9 +170,14 @@
})
: null;
- const prettierFileInfo = prettier.getFileInfo.sync(filepath, {
- ignorePath: '.prettierignore'
- });
+ const prettierFileInfo = prettier.getFileInfo.sync(
+ filepath,
+ Object.assign(
+ {},
+ { ignorePath: '.prettierignore' },
+ eslintFileInfoOptions
+ )
+ );
// Skip if file is ignored using a .prettierignore file
if (prettierFileInfo.ignored) {

package.json

@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-prettier",
- "version": "3.0.1",
+ "version": "3.1.0",
"description": "Runs prettier as an eslint rule",
"keywords": [
"eslint",
@@ -38,13 +38,13 @@
"@not-an-aardvark/node-release-script": "^0.1.0",
"eslint": "^5.6.0",
"eslint-config-not-an-aardvark": "^2.1.0",
- "eslint-config-prettier": "^3.1.0",
+ "eslint-config-prettier": "^4.0.0",
"eslint-plugin-eslint-plugin": "^2.0.0",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-self": "^1.1.0",
- "mocha": "^5.2.0",
+ "mocha": "^6.0.0",
"prettier": "^1.15.3",
- "vue-eslint-parser": "^4.0.2"
+ "vue-eslint-parser": "^6.0.0"
},
"engines": {
"node": ">=6.0.0"

README.md

@@ -121,6 +121,16 @@
}]
```
+ - `fileInfoOptions`: Options that are passed to [prettier.getFileInfo](https://prettier.io/docs/en/api.html#prettiergetfileinfofilepath-options) to decide whether a file needs to be formatted. Can be used for example to opt-out from ignoring files located in `node_modules` directories.
+
+ ```json
+ "prettier/prettier": ["error", {}, {
+ "fileInfoOptions": {
+ "withNodeModules": true
+ }
+ }]
+ ```
+
- The rule is autofixable -- if you run `eslint` with the `--fix` flag, your code will be formatted according to `prettier` style.
---