Why does "^[./]" match "../"? #144
-
Given the following prettier configuration: importOrder: ["<THIRD_PARTY_MODULES>", "^[./]"]
importOrderSeparation: true
importOrderSortSpecifiers: true And the following imports: import type { Greeter } from "../src/types/Greeter";
import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
import type { Fixture } from "ethereum-waffle"; This plugin reorders the imports like this: import type { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
import type { Fixture } from "ethereum-waffle";
import type { Greeter } from "../src/types/Greeter"; That works for me just fine, but I want to understand why it works in the first place. Why does |
Beta Was this translation helpful? Give feedback.
Answered by
msellsactivecampaign
Mar 25, 2022
Replies: 1 comment
-
The regular expression |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
PaulRBerg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The regular expression
[./]
is the character set that includes a.
and/
, so it's just looking for anything that has a period or slash as the first character.