0

I'm using prettier to lint and fix my formatting of .sol files.

But for some reason, anytime it encounters pragma experimental ABIEncoderV2;, it transforms it to pragma experimental ;.

Why's it doing this?

My .prettierrc.js:

module.exports = {
  overrides: [
    {
      files: "*.sol",
      options: {
        bracketSpacing: false,
        printWidth: 145,
        tabWidth: 4,
        useTabs: false,
        singleQuote: false,
        explicitTypes: "always",
      },
    },
    {
      files: "*.ts",
      options: {
        printWidth: 145,
        semi: false,
        trailingComma: "es5",
      },
    },
  ],
};
3
  • What command are you actually running to apply those formatting rules? Also, do you have prettier-plugin-solidity installed? Jun 10, 2021 at 6:04
  • Yes it's installed and I'm running npx prettier --write Contract.sol
    – doctopus
    Jun 14, 2021 at 1:30
  • Nvm it turns out I needed to upgrade prettier-plugin-solidity
    – doctopus
    Jun 14, 2021 at 1:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.