eslint-config-standard-typescript-prettier icon indicating copy to clipboard operation
eslint-config-standard-typescript-prettier copied to clipboard

Fix prettier config for formats other than TS.

Open momocow opened this issue 3 years ago • 0 comments
trafficstars

What change has been made in this PR

Use override instead of putting the parser option at the top level of the configuration to avoid disabling Prettier’s automatic file extension based parser inference.

See https://stackoverflow.com/a/68088956/8579025

Use cases:

// .lintstagedrc.js
module.exports = {
  '*.ts': ['prettier --write', 'eslint --fix'],
  '*.json': ['prettier --write'] // this will throw SyntaxError if using 'parser' option in prettier.js
};

momocow avatar Jan 28 '22 06:01 momocow