solhint icon indicating copy to clipboard operation
solhint copied to clipboard

Solhint not being picked up in CLI but in vscode it is.

Open emretepedev opened this issue 2 years ago • 0 comments

I have changed the compiler requirement but in the CLI it does not found the issue BUT the vscode is correctly highlighting the problem.

yarn run solhint contracts/FooToken.sol output

Done in 0.63s.

But vscode shows "Linter: Compiler version ^0.7.4 does not satisfy the ^0.8.4 semver requirement [compiler-version]" correctly.

.solhint.json

{
  "extends": "solhint:recommended",
  "rules": {
    "compiler-version": ["error", "^0.8.4"],
    "func-visibility": ["warn", { "ignoreConstructors": true }]
  }
}

package.json

{
  // ...
  "devDependencies": {
    "solhint": "^3.3.7",
  }
  // ...
}

contracts/FooToken.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.7.4;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract FooToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("Foo Token", "FOO") {
        _mint(_msgSender(), initialSupply);
    }
}

emretepedev avatar Apr 29 '22 22:04 emretepedev