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