Skip to content

v2.0.0

Compare
Choose a tag to compare
@trotzig trotzig released this 22 Dec 10:22

Breaking changes:

  • The lookupPaths configuration option has been removed. Use moduleNameFormatter instead to strip out potential prefixes from the path.
  • The stripFromPath configuration option has also been removed in favor of moduleNameFormatter.
  • const is now the default declarationKeyword in node environments.
  • snake_case configuration is no longer supported. It's been deprecated for a while but now finally removed.
  • The importjsd CLI command will now default to show help text instead of starting. Use importjsd run to start it.
  • Local configuration is no longer supported. It's been deprecated for a while but now finally removed. Use a function if you need to use different configuration on different parts of the directory tree.

Added features:

  • "star" type imports are now recognized (e.g. import * from 'foo';)
  • Imports without trailing semicolons are also recognized. If you want to strip out semicolons from the resulting import statements, use ...
  • ... importStatementFormatter, a new configuration option that you can use to modify the resulting import statement. E.g. importStatementFormatter({ importStatement }) => importStatement.replace(/;$/, '').

Other highlights:

  • The dependency on eslint has been removed in favor of using the babylon parser directly to find variables to import. This means faster fixImports, more robust import statement parsing and no pesky eslint version mismatch issues (see #354).