sheerun / prettier-standard

Formats with Prettier and lints with ESLint+Standard! (✿◠‿◠)
MIT License
868 stars 44 forks source link

Ignoring files #50

Closed Kikobeats closed 5 years ago

Kikobeats commented 6 years ago

Hello,

Could be possible that prettier-standard ignore files based on standard ignore property?

"standard": {
    "globals": [
      "fetch"
    ],
    "parser": "babel-eslint",
    "ignore": [ ←yep
      "/lib/"
    ]
  }
rafaelrinaldi commented 6 years ago

I've been trying to achieve the same result via .prettierignore without success. It seems prettier-standard ignores this feature.

sheerun commented 6 years ago

my guess is that for now you need to ignore files in both places

rafaelrinaldi commented 6 years ago

Just for the record I've also tried to pass down ignore patterns using globs to prettier-standard:

prettier-standard '.json' '!package*.json'

Should format everything but package.json in this case

It doesn't work with this library but it does work with prettier.

rossvz commented 6 years ago

Any update on this? I'm working in a project that requires standardJS code style, but I'd love to have prettier formatting. The only trick is we have one library file that's a few thousands lines long that was imported from legacy code and should NOT be formatted. It seems we can't get this package to respect the .prettierignore

sheerun commented 6 years ago

I'm open for PR that fixes it

millette commented 6 years ago

I copied the content of my .gitignore to .eslintignore:

node_modules/
public
.gatsby-context.js
.DS_Store
.intermediate-representation/
.cache/
.vscode/

That works. The original standard linter uses the .gitignore file by default. That would be handy here too.

sheerun commented 5 years ago

prettier-standard 9.0.0 uses now just prettierx for formatting so you can use .prettierignore and any other ignoring method available to prettier

miguelmota commented 3 years ago

Yep .prettierignore works great

wormple12 commented 2 years ago

Is it possible to add support for prettier's CLI options, for this use case specifically "--ignore-path"? I'm using this package to simplify things, and files like .prettierignore crowds my root folder, so it would be nice to be able to simply link prettier-standard to my .gitignore file.