File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -357,6 +357,7 @@ module.exports = {
357357 ! context . options [ 1 ] || context . options [ 1 ] . usePrettierrc !== false ;
358358 const sourceCode = context . getSourceCode ( ) ;
359359 const source = sourceCode . text ;
360+ const sourceFileName = context . getFilename ( ) ;
360361
361362 // The pragma is only valid if it is found in a block comment at the very
362363 // start of the file.
@@ -401,19 +402,22 @@ module.exports = {
401402 usePrettierrc &&
402403 prettier . resolveConfig &&
403404 prettier . resolveConfig . sync
404- ? prettier . resolveConfig . sync ( context . getFilename ( ) , {
405+ ? prettier . resolveConfig . sync ( sourceFileName , {
405406 editorconfig : true
406407 } )
407408 : null ;
408409 const prettierOptions = Object . assign (
409410 { } ,
410411 prettierRcOptions ,
411412 eslintPrettierOptions ,
412- { filepath : context . getFilename ( ) }
413+ { filepath : sourceFileName }
413414 ) ;
414-
415415 const prettierSource = prettier . format ( source , prettierOptions ) ;
416- if ( source !== prettierSource ) {
416+ const sourceFileInfo = prettier . getFileInfo . sync ( sourceFileName , {
417+ ignorePath : '.prettierignore'
418+ } ) ;
419+
420+ if ( ! sourceFileInfo . ignored && source !== prettierSource ) {
417421 const differences = generateDifferences ( source , prettierSource ) ;
418422
419423 differences . forEach ( difference => {
Original file line number Diff line number Diff line change 11{
22 "name" : " eslint-plugin-prettier" ,
3- "version" : " 2.6.2 " ,
3+ "version" : " 2.6.3 " ,
44 "description" : " Runs prettier as an eslint rule" ,
55 "keywords" : [
66 " eslint" ,
4141 "eslint-plugin-self" : " ^1.0.1" ,
4242 "mocha" : " ^3.1.2" ,
4343 "moment" : " ^2.18.1" ,
44- "prettier" : " ^1.10.2 " ,
44+ "prettier" : " ^1.13.0 " ,
4545 "semver" : " ^5.3.0" ,
4646 "vue-eslint-parser" : " ^2.0.2"
4747 },
You can’t perform that action at this time.
0 commit comments