diff --git a/e2e/08-autofix/imports-order/Foo1AfterFix.sol b/e2e/08-autofix/imports-order/Foo1AfterFix.sol index e835d7dd..6e7e8cae 100644 --- a/e2e/08-autofix/imports-order/Foo1AfterFix.sol +++ b/e2e/08-autofix/imports-order/Foo1AfterFix.sol @@ -1,24 +1,24 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.0; -import { ReentrancyGuardUpgradeable2 } from '@apenzeppelin/ReentrancyGuardUpgradeable2.sol'; -import '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol'; -import 'http://github.com/owner/repo/blob/branch/path/to/Contract2.sol'; -import 'https://github.com/owner/repo/blob/branch/path/to/Contract.sol'; -import './../../../../token/interfaces/AFakeContract1.sol'; -import './../../../../token/interfaces/FakeContract1.sol'; -import { FakeContract2 } from './../../../token/interfaces/FakeContract2.sol'; -import { FakeContract3 } from './../../../token/interfaces/FakeContract3.sol'; -import './../../apath/zContract.sol'; -import './../../bpath/otherfolder/otherfolder/aContract.sol'; -import { IXTokenFactory, holaquetal } from './../../token/interfaces/IXTokenFactory.sol'; -import './../token/interfaces/IXTokenWrapper.sol'; -import { IXTokenWrapper2 } from './../token/interfaces/IXTokenWrapper2.sol'; -import { Afool1 } from './Afool1.sol'; -import { Unauthorized, add as func, Point } from './Foo.sol'; -import { Initializable } from './openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol'; -import './Ownable.sol'; -import './ThisIsAVeryLongFileOnPurposeToTestTheFirstPathShorterThanTheLastOnelooooooooooong.sol'; +import { ReentrancyGuardUpgradeable2 } from "@apenzeppelin/ReentrancyGuardUpgradeable2.sol"; +import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; +import "http://github.com/owner/repo/blob/branch/path/to/Contract2.sol"; +import "https://github.com/owner/repo/blob/branch/path/to/Contract.sol"; +import "./../../../../token/interfaces/AFakeContract1.sol"; +import "./../../../../token/interfaces/FakeContract1.sol"; +import { FakeContract2 } from "./../../../token/interfaces/FakeContract2.sol"; +import { FakeContract3 } from "./../../../token/interfaces/FakeContract3.sol"; +import "./../../apath/zContract.sol"; +import "./../../bpath/otherfolder/otherfolder/aContract.sol"; +import { IXTokenFactory, holaquetal } from "./../../token/interfaces/IXTokenFactory.sol"; +import "./../token/interfaces/IXTokenWrapper.sol"; +import { IXTokenWrapper2 } from "./../token/interfaces/IXTokenWrapper2.sol"; +import { Afool1 } from "./Afool1.sol"; +import { Unauthorized, add as func, Point } from "./Foo.sol"; +import { Initializable } from "./openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; +import "./Ownable.sol"; +import "./ThisIsAVeryLongFileOnPurposeToTestTheFirstPathShorterThanTheLastOnelooooooooooong.sol"; contract ImportsOrder { constructor() {} diff --git a/lib/rules/naming/imports-order.js b/lib/rules/naming/imports-order.js index 77807d37..8e298b7e 100644 --- a/lib/rules/naming/imports-order.js +++ b/lib/rules/naming/imports-order.js @@ -91,7 +91,8 @@ class ImportsOrderChecker extends BaseChecker { let currentStart = Math.min(...this.fromContractImports.map((imp) => imp.range[0])) // Prepare replacements changing the range const replacements = this.orderedImports.map((orderedImport) => { - const newText = orderedImport.fullSentence + // replace single quotes by double quotes + const newText = orderedImport.fullSentence.replace(/'/g, '"') const rangeEnd = currentStart + newText.length const replacement = {